Skip to content

mhuesch/schemeCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiles the following language (L5) to assembly & generates executables

e ::= (lambda (x ...) e)
    | x
    | (let ([x e]) e)
    | (letrec ([x e]) e)
    | (if e e e)
    | (new-tuple e ...)
    | (begin e e)
    | (e e ...) ;; application expression
    | prim
    | num
  
prim ::= biop 
       | pred 
       | print
       | new-array
       | aref
       | aset
       | alen

biop ::= + | - | * | < | <= | =
pred ::= number? | a?

To build

  1. cd data && gcc -m64 -c -O2 -o runtime.o runtime-nogc.c && cd -
  2. stack build. It should download & install dependencies, but fail to build because of missing modules.
  3. From the project root, run ./src/genAll.sh. This will create the missing modules.
  4. stack build

About

Compiler for a subset of Scheme

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages