|
[LS07c] | Loitsch, F. and Serrano, M. -- Hop Client-Side Compilation -- Proceedings of the 8th Symposium on Trends on Functional Languages, New Yort, USA, Apr, 2007. |
| [ http://cs.shu.edu/tfp2007/draftProcDocument.pdf | pdf ] |
|
| 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 unites 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. T his 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 JavaScript 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 optimizes tail-recursive calls. We show in this paper that this compiler is efficient because with optimizations for obvious tail recursive calls the generated code runs roughly at the same speed as equivalent hand-written JavaScript code. With support for all tail calls the generated code typically runs at most 2.1 times slower than without. The techniques presented in this paper can be applied to most strict functional languages such as ML and Lisp. |
|
| |
[BSS04c] | Bres, Y. and Serpette, B. and Serrano, M. -- Bigloo.NET: compiling Scheme to .NET CLR -- Journal of Object Technology, 3(9), Oct, 2004. |
| [ html | issue_2004_09 ] |
|
| This paper presents the compilation of the Scheme programming language to .NET. This platform provides a virtual machine, the Common Language Runtime (CLR), that executes bytecode, the Common Intermediate Language (CIL). Since CIL was designed with language agnosticism in mind, it provides a rich set of language constructs and functionalities. As such, the CLR is the first execution environment that offers type safety, managed memory, tail recursion support and several flavors of pointers to functions. Therefore, the CLR presents an interesting ground for functional language implementations.
We discuss how to map Scheme constructs to CIL. We present performance analyses on a large set of real-life and standard Scheme benchmarks. In particular, we compare the speed of these programs when compiled to C, JVM and .NET. We show that in term of speed performance of the Mono implementation of .NET, the best implementing running on both Windows and Linux, still lags behind C and fast JVMs such as the Sun's implementations. |
|
| |
[BSS04d] | Bres, Y. and Serpette, B. and Serrano, M. -- Compiling Scheme programs to .NET Common Intermediate Language -- 2nd International Workshop on .NET Technologies, Plzen, Czech Republic, May, 2004. |
| [ pdf ] |
|
| We present in this paper the compilation of the Scheme programming language to .Net platform. .Net provides a virtual machine, the Common Language Runtime (CLR), that executes bytecode, the Common Intermediate Language (CIL). Since CIL was designed with language agnosticism in mind, it provides a rich set of language constructs and functionalities. Therefore, the CLR is the first execution environment that offers type safety, managed memory, tail recursion support and several flavors of pointers to functions. As such, the CLR presents an interesting ground for functional language implementations.
We discuss how to map Scheme constructs to CIL. We present performance analyses on a large set of real-life and standard Scheme benchmarks. In particular, we compare the performances of Scheme programs when compiled to C, JVM and .Net. We show that .Net still lags behind C and JVM. |
|
| |
[SS02b] | Serpette, B. and Serrano, M. -- Compiling Scheme to JVM bytecode: a performance study -- 7th sigplan International Conference on Functional Programming (ICFP), Pittsburgh, Pensylvanie, USA, Oct, 2002. |
| [ ps.gz ] |
|
| We have added a Java virtual machine (henceforth JVM) bytecode generator to the optimizing Scheme-to-C compiler Bigloo. We named this new compiler BiglooJVM. We have used this new compiler to evaluate how suitable the JVM bytecode is as a target for compiling strict functional languages such as Scheme. In this paper, we focus on the performance issue. We have measured the execution time of many Scheme programs when compiled to C and when compiled to JVM. We found that for each benchmark, at least one of our hardware platforms ran the BiglooJVM version in less than twice the time taken by the Bigloo version. In order to deliver fast programs the generated JVM bytecode must be carefully crafted in order to benefit from the speedup of just-in-time compilers. |
|
| |
|