A Dependently Typed Multi-Stage Calculus

08/06/2019
by   Akira Kawata, et al.
0

We study a dependently typed extension of a multi-stage programming language a la MetaOCaml, which supports quasi-quotation and cross-stage persistence for manipulation of code fragments as first-class values and eval for the execution of programs dynamically generated by the code manipulation. Dependent types are expected to bring to multi-stage programming enforcement of strong invariants---beyond simple type safety---on the behavior of dynamically generated code. An extension is, however, not trivial because a type system would have to take stages---roughly speaking, the number of surrounding quotations---of types into account. To rigorously study properties of such an extension, we develop lambda^MD, which is an extension of Hanada and Igarashi's typed calculus lambda^% with dependent types, and prove its properties including preservation, confluence, strong normalization for full reduction, and progress for staged reduction. Motivated by code generators such that the type of generated code depends on a value from outside of quotations, we argue the significance of cross-stage persistence in dependently typed multi-stage programming and certain type equivalence that is not directly derived from reduction rules.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/07/2021

A Specification for Typed Template Haskell

Multi-stage programming is a proven technique that provides predictable ...
research
06/15/2019

Approximate Normalization for Gradual Dependent Types

Dependent types help programmers write highly reliable code. However, th...
research
02/19/2020

Functional Pearl: The Distributive λ-Calculus

We introduce a simple extension of the λ-calculus with pairs—called the ...
research
11/15/2021

Moebius: Metaprogramming using Contextual Types – The stage where System F can pattern match on itself (Long Version)

We describe the foundation of the metaprogramming language, Moebius, whi...
research
05/05/2018

Confluent terminating extensional lambda-calculi with surjective pairing and terminal type

For the lambda-calculus with surjective pairing and terminal type, Curie...
research
12/26/2022

Modular Formal Verification of Rust Programs with Unsafe Blocks

Rust is a modern systems programming language whose type system guarante...
research
08/26/2019

Kindly Bent to Free Us

Systems programming often requires the manipulation of resources like fi...

Please sign up or login with your details

Forgot password? Click here to reset