Deeper Shallow Embeddings

Jacob Prinz*, G. A. Kavvos, Leonidas Lampropoulos

*Corresponding author for this work

    Research output: Chapter in Book/Report/Conference proceedingConference Contribution (Conference Proceeding)

    1 Citation (Scopus)
    306 Downloads (Pure)

    Abstract

    Deep and shallow embeddings are two popular techniques for embedding a language in a host language with complementary strengths and weaknesses. In a deep embedding, embedded constructs are defined as data in the host: this allows for syntax manipulation and facilitates metatheoretic reasoning, but is challenging to implement - especially in the case of dependently typed embedded languages. In a shallow embedding, by contrast, constructs are encoded using features of the host: this makes them quite straightforward to implement, but limits their use in practice.
    In this paper, we attempt to bridge the gap between the two, by presenting a general technique for extending a shallow embedding of a type theory with a deep embedding of its typing derivations. Such embeddings are almost as straightforward to implement as shallow ones, but come with capabilities traditionally associated with deep ones. We demonstrate these increased capabilities in a number of case studies; including a DSL that only holds affine terms, and a dependently typed core language with computational beta reduction that leverages function extensionality.
    Original languageEnglish
    Title of host publication13th International Conference on Interactive Theorem Proving (ITP 2022)
    EditorsJune Andronick, Leonardo de Moura
    Place of PublicationDagstuhl, Germany
    PublisherSchloss Dagstuhl - Leibniz-Zentrum fuer Informatik, Germany
    Pages28:1-28:18
    Volume237
    ISBN (Electronic)978-3-95977-252-5
    DOIs
    Publication statusPublished - 3 Aug 2022
    Event
    ITP 2022: Thirteenth Conference on Interactive Theorem Proving
    -
    Duration: 7 Aug 202210 Aug 2022

    Publication series

    NameLeibniz International Proceedings in Informatics, LIPIcs
    Volume237
    ISSN (Print)1868-8969

    Conference

    Conference
    ITP 2022: Thirteenth Conference on Interactive Theorem Proving
    Period7/08/2210/08/22

    Bibliographical note

    Publisher Copyright:
    © Jacob Prinz, G. A. Kavvos, and Leonidas Lampropoulos.

    Research Groups and Themes

    • Programming Languages

    Keywords

    • dependent types
    • language embeddings
    • type theory

    Fingerprint

    Dive into the research topics of 'Deeper Shallow Embeddings'. Together they form a unique fingerprint.

    Cite this