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.
Preview
Unable to display preview. Download preview PDF.
References
J. L. Armstrong. The development of erlang. In Proceedings of the International Conference on Functional Programming, pages 196–203, Amsterdam, June 1997.
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.
J. L. Armstrong, S. R. Virding, C. Wikström, and M. C. Williams. Concurrent Programming in Erlang. Prentice Hall, second edition, 1996.
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.
D. Boucher. Lalr-scm. Available at ftp.iro.umontreal.ca in pub/parallele/boucherd.
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.
W. Clinger and J. Rees [editors]. Revised4 Report on the Algorithmic Language Scheme. Lisp Pointers, 4(3):1–55, July–September 1991.
D. Dubé. SILex, user manual. Available at ftp.iro.umontreal.ca in pub/parallele.
M. Feeley. Etos version 1.4. Compiler available at ftp.iro.umontreal.ca in pub/parallele/etos/etos-1.4.
M. Feeley. Gambit-C version 2.7a, user manual. Compiler available at ftp. iro.umontreal.ca in pub/parallele/gambit/gambit-2.7.
M. Feeley. Polling efficiently on stock hardware. In Proceedings of the Functional Programming and Computer Architecture Conference, pages 179–187, Copenhagen, June 1993.
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.
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.
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.
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.
IEEE Standard for the Scheme Programming Language. IEEE Standard 1178-1990, IEEE, New York, 1991.
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.
The Internet Scheme Repository. http://www.cs.indiana.edu/scheme-repository.
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.
Author information
Authors and Affiliations
Editor information
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