ABSTRACT
We present a simple compiler, consisting of only 2000 lines of ML, for a strict, impure, monomorphic, and higher-order functional language. Although this language is minimal, our compiler generates as fast code as standard compilers like Objective Caml and GCC for several applications including ray tracing, written in the opti-mal style of each language implementation. Our primary purpose is education at undergraduate level to convince students--as well as average programmers--that functional languages are simple and efficient.
- Comp.lang.ml FAQ. http://www.faqs.org/faqs/meta-lang-faq/.Google Scholar
- The computer language shootout benchmarks. http://shootout.alioth.debian.org/.Google Scholar
- ICFP programming contest. http://icfpcontest.org/.Google Scholar
- MLton Standard ML compiler. http://mlton.org/.Google Scholar
- A. W. Appel. Compiling with Continuations. Cambridge University Press, 1992. Google ScholarDigital Library
- A. W. Appel. Modern Compiler Implementation in ML. Cambridge University Press, 1998. Google ScholarDigital Library
- L. Birkedal, M. Tofte, and M. Vejlstrup. From region inference to von neumann machines via region representation inference. In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 171--183, 1996. Google ScholarDigital Library
- G. J. Chaitin. Register allocation & spilling via graph coloring. In Proceedings of the 1982 SIGPLAN Symposium on Compiler Construction, pages 98--101, 1982. Google ScholarDigital Library
- A. Dijkstra and S. D. Swierstra. Essential Haskell compiler. http://catamaran.labs.cs.uu.nl/twiki/st/bin/view/Ehc/WebHome.Google Scholar
- M. Feeley. The 90 minute Scheme to C compiler. http://www.iro.umontreal.ca/~boucherd/mslug/meetings/20041020/.Google Scholar
- C. Flanagan, A. Sabry, B. F. Duba, and M. Felleisen. The essence of compiling with continuations. In Proceedings of the ACM SIGPLAN '93 Conference on Programming Language Design and Implementation, pages 237--247, 1993. In ACM SIGPLAN Notices, 28(6), June 1993. Google ScholarDigital Library
- B. Ford. Packrat parsing: Simple, powerful, lazy, linear time. In Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming, pages 36--47, 2002. Google ScholarDigital Library
- J. Garrigue. Programming with polymorphic variants. In Proceedings of the 1998 ACM SIGPLAN Workshop on ML, 1998.Google Scholar
- E. Hilsdale, J. M. Ashley, R. K. Dybvig, and D. P. Friedman. Compiler construction using Scheme. In Functional Programming Languages in Education, volume 1022 of Lecture Notes in Computer Science, pages 251--267. Springer-Verlag, 1995. Google Scholar
- T. Jim. What are principal typings and what are they good for? In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 42--53, 1996. Google ScholarDigital Library
- J. L. Lawall and O. Danvy. Continuation-based partial evaluation. In Pro-ceedings of the 1994 ACM Conference on LISP and Functional Programming, volume VII of ACM SIGPLAN Lisp Pointers, pages 227--238, 1994. Google ScholarDigital Library
- Y. Minamide, G. Morrisett, and R. Harper. Typed closure conversion. In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 271--283, 1996. Google ScholarDigital Library
- S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, 1997. Google ScholarDigital Library
- A. Ohori. A polymorphic record calculus and its compilation. ACM Transactions on Programming Languages and Systems, 17(6):844-895, 1995. Google ScholarDigital Library
- S. Peyton Jones and S. Marlow. Secrets of the Glasgow Haskell Compiler inliner. Journal of Functional Programming, 12(4):393--434, 2002. Google ScholarDigital Library
- M. Poletto and V. Sarkar. Linear scan register allocation. ACM Transactions on Programming Languages and Systems, 21(5):895--913, 1999. Google ScholarDigital Library
- D. Remy. Type inference for records in a natural extension of ML. In C. A. Gunter and J. C. Mitchell, editors, Theoretical Aspects of Object-Oriented Programming: Types, Semantics, and Language Design. MIT Press, 1994. Google ScholarDigital Library
- D. Sarkar, O. Waddell, and R. K. Dybvig. A nanopass infrastructure for compiler education. In Proceedings of the Ninth ACM SIGPLAN International Conference on Functional Programming, pages 201 -- 212, 2004. Google ScholarDigital Library
- P. Wadler. Why no one uses functional languages. SIGPLAN Notices, 33(8):23--27, 1998. Google ScholarDigital Library
Index Terms
- MinCaml: a simple and efficient compiler for a minimal functional language
Recommendations
Aspectual Caml: an aspect-oriented functional language
Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingWe propose an aspect-oriented programming (AOP) language called Aspectual Caml based on a strongly-typed functional language Objective Caml with two AOP mechanisms similar to those in AspectJ language. This paper describes the design and implementation ...
Lwt: a cooperative thread library
ML '08: Proceedings of the 2008 ACM SIGPLAN workshop on MLWe present a cooperative thread library for Objective Caml. The library is entirely written in Objective Caml and does not rely on any external C function. Programs involving threads are written in a monadic style. This makes it possible to write ...
Tierless Web Programming in the Large
WWW '18: Companion Proceedings of the The Web Conference 2018Tierless Web programming languages allow combining client-side and server-side programming in a single program. This allows defining expressions with both client and server parts, and at the same time provides good static guarantees regarding client-...
Comments