[Haskell-cafe] Experimental compilation of Haskell to Erlang

John Meacham john at repetae.net
Tue May 20 05:23:38 EDT 2008

On Mon, May 19, 2008 at 09:00:53PM +0100, Andrew Coppin wrote:
>> It's a fair bit of engineering work, there are some design decisions
>> to be made - such as how to interface with the host language (if at
>> all). Theoretically its not that hard to come up with something, but
>> it is a fair amount of effort.
> To be sure, I doubt it's what you'd call "trivial". I just ment it looks 
> easier than, say, translating C to Pascal or something.

Actually, It is generally harder. The ghc back end for jhc was far more
problematic than the C backend to keep working. The simple reason is
what I call 'impedance mismatch'. ghc and jhc have sightly different
semantics for unboxed values, the primitives don't quite map one to one.
optimizations that are needed for jhc's back end hurt when translated
to ghc. The high level of haskell is a hinderance more, because it means
compilers do a lot more behind the scenes so there is a lot more "stuff"
to cause conflicts.

A graph reduction machine in C is fairly easy and only needs to be done
once, but one size doesn't fit all and starting from scratch can be much
easier than trying to shoehorn another back end onto your code.  


John Meacham - ⑆repetae.net⑆john⑈

More information about the Haskell-Cafe mailing list