C Compiler written in Haskell powered by 8cc and ELVM.
stack build --fast
NOTE: It takes very very long time to compile.
stack install
Then, 8cc-hs
and elc-hs
commands will be available.
This section explains how to compile C program.
Input : example_c/hello.c
Output: hello
executable
(echo hs && cat example_c/hello.c | 8cc-hs) | elc-hs > hello.hs
stack ghc hello.hs
./hello
Important thing is that 8cc-hs
and elc-hs
are written in pure Haskell.