ABSTRACT
Idris's reflection features allow Idris metaprograms to manipulate a representation of Idris's core language as a datatype, but these reflected terms were designed for ease of type checking and are therefore exceedingly verbose and tedious to work with. A simpler notation would make these programs both easier to read and easier to write. We describe a variation of quasiquotation that uses the language's compiler to translate high-level programs with holes into their corresponding reflected representation, both in pattern-matching and expression contexts. This provides a notation for reflected language that matches the notation used to write programs, allowing readable metaprograms.
- L. Augustsson. Cayenne --- a language with dependent types. In Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming, ICFP '98, pages 239--250, New York, NY, USA, 1998. ACM. . Google ScholarDigital Library
- A. Bawden. Quasiquotation in Lisp. In O. Danvy, editor, Proceedings of the 1999 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pages 4--12, 1999.Google Scholar
- E. Brady. Idris, a general purpose dependently typed programming language: Design and implementation. Journal of Functional Programming, 23:552--593, 9 2013.Google ScholarCross Ref
- E. Burmako. Scala macros: Let our powers combine!: On how rich syntax and static types work with metaprogramming. In Proceedings of the 4th Workshop on Scala, SCALA '13. ACM, 2013. Google ScholarDigital Library
- D. R. Christiansen. Reflect on your mistakes! Lightweight domain specific errors. Unpublished manuscript, 2014.Google Scholar
- D. de Rauglaudre. Camlp4 reference manual, 2003. URL http://pauillac.inria.fr/camlp4/manual/.Google Scholar
- D. Delahaye. A tactic language for the system coq. In Proceedings of Logic for Programming and Automated Reasoning (LPAR), volume 1955 of Lecture Notes in Computer Science, November 2000. Google ScholarDigital Library
- M. Gordon. From LCF to HOL: a short history. In G. Plotkin, C. Stirling, and M. Tofte, editors, Proof, Language, and Interaction: Essays in Honour of Robin Milner, pages 169--186. MIT Press, 2000. Google ScholarDigital Library
- G. Mainland. Why it's nice to be quoted: Quasiquoting for Haskell. In Proceedings of the ACM SIGPLAN Workshop on Haskell, Haskell '07, pages 73--82. ACM, 2007. Google ScholarDigital Library
- C. McBride. Dependently Typed Functional Programs and their Proofs. PhD thesis, University of Edinburgh, 1999.Google Scholar
- Microsoft. Expression trees (c# and visual basic), accessed August, 2014. URL http://msdn.microsoft.com/en-us/library/bb397951.aspx.Google Scholar
- W. v. O. Quine. Mathematical Logic. Harvard University Press, revised edition, 1981.Google Scholar
- D. Shabalin, E. Burmako, and M. Odersky. Quasiquotes for Scala. Technical Report 185242, École polytechnique fédérale de Lausanne, 2013.Google Scholar
- D. Syme. Leveraging .NET meta-programming components from F#: integrated queries and interoperable heterogeneous execution. In Proceedings of the 2006 workshop on ML, pages 43--54. ACM, 2006. Google ScholarDigital Library
- W. Taha and T. Sheard. Metaml and multi-stage programming with explicit annotations. Theoretical computer science, 248(1):211--242, 2000. Google ScholarDigital Library
- The Agda Team. The Agda Wiki, accessed 2014. URL http://wiki.portal.chalmers.se/agda/.Google Scholar
- The MetaOCaml Team. MetaOCaml, accessed 2014. URL http://www.cs.rice.edu/~taha/MetaOCaml/.Google Scholar
- P. van der Walt and W. Swierstra. Engineering proof by reflection in Agda. In R. Hinze, editor, Implementation and Application of Functional Languages, Lecture Notes in Computer Science, pages 157--173. Springer Berlin Heidelberg, 2013. ISBN 978-3-642-41581-4. .Google ScholarCross Ref
- B. Ziliani, D. Dreyer, N. R. Krishnaswami, A. Nanevski, and V. Vafeiadis. Mtac: A monad for typed tactic programming in Coq. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming, ICFP '13, pages 87--100. ACM, 2013. Google ScholarDigital Library
Index Terms
- Type-Directed Elaboration of Quasiquotations: A High-Level Syntax for Low-Level Reflection
Recommendations
Explicitly heterogeneous metaprogramming with MetaHaskell
ICFP '12: Proceedings of the 17th ACM SIGPLAN international conference on Functional programmingLanguages with support for metaprogramming, like MetaOCaml, offer a principled approach to code generation by guaranteeing that well-typed metaprograms produce well-typed programs. However, many problem domains where metaprogramming can fruitfully be ...
Explicitly heterogeneous metaprogramming with MetaHaskell
ICFP '12Languages with support for metaprogramming, like MetaOCaml, offer a principled approach to code generation by guaranteeing that well-typed metaprograms produce well-typed programs. However, many problem domains where metaprogramming can fruitfully be ...
Hygienic quasiquotation in scheme
Scheme '12: Proceedings of the 2012 Annual Workshop on Scheme and Functional ProgrammingQuasiquotation in Scheme is nearly ideal for implementing programs that generate other programs. These programs lack only the ability to generate fresh bound identifiers, as required to make such code-manipulating programs hygienic, but any Scheme ...
Comments