Skip to content

Minimalisp is a small lisp implementation written in Go

License

Notifications You must be signed in to change notification settings

bakku/minimalisp

Repository files navigation

Minimalisp

After reading Crafting Interpreters Minimalisp is my small take on writing a programming language from scratch. It mimicks the approach of the jlox implementation and uses a tree-walking approach to interpret source code.

Compiling

To compile Minimalisp just execute:

make

Golang must be installed, of course. This will create an mlisp executable in the cmd/mlisp folder.

Usage

Minimalisp can be used either as a REPL or for running simple scripts. Here is an example of Minimalisp code:

(defvar names '(1 2 3 4))
(defun quarter-of (n)
  (let (half (/ n 2))
    (/ half 2)))
  
(let (quarters (map quarter-of names))
  (if (= 0.25 (first quarters))
    (println "yes!")
    (println "no!")))

About

Minimalisp is a small lisp implementation written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published