Abstract
Task migration allows a running program to continue its execution in a different destination environment. Increasingly, execution environments are defined by combinations of cultural and technological constraints, affecting the choice of host language, libraries and tools. A compiler supporting multiple target environments and task migration must be able to marshal continuations and then unmarshal and continue their execution, ideally, even if the language of the destination environment is different. In this paper, we propose a compilation approach based on a virtual machine that strikes a balance between implementation portability and efficiency. We explain its implementation within a Scheme compiler targeting JavaScript, PHP, Python, Ruby and Java -- some of the most popular host languages for web applications. As our experiments show, this approach compares well with other Scheme compilers targeting high-level languages in terms of execution speed, being sometimes up to 3 orders of magnitude faster.
- J. Ashkenas. List of languages compiling to JavaScript, 2015. URL https:// github.com/jashkenas/coffee-script/wiki/ List-of-languages-that-compile-to-JS/.Google Scholar
- H. G. Baker. Cons should not cons its arguments, part II: Cheney on the M.T.A. SIGPLAN Notices, 30(9):17–20, 1995. Google Scholar
Digital Library
- E. Brady. Cross-platform compilers for functional languages. In Proceedings of the 2015 Trends in Functional Programming Symposium, June 2015.Google Scholar
- H. Cejtin, S. Jagannathan, and R. Kelsey. Higher-order distributed objects. ACM Trans. Program. Lang. Syst., 17(5): 704–739, Sept. 1995. ISSN 0164-0925. Google Scholar
Digital Library
- W. D. Clinger, A. H. Hartheimer, and E. M. Ost. Implementation strategies for first-class continuations. Higher Order and Symbolic Computation, 12(1):7–45, 1999. Google Scholar
Digital Library
- M. Feeley. Polling efficiently on stock hardware. In Proceedings of the Conference on Functional Programming Languages and Computer Architecture, FPCA ’93, pages 179– 187, New York, NY, USA, 1993. Google Scholar
Digital Library
- M. Feeley. A better API for first-class continuations. In Scheme and Functional Programming Workshop, SFPW ’01, pages 1–3, 2001.Google Scholar
- M. Feeley. Gambit-C version 4.7.8, 2015. URL http: //gambitscheme.org.Google Scholar
- M. Feeley and J. S. Miller. A parallel virtual machine for efficient Scheme compilation. In Proceedings of the 1990 ACM Conference on LISP and Functional Programming, LFP ’90, pages 119–130, New York, NY, USA, 1990. Google Scholar
Digital Library
- G. Germain, M. Feeley, and S. Monnier. Concurrency oriented programming in Termite Scheme. In Scheme and Functional Programming Workshop, SFPW’06, pages 125–135, 2006. Google Scholar
Digital Library
- Haxe Foundation. Haxe 3 Manual, Apr. 2015. URL http: //haxe.org.Google Scholar
- R. Hieb, R. K. Dybvig, and C. Bruggeman. Representing control in the presence of first-class continuations. In Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language Design and Implementation, volume 25, pages 66–77, New York, NY, USA, 1990. Google Scholar
Digital Library
- S. Jagannathan. Continuation-based transformations for coordination languages. Theoretical Computer Science, 240(1): 117 – 146, 2000. ISSN 0304-3975. Google Scholar
Digital Library
- R. Kelsey, W. Clinger, and J. R. (Editors). Revised 5 report on the algorithmic language Scheme. ACM SIGPLAN Notices, 33(9):26–76, 1998. Google Scholar
Digital Library
- F. Loitsch. JavaScript to Scheme compilation. In Proceedings of the Sixth Workshop on Scheme and Functional Programming, pages 101–116, 2005.Google Scholar
- F. Loitsch. Exceptional continuations in JavaScript. In 2007 Workshop on Scheme and Functional Programming, 2007.Google Scholar
- F. Loitsch. Scheme to JavaScript Compilation. PhD thesis, Université de Nice Sophia Antipolis, 2009.Google Scholar
- M. Serrano and P. Weis. Bigloo: A portable and optimizing compiler for strict functional languages. In Proceedings of the Second International Symposium on Static Analysis, SAS ’95, pages 366–381, London, UK, 1995. Springer-Verlag. Google Scholar
Digital Library
- M. Sperber, R. K. Dybvig, M. Flatt, A. Van Straaten, R. Findler, and J. Matthews. Revised 6 report on the algorithmic language scheme. Journal of Functional Programming, 19:1– 301, 2009. ISSN 1469-7653. Google Scholar
Digital Library
- F. Winkelmann. Chicken-Spock, 2014. URL http://wiki. call-cc.org/eggref/4/spock.Google Scholar
- F. Winkelmann. Chicken Scheme, 2015. URL http://www. call-cc.org/.Google Scholar
- D. Yoo. Building Web Based Programming Environments for Functional Programming. PhD thesis, Worcester Polytechnic Institute, 2012.Google Scholar
Index Terms
Compiling for multi-language task migration
Recommendations
Compiling for multi-language task migration
DLS 2015: Proceedings of the 11th Symposium on Dynamic LanguagesTask migration allows a running program to continue its execution in a different destination environment. Increasingly, execution environments are defined by combinations of cultural and technological constraints, affecting the choice of host language, ...
Deoptimization for dynamic language JITs on typed, stack-based virtual machines
VEE '14: Proceedings of the 10th ACM SIGPLAN/SIGOPS international conference on Virtual execution environmentsWe are interested in implementing dynamic language runtimes on top of language-level virtual machines. Type specialization is a critical optimization for dynamic language runtimes: generic code that handles any type of data is replaced with specialized ...
An object storage model for the truffle language implementation framework
PPPJ '14: Proceedings of the 2014 International Conference on Principles and Practices of Programming on the Java platform: Virtual machines, Languages, and ToolsTruffle is a Java-based framework for developing high-performance language runtimes. Language implementers aiming at developing new runtimes have to design all the runtime mechanisms for managing dynamically typed objects from scratch. This not only ...






Comments