[Haskell-cafe] Writing a compiler in Hakell
Martijn van Steenbergen
martijn at van.steenbergen.nl
Wed May 6 03:16:19 EDT 2009
Rouan van Dalen wrote:
> Hi everyone.
> I am designing my own programming language.
> I would like to know what is the best way to go about writing my compiler in haskell.
> What are the tools available in haskell that can help with compiler construction?
> I know about Happy. Is that a good tool to use?
> The compiler is intended for serious use and I would like it to be very efficient, maybe competing
> with compilers written in C. It should also be very easy to extend as the languoge grows.
Be sure to take a look at attribute grammars (AG). From what I hear it
varies whether people like using them, but they're worth a try at least.
The Monad Reader Issue 4 has an introductory article on AGs  by
Wouter Swierstra, explaining what they do and how they are useful. I
hear Happy has an AG system . Probably the most mature standalone AG
is the UUAG , with which the Utrecht Haskell Compiler  was built.
More information about the Haskell-Cafe