Skip to content

adhearn/sylph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sylph

A simple lisp compiler, targeting x86-64

Build Instructions

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.

Parsing Sample Input

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.

Current Status

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

About

A simple lisp compiler, targeting x86-64

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published