zhuangzhuang / ljsp

Lisp in your language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ljsp

A toy Lisp implemented using arrays and functions in Javascript. If you're wondering why such an abomination exists, then go check out the blog post that is responsible for its inception.

Examples

["print", "Hello, World!"]

["defn", "greeting", ["name"],
  ["print", "Hello", "name"]]

["greeting", "Dan"]

["=", 5, 5]

["+", 10, 20]

["and", true, true]

["or", true, false]

For more involved examples, take a look in the examples/ directory. To run an example, use bin/run-example example-name.json.

REPL

To use the REPL, clone the repository and run npm install. This will install the dependencies needed for running the REPL (chalk and readline).

Then running ./bin/repl will start it up. See how it is used in the Asciicast below.

asciicast

About

Lisp in your language.


Languages

Language:JavaScript 100.0%