Skip to main content

Compiling Erlang to Scheme

  • Conference paper
  • First Online:
Principles of Declarative Programming (ALP 1998, PLILP 1998)

Abstract

The programming languages Erlang and Scheme have many common features, yet the performance of the current implementations of Erlang appears to be below that of good implementations of Scheme. This disparity has prompted us to investigate the translation of Erlang to Scheme. Our intent is to reuse the mature compilation technology of current Scheme compilers to quickly implement an efficient Erlang compiler. In this paper we describe the design and implementation of the Etos Erlang to Scheme compiler and compare its performance to other systems. The Scheme code produced by Etos is compiled by the Gambit-C Scheme to C compiler and the resulting C code is finally compiled by gcc. One might think that the many stages of this compilation pipeline would lead to an inefficient compiler but in fact, on most of our benchmark programs, Etos outperforms all currently available implementations of Erlang, including the Hipe native code compiler.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. J. L. Armstrong. The development of erlang. In Proceedings of the International Conference on Functional Programming, pages 196–203, Amsterdam, June 1997.

    Google Scholar 

  2. J. L. Armstrong, B. O. Däcker, S. R. Virding, and M. C. Williams. Implementing a functional language for highly parallel real-time applications. In Proceedings of Software Engineering for Telecommunication Switching Systems, Florence, April 1992.

    Google Scholar 

  3. J. L. Armstrong, S. R. Virding, C. Wikström, and M. C. Williams. Concurrent Programming in Erlang. Prentice Hall, second edition, 1996.

    Google Scholar 

  4. Lennart Augustsson. Compiling Pattern Matching. In Jean-Pierre Jouannaud, editor, Conference on Functional Programming Languages and Computer Architecture, Nancy, France, LNCS 201, pages 368–381. Springer Verlag, 1985.

    Google Scholar 

  5. D. Boucher. Lalr-scm. Available at ftp.iro.umontreal.ca in pub/parallele/boucherd.

    Google Scholar 

  6. W. Clinger. Proper Tail Recursion and Space Efficiency. In Proceedings of the Conference on Programming Language Design and Implementation, pages 174–185, Montréal, June 1998. ACM Press.

    Google Scholar 

  7. W. Clinger and J. Rees [editors]. Revised4 Report on the Algorithmic Language Scheme. Lisp Pointers, 4(3):1–55, July–September 1991.

    Google Scholar 

  8. D. Dubé. SILex, user manual. Available at ftp.iro.umontreal.ca in pub/parallele.

    Google Scholar 

  9. M. Feeley. Etos version 1.4. Compiler available at ftp.iro.umontreal.ca in pub/parallele/etos/etos-1.4.

    Google Scholar 

  10. M. Feeley. Gambit-C version 2.7a, user manual. Compiler available at ftp. iro.umontreal.ca in pub/parallele/gambit/gambit-2.7.

    Google Scholar 

  11. M. Feeley. Polling efficiently on stock hardware. In Proceedings of the Functional Programming and Computer Architecture Conference, pages 179–187, Copenhagen, June 1993.

    Google Scholar 

  12. M. Feeley, J. Miller, G. Rozas, and J. Wilson. Compiling Higher-Order Languages into Fully Tail-Recursive Portable C. Technical Report 1078, Département d'informatique et de recherche opérationelle, Université de Montréal, 1997.

    Google Scholar 

  13. P. H. Hartel, M. Feeley, M. Alt, L. Augustsson, P. Baumann, M. Beemster, E. Chailloux, C. H. Flood, W. Grieskamp, J. H. G. Van Groningen, K. Hammond, B. Hausman, M. Y. Ivory, R. E. Jones, J. Kamperman, P. Lee, X. Leroy, R. D. Lins, S. Loosemore, N. Röjemo, M. Serrano, J.-P. Talpin, J. Thackray, S. Thomas, P. Walters, P. Weis, and P. Wentworth. Benchmarking implementations of functional languages with ”Pseudoknot”, a float-intensive benchmark. Journal of Functional Programming, 6(4):621–655, 1996.

    Article  Google Scholar 

  14. B. Hausman. Turbo Erlang: approaching the speed of C. In Evan Tick and Giancarlo Succi, editors, Implementations of Logic Programming Systems, pages 119–135. Kluwer Academic Publishers, 1994.

    Google Scholar 

  15. R. Hieb, R. K. Dybvig, and C. Bruggeman. Representing control in the presence of first-class continuations. ACM SIGPLAN Notices, 25(6):66–77, 1990.

    Article  Google Scholar 

  16. IEEE Standard for the Scheme Programming Language. IEEE Standard 1178-1990, IEEE, New York, 1991.

    Google Scholar 

  17. E. Johansson, C. Jonsson, T. Lindgren, J. Bevemyr, and H. Millroth. A pragmatic approach to compilation of Erlang. UPMAIL Technical Report 136, Uppsala University, Sweden, July 1997.

    Google Scholar 

  18. The Internet Scheme Repository. http://www.cs.indiana.edu/scheme-repository.

    Google Scholar 

  19. Gerald Jay Sussman and Guy Lewis Steele Jr. SCHEME, an interpreter for extended lambda calculus. AI Memo 349, Mass. Inst. of Technology, Artificial Intelligence Laboratory, Cambridge, Mass., December 1975.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Catuscia Palamidessi Hugh Glaser Karl Meinke

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Feeley, M., Larose, M. (1998). Compiling Erlang to Scheme. In: Palamidessi, C., Glaser, H., Meinke, K. (eds) Principles of Declarative Programming. ALP PLILP 1998 1998. Lecture Notes in Computer Science, vol 1490. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0056622

Download citation

  • DOI: https://doi.org/10.1007/BFb0056622

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-65012-6

  • Online ISBN: 978-3-540-49766-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics