Abstract
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.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Augustsson, L.: Cayenne - a language with dependent types. In: Proc. 1998 International Conf. on Functional Programming (ICFP 1998), pp. 239–250 (1998)
Benke, M.: Alonzo — a compiler for Agda, Talk at Agda Implementors Meeting 6 (2007)
Boehm, H.-J., Demers, A.J.: Xerox Corporation Silicon Graphic, and Hewlett-Packard Company. A garbage collector for C and C++ (2001)
Brady, E.: Practical Implementation of a Dependently Typed Functional Programming Language. PhD thesis, University of Durham (2005)
Brady, E.: Idris — Systems programming meets full dependent types. In: PLPV, pp. 43–54 (2011)
Brady, E., Hammond, K.: Scrapping your inefficient engine: using partial evaluation to improve domain-specific language implementation. In: ICFP 2010: Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming, pp. 297–308. ACM, New York (2010)
Chapman, J., Dagand, P.-E., McBride, C., Morris, P.: The gentle art of levitation. In: ICFP 2010: Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming, pp. 3–14. ACM, New York (2010)
Lattner, C.: LLVM: An infrastructure for multi-stage optimization. Master’s thesis, Computer Science Dept. University of Illinois at Urbana-Champaign (December 2002)
Leijen, D.: LVM, the Lazy Virtual Machine. Technical Report UU-CS-2004-05, Institute of Information and Computing Sciences, Utrecht University (August 2005)
Letouzey, P.: A New Extraction for Coq. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 200–219. Springer, Heidelberg (2003)
Löh, A., McBride, C., Swierstra, W.: A tutorial implementation of a dependently typed lambda calculus. Fundam. Inform. 102(2), 177–207 (2010)
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)
Mitchell, N.: Rethinking supercompilation. In: Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming, ICFP 2010, pp. 309–320. ACM, New York (2010)
Norell, U.: Towards a practical programming language based on dependent type theory. PhD thesis, Chalmers University of Technology (September 2007)
Peyton Jones, S.: Implementing lazy functional languages on stock hardware – the Spineless Tagless G-machine. Journal of Functional Programming 2(2), 127–202 (1992)
Jones, S.L.P., Nordin, T., Oliva, D.: C–: A Portable Assembly Language. In: Clack, C., Hammond, K., Davie, T. (eds.) IFL 1997. LNCS, vol. 1467, pp. 1–19. Springer, Heidelberg (1998)
Pfenning, F., Elliot, C.: Higher-order abstract syntax. In: Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation, PLDI 1988, pp. 199–208. ACM, New York (1988)
Smetsers, S., Nöcker, E., van Groningen, J., Plasmeijer, R.: Generating Efficient Code for Lazy Functional Languages. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 592–617. Springer, Heidelberg (1991)
Terei, D.A., Chakravarty, M.M.: An LLVM backend for GHC. In: Proceedings of the Third ACM Haskell Symposium, Haskell 2010, pp. 109–120. ACM, New York (2010)
Wadler, P., Findler, R.B.: Well-Typed Programs Can’t Be Blamed. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 1–16. Springer, Heidelberg (2009)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Brady, E. (2012). Epic—A Library for Generating Compilers. In: Peña, R., Page, R. (eds) Trends in Functional Programming. TFP 2011. Lecture Notes in Computer Science, vol 7193. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-32037-8_3
Download citation
DOI: https://doi.org/10.1007/978-3-642-32037-8_3
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-32036-1
Online ISBN: 978-3-642-32037-8
eBook Packages: Computer ScienceComputer Science (R0)