Skip to main content

Epic—A Library for Generating Compilers

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7193))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   72.00
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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 

  6. 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)

    Chapter  Google Scholar 

  7. 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)

    Chapter  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 

  10. Letouzey, P.: A New Extraction for Coq. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 200–219. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  11. Löh, A., McBride, C., Swierstra, W.: A tutorial implementation of a dependently typed lambda calculus. Fundam. Inform. 102(2), 177–207 (2010)

    MATH  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 

  13. 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)

    Chapter  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 

  15. Peyton Jones, S.: Implementing lazy functional languages on stock hardware – the Spineless Tagless G-machine. Journal of Functional Programming 2(2), 127–202 (1992)

    Article  MATH  Google Scholar 

  16. 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)

    Chapter  Google Scholar 

  17. 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)

    Chapter  Google Scholar 

  18. 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)

    Chapter  Google Scholar 

  19. 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)

    Chapter  Google Scholar 

  20. 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)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics