4 ms·
If anyone's interested in a similar project written in Haskell, a few months back I wrote a compiler for C-Minus, which has a similar syntax. It uses Parsec for
by a-priori 17y ago
If anyone's interested in a similar project written in Haskell, a few months back I wrote a compiler for C-Minus, which has a similar syntax. It uses Parsec for the front-end and a custom backend that targets a simple virtual machine (this was a school project), so no LLVM unfortunately. An LLVM-based backend wouldn't be cool to add though.
Anyways, I figured someone may find it interesting.
http://github.com/michaelmelanson/cminus-compiler http://github.com/michaelmelanson/cminus-compiler
- sketerpot 17y agoI notice that Haskell has LLVM bindings, and Parsec makes writing parsers remarkably non-painful. http://augustss.blogspot.com/2009/01/llvm-llvm-low-level-virtual-machine-is.html http://augustss.blogspot.com/2009/01/llvm-llvm-low-level-vir...
- a-priori 17y agoOh, that'll teach me to double-check my posts before I submit them. I meant to say that an LLVM backend wouldn't be hard to add (or, would be cool to add). Thanks for the link!