Epic—A Library for Generating Compilers
Compilers for functional languages, whether strict or non-strict, typed or untyped, need to handle many of the same problems, for example thunks, lambda lifting, optimisation, garbage collection, and system interaction. Although implementation techniques are by now well understood, it remains difficult for a new functional language to exploit these techniques without either implementing a compiler from scratch, or attempting to fit the new language around another existing compiler. Epic is a compiled functional language which exposes functional compilation techniques to a language implementor, with a Haskell API. In this paper we describe Epic and outline how it may be used to implement a high level language compiler, illustrating our approach by implementing compilers for the λ-calculus and a dynamically typed graphics language.
KeywordsGarbage Collection Abstract Syntax High Level Language Functional Language Epic Expression
Unable to display preview. Download preview PDF.
- 1.Augustsson, L.: Cayenne - a language with dependent types. In: Proc. 1998 International Conf. on Functional Programming (ICFP 1998), pp. 239–250 (1998)Google Scholar
- 2.Benke, M.: Alonzo — a compiler for Agda, Talk at Agda Implementors Meeting 6 (2007)Google Scholar
- 3.Boehm, H.-J., Demers, A.J.: Xerox Corporation Silicon Graphic, and Hewlett-Packard Company. A garbage collector for C and C++ (2001)Google Scholar
- 4.Brady, E.: Practical Implementation of a Dependently Typed Functional Programming Language. PhD thesis, University of Durham (2005)Google Scholar
- 5.Brady, E.: Idris — Systems programming meets full dependent types. In: PLPV, pp. 43–54 (2011)Google Scholar
- 8.Lattner, C.: LLVM: An infrastructure for multi-stage optimization. Master’s thesis, Computer Science Dept. University of Illinois at Urbana-Champaign (December 2002)Google Scholar
- 9.Leijen, D.: LVM, the Lazy Virtual Machine. Technical Report UU-CS-2004-05, Institute of Information and Computing Sciences, Utrecht University (August 2005)Google Scholar
- 12.Marlow, S., Peyton Jones, S.: How to make a fast curry: push/enter vs eval/apply. In: International Conference on Functional Programming, Snowbird, pp. 4–15 (2004)Google Scholar
- 14.Norell, U.: Towards a practical programming language based on dependent type theory. PhD thesis, Chalmers University of Technology (September 2007)Google Scholar