JSHC: a haskell compiler/interpreter written entirely in javascript
github.com
github.com
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...
In fact I wanted to start my own -- except I don't have a single clue of how to even go about doing something like that. Though now that I think about it, I wish all the effort was put into a single project that wouldn't die off within a few months of going public.
Either that or read op on writing interpreters. They can be amazingly simple...
Interestingly, the report mentions that none of the authors knew Javascript before they started.