Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gleam-lang/example-lisp-interpreter

👾 A Lisp interpreter in Gleam!
https://github.com/gleam-lang/example-lisp-interpreter

example gleam lisp

Last synced: 27 days ago
JSON representation

👾 A Lisp interpreter in Gleam!

Awesome Lists containing this project

README

        

# Glisp

A tree-walking Lisp interpreter written in [Gleam](https://gleam.run)!

It features:
- [x] Ints with `+`, `-`, `*`, and `/`.
- [x] Bools with `not`, `and`, and `or`.
- [x] Comparison with `=`.
- [x] Lists with `empty`, `cons`, `car`, `cdr`.
- [x] Closures with `lambda`.
- [x] Global variables with `define`.
- [x] Local variables with `let`.
- [x] Flow control with `if`.

## Usage

```gleam
import glisp

pub fn main() {
glisp.eval("(+ 1 2 3)") //=> "6"
}
```

# Caveats

I wrote this on a transatlantic flight on a day that involved no sleep so expect
bugs and other curiosities.