[Haskell-cafe] Experimental compilation of Haskell to Erlang

Andrew Coppin andrewcoppin at btinternet.com
Mon May 19 16:00:53 EDT 2008


Neil Mitchell wrote:
> Hi
>
>   
>> Two (somewhat tangental) thoughts come to mind.
>>
>> 1. Should it not, in theory at least, be *relatively* easy to target Haskell
>> at anything that has a graph reduction machine? (You target Erlang, somebody
>> else has targetted JavaScript, I myself attempted to target Java...)
>>     
>
> 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.

>> 2. How come all these projects use Yhc? According to the wiki, Yhc doesn't
>> even _work_ yet. What gives?
>>     
>
> These projects use Yhc.Core - a Core language to which Haskell can be
> translated. At the moment, Yhc is the only compiler that can generate
> Yhc.Core, but Yhc.Core is a complete abstraction layer. There is
> currently work going on to translate GHC.Core to Yhc.Core, which would
> mean that you can then translate any GHC program (including
> rank-2-implicit-polymorphic-linear-super-ADTs etc.) to Yhc.Core, and
> then on to Erlang. The actual translation is trivial, but getting
> GHC.Core out of GHC for all the base libraries is hard.
>
> The reason I use Yhc.Core is because its a nice standalone library,
> with useful tools and functionality, which is highly stable. There is
> no library which is comparable.
>   

I see... [I think.]



More information about the Haskell-Cafe mailing list