@TECHREPORT{Department96compilinghaskell, author = {Mark Tullsen Department and Mark Tullsen}, title = {Compiling Haskell to Java}, institution = {}, year = {1996} }
Share
OpenURL
Abstract
Two things have been accomplished in this work: the rst is an implementation of a Haskell to Java compiler. The Glasgow Haskell compiler is used as a front end and outputs an intermediate language called the Spineless Tagless G-Machine language which is then parsed and then translated to Java source code. The Java compiler is then used to generate byte codes for the Java Virtual Machine. The compiler currently does not implement the IO monad nor all primitive functions to fully support Haskell. The second accomplishment is an investigation of the representation decisions in compiling a lazy, polymorphic, functional programming language to the Java Virtual Machine (e.g., representing thunks, rst class functions, and algebraic data types). The salient properties of the Java Virtual Machine which inuence these representation decisions are the following: it has no rst class functions, no pointers, and no algebraic data types; it is dynamically typed and is garbage collected.