A simple lisp compiler, targeting x86-64
Running make
will make an executable called compile
. Right now, this executable will only (very verbosely) parse programs in the current language. There's also a tiny test suite for testing some of the tiny generic list implementation. You can run the tests with make test
. make clean
will remove files generated by make
.
sample.ss
contains an example of the structure of what we can currently parse. The executable reads from stdin, so to see a sample parse, just do ./compile < sample.ss
.
Currently can parse a simple IR, but doesn't actually compile anything.
In BNF, the current language looks like:
Program ==:: (letrec ((var l-expr)* ...) var)
L-Expr ==:: (lambda (var* ...) value)
Value ==:: (if Predicate Value Value)
| (begin Effect* ... Value)
| (primcall vprim Value* ...) ;
| (Value Value* ...)
| SimpleVal
Predicate ==:: (if Predicate Predicate Predicate)
| (begin Effect* ... Predicate)
| (primcall pprim Value* ...)
| (true)
| (false)
Effect ==:: (set! var Value)
| (if Predicate Effect Effect)
| (begin Effect* ... Effect)
| (primcall eprim Value* ...)
SimpleVal ==:: var
| (quote constant)
constant ==:: integer
| boolean