skip to main content
research-article

Compiling for multi-language task migration

Published:21 October 2015Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle Scholar
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. E. Brady. Cross-platform compilers for functional languages. In Proceedings of the 2015 Trends in Functional Programming Symposium, June 2015.Google ScholarGoogle Scholar
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Feeley. A better API for first-class continuations. In Scheme and Functional Programming Workshop, SFPW ’01, pages 1–3, 2001.Google ScholarGoogle Scholar
  8. M. Feeley. Gambit-C version 4.7.8, 2015. URL http: //gambitscheme.org.Google ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. Haxe Foundation. Haxe 3 Manual, Apr. 2015. URL http: //haxe.org.Google ScholarGoogle Scholar
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Jagannathan. Continuation-based transformations for coordination languages. Theoretical Computer Science, 240(1): 117 – 146, 2000. ISSN 0304-3975. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. F. Loitsch. JavaScript to Scheme compilation. In Proceedings of the Sixth Workshop on Scheme and Functional Programming, pages 101–116, 2005.Google ScholarGoogle Scholar
  16. F. Loitsch. Exceptional continuations in JavaScript. In 2007 Workshop on Scheme and Functional Programming, 2007.Google ScholarGoogle Scholar
  17. F. Loitsch. Scheme to JavaScript Compilation. PhD thesis, Université de Nice Sophia Antipolis, 2009.Google ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. F. Winkelmann. Chicken-Spock, 2014. URL http://wiki. call-cc.org/eggref/4/spock.Google ScholarGoogle Scholar
  21. F. Winkelmann. Chicken Scheme, 2015. URL http://www. call-cc.org/.Google ScholarGoogle Scholar
  22. D. Yoo. Building Web Based Programming Environments for Functional Programming. PhD thesis, Worcester Polytechnic Institute, 2012.Google ScholarGoogle Scholar

Index Terms

  1. Compiling for multi-language task migration

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!