Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A lisp to lua compiler in 100 lines
branch: master

This branch is 53 commits behind meric:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.markdown
l2l.lua
test.lsp

README.markdown

Sample source code

(label a 5)
(print a)
(print (* a 5))

(label double (lambda (x) (* x 2)))
(print (double a))

(print (eval (quote (double (+ 1 2)))))

Sample output

-- header omitted --
a=5
print(a)
print(a*5)
double=function(x) return x*2 end
print(double(a))
print(eval(list(sym("double"),list(sym("+"),1,2))))

Sample output output

5
25
10
6

Quickstart

cd into l2l directory
lua l2l.lua test.lsp out.lua
lua out.lua

Description

A lisp to lua compiler (with parser) in 100 lines.

Motivated by

http://blog.fogus.me/2012/01/25/lisp-in-40-lines-of-ruby/

Something went wrong with that request. Please try again.