We designed and implemented a compiler for Haskell's immediate representation Haskell Core to JavaScript. Purpose of this compiler is the ability to use high level Haskell to develop JavaScript applications. We introduce ups and downs of both languages as well as the gap between them.
We present features and semantics of the language Haskell Core and implementation of compilation of separate constructs in more detail. We explain non-strictness and its simulation in a strict language, define a system and representation for algebraic datatypes as well as pattern matching. We designed immediate representation to serve as a step between a non-strict functional language and a strict imperative one. We also developed the required runtime system for JavaScript and tested the compiled programs in several web browsers.
|