2005-10-07

 

A new haskell compiler

Tom Shackell told me today about his "short weekend" project - he has completely reworked the backend of nhc98, and now has what amounts to the bulk of a new compiler he is provisionally calling "yhc" for York Haskell. Neil thinks he should call it THC (Tom's...) instead. :-)

The whole code generator and runtime system has been replaced. It now generates a platform-independent bytecode stored directly in a binary format, instead of encoding it into platform-specific C arrays that needed further C compilation. There are lots of great things about this. The generated code runs about 20% faster. You can copy the bytecode from one architecture to another without needing to recompile. The high-mem bug in nhc98's garbage collector is gone by default (new heap layout). The bytecodes are dynamically linked, so it should be possible to hot-swap running code a la hs-plugins. It works on 64-bit machines. The runtime system can be compiled natively on Windows with VC++, as well as the original gcc on Unix way.

All very cool. Now we just need to replace the frontend as well - get a decent type inference engine etc. Any volunteers?

Comments:
I'll write a new parser for it, using http://www-users.cs.york.ac.uk/~ndm/projects/parsing.php, but there is no way I'm going anywhere near the type checker!
 
Neil was trying to trick me into writing a type checker... He seems to be trying to trick me into all sorts of work lately... Ah well, I'm trying to fob it off onto Olaf now, and Olaf's declaring staunchly "we'd better wait for the 06 standard" which I take to mean "I'm not going near it until at least the end of 2006"

Bob
 
Chameleon is a front end looking for
a backend.

http://www.comp.nus.edu.sg/~sulzmann/chameleon/

They might be interested.

Lots of scope for new type system features.

Or you might find mileage in Hatchet. Jhc uses it.
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?