An Optimizing Compiler for a Purely Functional Web-Application Language
Author(s)
Chlipala, Adam
DownloadAccepted version (355.2Kb)
Terms of use
Metadata
Show full item recordAbstract
High-level scripting languages have become tremendously popular for development of dynamic Web applications. Many programmers appreciate the productivity benefits of automatic storage management, freedom from verbose type annotations, and so on. While it is often possible to improve performance substantially by rewriting an application in C or a similar language, very few programmers bother to do so, because of the consequences for human development effort. This paper describes a compiler that makes it possible to have most of the best of both worlds, coding Web applications in a high-level language but compiling to native code with performance comparable to handwritten C code. The source language is Ur/Web, a domain-specific, purely functional, statically typed language for the Web. Through a coordinated suite of relatively straightforward program analyses and algebraic optimizations, we transform Ur/Web programs into almost-idiomatic C code, with no garbage collection, little unnecessary memory allocation for intermediate values, etc. Our compiler is in production use for commercial Web sites supporting thousands of users, and microbenchmarks demonstrate very competitive performance versus mainstream tools.
Date issued
2015-08Department
Massachusetts Institute of Technology. Computer Science and Artificial Intelligence LaboratoryPublisher
Association for Computing Machinery (ACM)
Citation
Chlipala, Adam. 2015. "An Optimizing Compiler for a Purely Functional Web-Application Language."
Version: Author's final manuscript