Development of large web based applications using scripting languages such as PHP or JavaScript can be difficult given the lack of static type checking and abstraction through module systems in many such languages. We argue that static type checking and module systems can help programmers avoid common errors when developing large web appli- cations. The literature indicates that adding an extra layer of abstraction on top of the scripting languages that provides these features can be a solution to this problem. We suggest a solution where the statically typed functional language Haskell is com- piled to JavaScript code, enabling programmers to create web applications in a modular and type safe environment.
An implementation of a compiler, supporting compilation of a subset Haskell to JavaScript, JSHC, is presented as a proof of concept. The compiler has a graphical interface in the form of an Emacs-like text editor extended to contain an interpreter terminal, to allow execution of arbitrary expressions. To allow for client-side compilation, the compiler is written entirely in JavaScript. A comparison between JSHC and another JavaScript based Haskell implementation is presented, as well as some unexpected issues with the Haskell specification.
[1] https://github.com/evilcandybag/JSHC/blob/master/report/proj...