Lumen is a very small, self-hosted Lisp for Lua and JavaScript. It provides a flexible compilation environment with an extensible reader, macros, and

sctb / lumen

submited by
Style Pass
2021-08-16 23:30:03

Lumen is a very small, self-hosted Lisp for Lua and JavaScript. It provides a flexible compilation environment with an extensible reader, macros, and extensible special forms, but otherwise attempts to match the target runtime environment as closely as possible. You can get started by running bin/lumen on a machine with Node.js, Lua, or LuaJIT installed.

Every piece of code in Lumen is an expression, and expressions can be evaluated to give values. Lumen has a few kinds of expressions that evaluate to themselves:

Lists contain other values, and are written by enclosing expressions in parentheses. Operators are called by placing them at the beginning of a list expression, and list values can be constructed using the list operator:

Variables are declared using define and define-global. Variables declared with define are available for use anywhere in subsequent expressions in the same scope, and define-global makes them globally available.

You can see that let accepts a list of names and values, called bindings, or it can work with a single binding. More than one expression can follow the bindings, which works like do:

Leave a Comment
Related Posts