Skip to content

gleam-lang/example-lisp-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glisp

A tree-walking Lisp interpreter written in Gleam!

It features:

  • Ints with +, -, *, and /.
  • Bools with not, and, and or.
  • Comparison with =.
  • Lists with empty, cons, car, cdr.
  • Closures with lambda.
  • Global variables with define.
  • Local variables with let.
  • Flow control with if.

Usage

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.