1.1 Compiler Design alternatives

1.1.1 Direct Compilation

Advantage: possibly higher run-time performance, thanks to a more direct mapping between Haskell and JavaScript.

An example of this approach is Dimitry Golubovsky’s nhc98 to JavaScript Compiler, see [1] and in particular [2].

1.1.2 Two-Stages Compilation

Haskell code is compiled into an intermediate format (bytecodes or C--) that is then compiled to JavaScript. For example: yhc to yhc bytecode to JavaScript (via the yhc bytecode API or similarly with GHCi bytecodes.

Advantage: much faster to develop as there would be less or no changes required in the compiler and the bytecode to JavaScript compilation should be straightforward.

1.2 Compiler Targets

Possible targets for the compiler are:

JavaScript/HTML/CSS

Flash

The OpenLaszlo kernel (currently under development) that can be executed in either Flash or HTML/Web browsers.