Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2620678.2620680acmotherconferencesArticle/Chapter ViewAbstractPublication PagesiflConference Proceedingsconference-collections
research-article

Compilation à la Carte

Published: 28 August 2013 Publication History

Abstract

In previous work, we proposed a new approach to the problem of implementing compilers in a modular manner, by combining earlier work on the development of modular interpreters using monad transformers with the à la carte approach to modular syntax. In this article, we refine and extend our existing framework in a number of directions. In particular, we show how generalised algebraic datatypes can be used to support a more modular approach to typing individual language features, we increase the expressive power of the framework by considering mutable state, variable binding, and the issue of noncommutative effects, and we show how the Zinc Abstract Machine can be adapted to provide a modular universal target machine for our modular compilers.

References

[1]
P. Bahr and T. Hvitved. Compositional Data Types. In Proceedings of the Seventh ACM SIGPLAN Workshop on Generic Programming, WGP '11, pages 83--94, New York, NY, USA, Sept. 2011. ACM.
[2]
P. Bahr and T. Hvitved. Parametric Compositional Data Types. In J. Chapman and P. B. Levy, editors, Proceedings Fourth Workshop on Mathematically Structured Functional Programming, volume 76 of Electronic Proceedings in Theoretical Computer Science, pages 3--24. Open Publishing Association, Feb. 2012.
[3]
A. Bauer and M. Pretnar. Programming with Algebraic Effects and Handlers. CoRR, abs/1203.1539, 2012.
[4]
N. Benton and A. Kennedy. Exceptional syntax. Journal of Functional Programming, 11(4):395--410, July 2001.
[5]
M. M. T. Chakravarty, G. Keller, S. P. Jones, and S. Marlow. Associated Types With Class. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '05, pages 1--13, New York, NY, USA, 2005. ACM.
[6]
A. Chlipala. Parametric Higher-Order Abstract Syntax for Mechanized Semantics. In Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP '08, pages 143--156. ACM, 2008.
[7]
A. Church. An Unsolvable Problem Of Elementary Number Theory. American Journal of Mathematics, 58(2):345--363, 1936.
[8]
P. L. Curien. The λρ-Calculus: An Abstract Framework For Environment Machines. Rapport de Recherche LIENS-88-10, Ecole Normale Supérieure, Paris, France, 1988.
[9]
L. E. Day and P. Bahr. Pick'n'Fix: Modular Control Structures. University of Nottingham, October 2013.
[10]
L. E. Day and G. Hutton. Towards Modular Compilers For Effects. In Proceedings of the 12th International Conference on Trends in Functional Programming, TFP'11, pages 49--64, Berlin, Heidelberg, 2012. Springer-Verlag.
[11]
N. G. de Bruijn. Lambda Calculus Notation with Nameless Dummies, a Tool for Automatic Formula Manipulation, with Application to the Church-Rosser Theorem. Studies in Logic and the Foundations of Mathematics, 133:375--388, 1994.
[12]
B. Delaware, B. C. d. S. Oliveira, and T. Schrijvers. Metatheory à La Carte. In Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '13, pages 207--218, New York, NY, USA, 2013. ACM.
[13]
S. Diehl, P. Hartel, and P. Sestoft. Abstract Machines For Programming Language Implementation. Future Generation Computer Systems, 16(7):739--751, 2000.
[14]
T. Ekman and G. Hedin. The JastAdd System - Modular Extensible Compiler Construction. Science of Computer Programming, 69(1-3): 14--26, 2007.
[15]
A. Gill. The MTL Package. Hackage, June 2012.
[16]
W. L. Harrison and S. N. Kamin. Compilation as Metacomputation: Binding Time Separation in Modular Compilers. In 5th Mathematics of Program Construction Conference, MPC 2000, Ponte de Lima, 1998.
[17]
M. Hyland, G. Plotkin, and J. Power. Combining Effects: Sum and Tensor. Theoretical Computer Science, 357:7099, 2006.
[18]
M. Jaskelioff. Monatron: An Extensible Monad Transformer Library. In Implementation and Application of Functional Languages, 2008.
[19]
M. Jaskelioff. Lifting of Operations in Modular Monadic Semantics. PhD thesis, University of Nottingham, 2009.
[20]
M. Jaskelioff, N. Ghani, and G. Hutton. Modularity and Implementation of Mathematical Operational Semantics. In Proceedings of the Workshop on Mathematically Structured Functional Programming, Reykjavik, Iceland, July 2008.
[21]
N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall International, 1993.
[22]
O. Kammar, S. Lindley, and N. Oury. Handlers in action. SIGPLAN Notices, 48(9):145--158, Sept. 2013.
[23]
O. Kiselyov, A. Sabry, and C. Swords. Extensible Effects: An Alternative To Monad Transformers. In C. chieh Shan, editor, Haskell, pages 59--70. ACM, 2013.
[24]
C. Lattner and V. Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Proceedings of the International Symposium on Code Generation and Optimization: Feedback-Directed and Runtime Optimization, CGO '04, pages 75--88, Washington, DC, USA, 2004. IEEE Computer Society.
[25]
P. Lee. Realistic Compiler Generation. MIT Press, 1989.
[26]
S. Liang, P. Hudak, and M. Jones. Monad Transformers and Modular Interpreters. In Proceedings of the 22nd ACM Symposium on Principles of Programming Languages. ACM Press, 1995.
[27]
E. Meijer and G. Hutton. Bananas In Space: Extending Fold and Unfold To Exponential Types. In Proceedings of the 7th SIGPLAN-SIGARCH-WG2.8 International Conference on Functional Programming and Computer Architecture. ACM Press, La Jolla, California, 1995.
[28]
E. Meijer, M. Fokkinga, and R. Paterson. Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire. In J. Hughes, editor, Proceedings of the Conference on Functional Programming and Computer Architecture, pages 124--144. Springer-Verlag, 1991.
[29]
N. P. Mendler. Inductive Types and Type Constraints in the Second-Order Lambda Calculus. Annals of Pure and Applied Logic, 51(1-2): 159--172, 1991.
[30]
M. Mernik and V. Umer. Incremental Programming Language Development. Computer Languages, Systems and Structure, 31(1):1--16, 2005.
[31]
B. C. Oliveira and W. R. Cook. Functional Programming with Structured Graphs. SIGPLAN Notices, 47(9):77--88, Sept. 2012.
[32]
F. Pfenning and C. Elliot. Higher-Order Abstract Syntax. SIGPLAN Notices, 23(7):199--208, June 1988.
[33]
G. Plotkin and J. Power. Computational Effects and Operations: An Overview. Electronic Notes on Theoretical Computer Science, 73: 149163, 2004.
[34]
J. C. Reynolds. Definitional Interpreters for Higher-Order Programming Languages. In Reprinted from the Proceedings of the 25th ACM National Conference, pages 717--740. ACM, 1972.
[35]
J. C. Reynolds. Towards A Theory Of Type Structure. In Symposium on Programming, pages 408--423, London, UK, 1974. Springer-Verlag.
[36]
T. Schrijvers and B. C. D. S. Oliveira. Monads, Zippers and Views: Virtualizing the Monad Stack. In Proceeding of the 16th ACM SIGPLAN International Conference on Functional Programming, IFCP 2011, Tokyo, Japan, 2011.
[37]
T. Sheard. Languages of the Future. In OOPSLA '04: Companion to the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 116--119. ACM Press, 2004.
[38]
S. D. Swierstra, P. R. A. Alcocer, J. Saraiva, D. Swierstra, P. Azero, and J. Saraiva. Designing and Implementing Combinator Languages. In Third Summer School on Advanced Functional Programming, volume 1608 of LNCS, pages 150--206. Springer-Verlag, 1999.
[39]
W. Swierstra. Data Types à la Carte. Journal of Functional Programming, 18:423--436, July 2008.
[40]
M. Viera. First Class Syntax, Semantics, and Their Composition. PhD thesis, 2013.
[41]
S. Visscher. The Control. Effects Package. Hackage, 2013.
[42]
P. Wadler. Monads for Functional Programming. In M. Broy, editor, Proceedings of the Marktoberdorf Summer School on Program Design Calculi. Springer--Verlag, 1992.
[43]
P. Wadler. The Expression Problem. Available online at: http://tinyurl.com/wadler-ep, 1998.
[44]
M. Wand. Deriving Target Code as a Representation of Continuation Semantics. ACM TOPLAS, 4(3):496--517, July 1982.
[45]
E. V. Wyk, D. Bodin, J. Gao, and L. Krishnan. Silver: An Extensible Attribute Grammar System. Science of Computer Programming, 75 (1-2):39--54, 2010.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
IFL '13: Proceedings of the 25th symposium on Implementation and Application of Functional Languages
August 2013
146 pages
ISBN:9781450329880
DOI:10.1145/2620678
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 28 August 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. catamorphisms
  2. compilation
  3. modularity
  4. monads

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

IFL '13

Acceptance Rates

Overall Acceptance Rate 19 of 36 submissions, 53%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)6
  • Downloads (Last 6 weeks)1
Reflects downloads up to 13 Sep 2024

Other Metrics

Citations

Cited By

View all

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media