A compiler for a subset of Haskell to Combinatory Logic
Adapted from the original version by Ben Lynn
./blynn <binary> <input> <output>
binary is the combinatory logic program to run,
input is the file whose contents are passed to the binary, and
output is the file to write the output to.
- A C compiler and
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), producing
- Check that
If 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.
- Create bootstrapping path from original classy compiler
- Monadic I/O
- putc, getc, filesystems
- Alternate VM in Forth?
Initial phase; parsing and totality, then reduce heap usage.
- Use more typeclasses in this compiler
- Remove undefined, only use total functions
- "Don't pay for what you don't use" (only emit code for functions referenced from main)
- Convert to CPS and perform partial evaluation
- Rewrite in applicative style with typeclasses
- Add block comments
- Use Parsec-style parsing
- Better parser error messages
- Need show instance for Msg
- Separation of Char and Int types
- Add more types to the standard prelude
- Allow class constraint in class declaration like (class Functor f => Applicative f where ...)
- Multi-parameter typeclasses
- Dependent/linear types?