skip to main content
research-article

An interpreter for server-side hop

Published:24 October 2011Publication History
Skip Abstract Section

Abstract

HOP is a Scheme-based multi-tier programming language for the Web. The client-side of a program is compiled to JavaScript, while the server-side is executed by a mix of natively compiled code and interpreted code. At the time where HOP programs were basic scripts, the performance of the server-side interpreter was not a concern; an inefficient interpreter was acceptable. As HOP expanded, HOP programs got larger and more complex. A more efficient interpreter was necessary. This new interpreter is described in this paper. It is compact, its whole implementation counting no more than 2.5 KLOC. It is more than twice faster than the old interpreter and consumes less than a third of its memory. Although it cannot compete with static or JIT native compilers, our experimental results show that it is amongst the fastest interpreters for dynamic languages.

References

  1. J. Bell. Threaded code. Communications of the ACM, 16(6):370--372, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. C.-F. Bolz and A. Rigo. How to not write Virtual Machines for Dynamic Languages. July 2007.Google ScholarGoogle Scholar
  3. G. Boudol, Z. Luo, T. Rezk, and M. Serrano. Towards Reasoning for Web Applications: an Operational Semantics for Hop. In Proceedings of the first Workshop on Analysis and Programming Languages for Web Applications and Cloud Applications (APLWACA'10), Toronto, Canada, June 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Brunthaler. Efficient Interpretation using Quickening. In Proceedings of the Second Dynamic Languages Symposium, pages 1--14, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. Brunthaler. Interpreter instruction scheduling. In Proceedings of the 14th International Conference on Compiler Construction (CC), pages 164--178, Mar. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. CPython development team. Python/ceval.c, Feb. 2011.Google ScholarGoogle Scholar
  7. N. De Bruijn. Lambda Calculus Notation with Nameless Dummies: A Tool for Automatic Formula Manipulation, with Application to the Church-Rosser Theorem. Indagationes Mathematicae, 34(5):381--392, 1972.Google ScholarGoogle ScholarCross RefCross Ref
  8. A. Ertl and D. Gregg. The structure and performance of efficient interpreters. Journal of Instruction-Level Parallelism, 5:1--25, 2003.Google ScholarGoogle Scholar
  9. M. Feeley and G. Lapalme. Using closures for code generation. Computer Languages, 12:47--66, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M.-R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation, PLDI '09, pages 465--478, New York, NY, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. R. Ierusalimschy, L. H. de Figueiredo, and W. Celes. The implementation of Lua 5.0. Journal of Universal Computer Science, 7(11):1159--1176, 2005.Google ScholarGoogle Scholar
  12. R. Kelsey, W. Clinger, and J. Rees. The Revised(5) Report on the Algorithmic Language Scheme. Higher-Order and Symbolic Computation, 11(1), Sept. 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. P. Klint. Interpretation techniques. Software - Practice & Experience, 11(9):963--973, September 1981.Google ScholarGoogle Scholar
  14. F. Loitsch and M. Serrano. Trends in Functional Programming, volume 8, chapter Hop Client-Side Compilation, pages 141--158. Seton Hall University, Intellect Bristol (ed. Morazán, M. T.), UK/Chicago, USA, 2008.Google ScholarGoogle Scholar
  15. M. Mihocka. No execute! - The Common CPU Interpreter Loop Revisited, Sept. 2008.Google ScholarGoogle Scholar
  16. S. Pemberton and M. Daniels. Pascal Implementation: the P4 Compiler and Interpreter. Ellis Horwood, 1983.Google ScholarGoogle Scholar
  17. M. Serrano. HOP, a Fast Server for the Diffuse Web. In Invited paper of the 11th international conference on Coordination Models and Languages (COORDINATION'09), Lisbon, Portugal, June 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Serrano and M. Feeley. Storage Use Analysis and its applications. In 1fst ACM Sigplan Int'l Conference on Functional Programming (ICFP), pages 50--61, Philadelphia, Penn, USA, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Serrano, E. Gallesio, and F. Loitsch. HOP, a language for programming the Web 2.0. In Proceedings of the First Dynamic Languages Symposium, Portland, Oregon, USA, Oct. 2006.Google ScholarGoogle Scholar
  20. M. Serrano and C. Queinnec. A multi-tier semantics for Hop. Higher Order and Symbolic Computation (HOSC), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Tarditi, A. Acharya, and P. Lee. No assembly required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 2(1):161--177, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. O. Waddell, D. Sarkar, and K. Dybvig. Fixing letrec: A faithful yet efficient implementation of scheme's recursive binding construct. Higher-Order and Symbolic Computation, 18(3-4):299--326, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. An interpreter for server-side hop

          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

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 47, Issue 2
            DLS '11
            February 2012
            103 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/2168696
            Issue’s Table of Contents
            • cover image ACM Conferences
              DLS '11: Proceedings of the 7th symposium on Dynamic languages
              October 2011
              114 pages
              ISBN:9781450309394
              DOI:10.1145/2047849
              • General Chair:
              • Theo D'Hondt

            Copyright © 2011 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 24 October 2011

            Check for updates

            Qualifiers

            • research-article

          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!