ComputingComputer ScienceCompilersProgramming LanguagesSoftware EngineeringClient-side ScriptingCode GenerationCompiler ConstructionCross-browser CompatibilityCompiler-based GenerationGraphical User InterfacesJavascriptJavascript CompatibilityRecursionServer-side ScriptingSpeedTail Recursion
Hop is a new language for programming interactive Web applications. It aims to replace HTML, JavaScript, and server-side scripting languages (such as PHP, JSP) with a unique language that is used for client-side interactions and server-side computations. A Hop execution platform is made of two compilers: one that compiles the code executed by the server, and one that compiles the code executed by the client. This paper presents the latter. In order to ensure compatibility of Hop graphical user interfaces with popular plain Web browsers, the client-side Hop compiler has to generate regular HTML and Java-Script code. The generated code runs roughly at the same speed as hand-written code. Since the Hop language is built on top of the Scheme programming language, compiling Hop to JavaScript is nearly equivalent to compiling Scheme to JavaScript. The compiler we have designed supports the whole Scheme core language. In particular, it features proper tail recursion. However complete tail recursion optimization may slow down the generated code and is hence disabled in Hop. Most of our benchmarks were unaffected by the transformation but in the worst case programs were more than two times slower with it enabled. The techniques presented in this paper can be applied to most strict functional languages such as ML and Lisp. 1
7
The essence of compiling with continuations
Cormac Flanagan, Amr Sabry, Bruce F. Duba et al. · 1993 · 533 citations
Javier Campos, Carlos T. Calafate, Marga Nácher et al. · 2007 · 138 citations
Proper tail recursion and space efficiency
William Clinger · 1998 · 118 citations · Full text
David Tarditi, Peter Lee, Anurag Acharya · ACM Letters on Programming Languages and Systems · 1992 · 93 citations · Full text
CONS should not CONS its arguments, part II
Henry G. Baker · ACM SIGPLAN Notices · 1995 · 51 citations