SMLtoJs: Hosting a standard ML compiler in a Web browser
Research output: Chapter in Book/Report/Conference proceeding › Article in proceedings › Research › peer-review
Standard ML is a strictly typed functional programming language that provides programmers with many powerful features, including parametric polymorphism, pattern matching, and a rich module system. In this paper, we present SMLtoJs, an optimizing compiler that compiles Standard ML programs into JavaScript to be executed in any JavaScript-supported Web browser. SMLtoJs supports all of Standard ML and most of the Standard ML Basis Library, which allows for the SMLtoJs compiler itself to be compiled and executed in a browser. We present the overall structure of SMLtoJs, including the non-JavaScript aware front-end and the JavaScript-specific backend. We also present SMLtoJs's type safe interface for interacting with native JavaScript, such as the DOM api. Finally, we present the details of the JavaScript-specific optimizations, including how SMLtoJs deals with tail recursion, which enable complex Standard ML programs to be compiled into efficient JavaScript.
Original language | English |
---|---|
Title of host publication | PLASTIC'11 - Proceedings of the 1st ACM SIGPLAN International Workshop on Programming Language and Systems Technologies for Internet Clients |
Number of pages | 10 |
Publication date | 2011 |
Pages | 39-48 |
ISBN (Print) | 9781450311717 |
DOIs | |
Publication status | Published - 2011 |
Event | 1st ACM SIGPLAN International Workshop on Programming Language and Systems Technologies for Internet Clients, PLASTIC'11 - Portland, OR, United States Duration: 24 Oct 2011 → 24 Oct 2011 |
Conference
Conference | 1st ACM SIGPLAN International Workshop on Programming Language and Systems Technologies for Internet Clients, PLASTIC'11 |
---|---|
Land | United States |
By | Portland, OR |
Periode | 24/10/2011 → 24/10/2011 |
Sponsor | ACM SIGPLAN |
Series | PLASTIC'11 - Proceedings of the 1st ACM SIGPLAN International Workshop on Programming Language and Systems Technologies for Internet Clients |
---|
- javascript, standard ml
Research areas
ID: 375210900