A self-hosting mini Haskell compiler with a mini C runtime.
MIT License
This is an elaboration and annotation of Ben Lynn's Haskell compiler and C VM. The main aim is to improve upon the compiler, in various layers (see Future plans).
classy.hs
)String -> String
, which will receive input from stdin and whose output./blynn <binary> <input> <output>
Where binary
is the CL program to run, input
is the
file whose contents are passed to the program, and output
is the file
to write the output to.
make
. That's it!To check self-compilation, run ./check.sh classy.hs
. It does the
following:
classy
(compiler binary) on classy.hs
(compiler source),classy2
classy2
on classy.hs
, producing classy3
classy2
and classy3
are identicalIf you've made a change to what classy.hs
outputs, (e.g. an
optimization to code generation), run ./check_compile.sh classy.hs
instead. It adds another step to the same process in check.sh
to
ensure that the changes propagate.
putc
, getc
, filesystemsInitial phase; parsing and totality, then reduce heap usage.
Msg
do
notation
Char
and Int
typesclass Functor f => Applicative f where ...
)