skip to main content
10.1145/2746325.2746326acmotherconferencesArticle/Chapter ViewAbstractPublication PagesiflConference Proceedingsconference-collections
research-article

Type-Directed Elaboration of Quasiquotations: A High-Level Syntax for Low-Level Reflection

Published:01 October 2014Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle Scholar
  3. E. Brady. Idris, a general purpose dependently typed programming language: Design and implementation. Journal of Functional Programming, 23:552--593, 9 2013.Google ScholarGoogle ScholarCross RefCross Ref
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. R. Christiansen. Reflect on your mistakes! Lightweight domain specific errors. Unpublished manuscript, 2014.Google ScholarGoogle Scholar
  6. D. de Rauglaudre. Camlp4 reference manual, 2003. URL http://pauillac.inria.fr/camlp4/manual/.Google ScholarGoogle Scholar
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. McBride. Dependently Typed Functional Programs and their Proofs. PhD thesis, University of Edinburgh, 1999.Google ScholarGoogle Scholar
  11. Microsoft. Expression trees (c# and visual basic), accessed August, 2014. URL http://msdn.microsoft.com/en-us/library/bb397951.aspx.Google ScholarGoogle Scholar
  12. W. v. O. Quine. Mathematical Logic. Harvard University Press, revised edition, 1981.Google ScholarGoogle Scholar
  13. D. Shabalin, E. Burmako, and M. Odersky. Quasiquotes for Scala. Technical Report 185242, École polytechnique fédérale de Lausanne, 2013.Google ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. W. Taha and T. Sheard. Metaml and multi-stage programming with explicit annotations. Theoretical computer science, 248(1):211--242, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. The Agda Team. The Agda Wiki, accessed 2014. URL http://wiki.portal.chalmers.se/agda/.Google ScholarGoogle Scholar
  17. The MetaOCaml Team. MetaOCaml, accessed 2014. URL http://www.cs.rice.edu/~taha/MetaOCaml/.Google ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarCross RefCross Ref
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Type-Directed Elaboration of Quasiquotations: A High-Level Syntax for Low-Level Reflection

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Other conferences
      IFL '14: Proceedings of the 26nd 2014 International Symposium on Implementation and Application of Functional Languages
      October 2014
      124 pages
      ISBN:9781450332842
      DOI:10.1145/2746325

      Copyright © 2014 ACM

      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 the author(s) 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: 1 October 2014

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed limited

      Acceptance Rates

      IFL '14 Paper Acceptance Rate10of20submissions,50%Overall Acceptance Rate19of36submissions,53%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader