Skip to content

maxcohen31/AttoScheme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AttoScheme

Logo AttoScheme

"An atto-subset for the Scheme programming language"

What is AttoScheme?

AttoScheme is a small interpreter for the Scheme programming language.

Why Scheme? I like its elegance (Lisp elegance in general).

AttoScheme is designed as a learning tool to help understand how interpreters work. It implements a minimal subset of Scheme and is primarily educational.

Features

  • Evaluate basic arithmetic and logical expressions
  • Supports lists, symbols, and standard Scheme data types
  • Simple REPL (Read-Eval-Print Loop) Note: lambda, closures, and other advanced Scheme features are not yet supported.

Project Overview

AttoScheme was developed as a personal project to explore the implementation of interpreters in OCaml. It is not intended as a production-ready interpreter.

How to Use

Make sure to have Opam and Dune installed.

Clone the repository.

From the project root directory, run:

dune build
dune exec _build/default/bin/main.exe

Test:

dune runtest

Make sure to have Opam and Dune installed.

Examples

(+ 2 3) ; 5

(if #t 2 7) ; 2

(< 2 3); #t

(cdr '(a b c)); (b c)

(cons 3 (cons 2(cons 1 '()))); (3 2 1)

'(3 6 9); (3 6 9)

(bit-xor 6 3); 5

From the project root directory, run:

dune build
dune exec _build/default/bin/main.exe

Project structure

├── bin
│   ├── dune         # Dune file for the main executable
│   └── main.ml      # Entry point (REPL)
├── dune-project
├── lib
│   ├── dune         # Library dune file
│   ├── eval.ml      # Evaluation logic
│   └── parser.ml    # Parsing logic
├── lisp_interpreter.opam
└── test
    ├── dune         # Dune test configuration
    └── testing.ml   # Test cases

Contributing

AttoScheme is still a work in progress. Any contribution to it will be very much appreciated!

What AttoScheme lacks right now:

  • Closures
  • Lambda expressions
  • Pairs

License

MIT

About

An atto-subset of the Scheme programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors