• Corpus ID: 15707400

A Gentle Introduction to Multi-stage Programming * Preliminary Draft

  title={A Gentle Introduction to Multi-stage Programming * Preliminary Draft},
  author={Walid Taha},
Multi-stage programming (MSP) is a paradigm for developing generic software that does not pay a runtime penalty for this generality. This is achieved through concisely, carefully designed language extensions that support runtime code generation and program execution. Additionally, type systems for MSP languages are designed to statically ensure that dynamically generated programs are type safe (and therefore require no type checking after they are generated). This tutorial is aimed at the… 



Closed Types as a Simple Approach to Safe Imperative Multi-stage Programming

A general notion of closed type as a simple approach to safely introducing computational effects into multistage languages is proposed and demonstrated formally in a core language called Mini-MLrefBN, which combines safely multi-stage constructs and ML-style references.

Multi-Stage Programming: Axiomatization and Type Safety

A multi-stage language is introduced and its axiomatic semantics is an extension of the call-by-value $\lambda$-calculus with staging constructs, and a proof of the soundness of this type system with respect to the reduction semantics is presented.

Typeful Programming

  • L. Cardelli
  • Computer Science
    Formal Description of Programming Concepts
  • 1989
It is shown how typeful programming is best supported by sophisticated type systems, and how these systems can help in clarifying programming issues and in adding power and regularity to languages.

Staged Notational Definitions

It is shown that defining the semantics of macros in this manner helps in developing and verifying not only type systems for macro languages but also equational reasoning principles.

Implementing Multi-stage Languages Using ASTs, Gensym, and Reflection

Current performance measurements reveal interesting characteristics of the underlying OCaml compiler, and illustrate why this strategy can be particularly useful for implementing domain-specific languages in a typed, functional setting.

Macros as multi-stage computations: type-safe, generative, binding macros in MacroML

This paper develops and presents MacroML, an extension of ML that supports inlining, recursive macros, and the definition of new binding constructs, and shows that MacroML is stage- and type-safe: macro expansion does not depend on runtime evaluation, and both stages do not "go wrong".

An Idealized MetaML: Simpler, and More Expressive

This paper presents An Idealized MetaML (AIM), the result of the study of a categorical model for MetaML, and points out that AIM can be verbose, and outlines a possible remedy relating to the strictness of the closed code type.

Environment classifiers

This paper proposes and develops the basic theory for a new approach to typing multi-stage languages based a notion of environment classifiers. This approach involves explicit but lightweight

A Syntactic Approach to Type Soundness

A new approach to proving type soundness for Hindley/Milner-style polymorphic type systems by an adaptation of subject reduction theorems from combinatory logic to programming languages and the use of rewriting techniques for the specification of the language semantics is presented.

Partial evaluation and automatic program generation

This paper presents a guide to the literature the self-applicable scheme specializer, a partial evaluator for a subset of scheme for a first-order functional languages.