Fixing Letrec: A Faithful Yet Efficient Implementation of Scheme's Recursive Binding Construct
Rent the article at a discountRent now
* Final gross prices may vary according to local VAT.Get Access
A Scheme letrec expression is easily converted into more primitive constructs via a straightforward transformation given in the Revised5 Report. This transformation, unfortunately, introduces assignments that can impede the generation of efficient code. This article presents a more judicious transformation that preserves the semantics of the revised report transformation and also detects invalid references and assignments to left-hand-side variables, yet enables the compiler to generate efficient code. A variant of letrec that enforces left-to-right evaluation of bindings is also presented and shown to add virtually no overhead.
- Bondorf, A. Similix Manual, System Version 5.0. DIKU, University of Copenhagen, Denmark, 1993.
- Bose, B. DDD—A transformation system for digital design derivation. Technical Report 331, Computer Science Dept., Indiana Univ., Bloomington, Ind., May 1991.
- Burger, R.G. The Scheme machine. Technical Report 413, Computer Science Dept., Indiana Univ., Bloomington, Ind., August 1994.
- Dybvig, R. K., Hieb, R., Bruggeman, C. (1993) Syntactic abstraction in Scheme. Lisp and Symbolic Computation 5: pp. 295-326 CrossRef
- Feeley, M., Turcotte, M., Lapalme, G. (1994) Using Multilisp for solving constraint satisfaction problems: An application to nucleic acid 3D structure determination. Lisp and Symbolic Computation 7: pp. 231-247 CrossRef
- Gabriel, R.P. Performance and Evaluation of LISP Systems. MIT Press Series in Computer Systems. MIT Press, Cambridge, Massachusetts, 1985.
- Kelsey, R., Clinger, W., and Rees, J. Revised5 report on the algorithmic language Scheme. Higher-Order and Symbolic Computation, 11(1) (1998) 7–105.
- Kranz, D.A., Orbit, An optimizing compiler for scheme. PhD thesis, Yale University, May 1988.
- Kranz, D.A., Kelsey, R., Rees, J.A., Hudak, P., Philbin, J., and Adams, N.I. Orbit: an optimizing compiler for Scheme. SIGPLAN Notices, ACM Symposium on Compiler Construction, 21(7) (1986) 219–233.
- Rees, J.A., Adams, N.I., and Meehan, J.R. The T Manual. Yale University, New Haven, Connecticut, USA, 1984. Fourth edition.
- Rozas, G.J. Liar, an Algol-like compiler for Scheme, S.B. Thesis, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, January 1984.
- Rozas, G.J. Taming the Y operator. In Proceedings of the 1992 ACM Conference on Lisp and Functional Programming, San Francisco, USA, June 1992, pp. 226–234.
- Guy L. Steele Jr. Rabbit: A compiler for Scheme. MIT AI Memo 474, Massachusetts Institute of Technology, Cambridge, Mass., May 1978.
- Waddell, O. and Dybvig, R.K. Extending the scope of syntactic abstraction. In Conference Record of the Twenty Sixth Annual ACM Symposium on Principles of Programming Languages, January 1999, pp. 203–213.
- Waddell, O., Sarkar, D., and Dybvig, R.K. Robust and effective transformation of letrec. In Scheme 2002: Proceedings of the Third Workshop on Scheme and Functional Programming, October 2002.
- Wright, A.K. and Cartwright, R. A practical soft type system for scheme. In Proceedings of the 1994 ACM Conference on LISP and Functional Programming, 1994, pp. 250–262.
- Fixing Letrec: A Faithful Yet Efficient Implementation of Scheme's Recursive Binding Construct
Higher-Order and Symbolic Computation
Volume 18, Issue 3-4 , pp 299-326
- Cover Date
- Print ISSN
- Online ISSN
- Kluwer Academic Publishers
- Additional Links
- letrec restriction
- recursive binding construct
- internal definitions
- mutual recursion