Results 1 - 10
of
20
Implementing Multi-stage Languages Using ASTs, Gensym, and Reflection
- In Krzysztof Czarnecki, Frank Pfenning, and Yannis Smaragdakis, editors, Generative Programming and Component Engineering (GPCE), Lecture Notes in Computer Science
, 2003
"... The paper addresses theoretical and practical aspects of implementing multi-stage languages using abstract syntax trees (ASTs), gensym, and reflection. We present an operational account of the correctness of this approach, and report on our experience with a bytecode compiler called MetaOCaml th ..."
Abstract
-
Cited by 40 (10 self)
- Add to MetaCart
The paper addresses theoretical and practical aspects of implementing multi-stage languages using abstract syntax trees (ASTs), gensym, and reflection. We present an operational account of the correctness of this approach, and report on our experience with a bytecode compiler called MetaOCaml that is based on this strategy. 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.
Normalization by evaluation for Martin-Löf type theory with one universe
- IN 23RD CONFERENCE ON THE MATHEMATICAL FOUNDATIONS OF PROGRAMMING SEMANTICS, MFPS XXIII, ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE
, 2007
"... ..."
Memoization in type-directed partial evaluation
- Proceedings of the 2002 ACM SIGPLAN/SIGSOFT Conference on Generative Programming and Component Engineering, number 2487 in Lecture Notes in Computer Science
, 2002
"... Abstract. We use a code generator—type-directed partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express th ..."
Abstract
-
Cited by 14 (6 self)
- Add to MetaCart
Abstract. We use a code generator—type-directed partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the functions and type-directed partial evaluation provides a convenient setting to obtain the normal form of their composition. However, off-the-shelf type-directed partial evaluation turns out to yield gigantic normal forms. We identify that this gigantism is due to redundancies, and that these redundancies originate in the handling of sums, which uses delimited continuations. We successfully eliminate these redundancies by extending type-directed partial evaluation with memoization capabilities. The result only works for pure functional programs, but it provides an unexpected use of code generation and it yields orders-of-magnitude improvements both in time and in space for type isomorphisms. 1
Term rewriting for normalization by evaluation
- 19–42, International Workshop on Implicit Computational Complexity (ICC’99
"... We extend normalization by evaluation ( rst presented in [5]) from the pure typed-calculus to general higher type term rewriting systems. We distinguish between computational rules and proper rewrite rules, and de ne a domain theoretic model intended to explain why normalization by evaluation for th ..."
Abstract
-
Cited by 10 (2 self)
- Add to MetaCart
We extend normalization by evaluation ( rst presented in [5]) from the pure typed-calculus to general higher type term rewriting systems. We distinguish between computational rules and proper rewrite rules, and de ne a domain theoretic model intended to explain why normalization by evaluation for the former is much more e cient. Normalization by evaluation is proved to be correct w.r.t. this model. 1
From Reduction-Based to Reduction-Free Normalization
, 2004
"... We present a systematic construction of a reduction-free normalization function. Starting from ..."
Abstract
-
Cited by 10 (7 self)
- Add to MetaCart
We present a systematic construction of a reduction-free normalization function. Starting from
The Second Futamura Projection for Type-Directed Partial Evaluation
- HIGHER-ORDER AND SYMBOLIC COMPUTATION
, 1999
"... A generating extension of a program specializes it with respect to some specified part of the input. A generating extension of a program can be formed trivially by applying a partial evaluator to the program; the second Futamura projection describes the automatic generation of non-trivial genera ..."
Abstract
-
Cited by 8 (2 self)
- Add to MetaCart
A generating extension of a program specializes it with respect to some specified part of the input. A generating extension of a program can be formed trivially by applying a partial evaluator to the program; the second Futamura projection describes the automatic generation of non-trivial generating extensions by applying a partial evaluator to itself with respect to the programs. We derive
A Denotational Account of Untyped Normalization by Evaluation
, 2003
"... We show that the standard normalization-by-evaluation construction for the simply-typed ### -calculus has a natural counterpart for the untyped ## -calculus, with the central type-indexed logical relation replaced by a "recursively defined" invariant relation, in the style of Pitts. In fact, the ..."
Abstract
-
Cited by 7 (1 self)
- Add to MetaCart
We show that the standard normalization-by-evaluation construction for the simply-typed ### -calculus has a natural counterpart for the untyped ## -calculus, with the central type-indexed logical relation replaced by a "recursively defined" invariant relation, in the style of Pitts. In fact, the construction can be seen as generalizing a computational-adequacy argument for an untyped, call-by-name language to normalization instead of evaluation. In the
Optimizing Generic Functions
- MATHEMATICS OF PROGRAM CONSTRUCTION, VOLUME 3125 OF LNCS
, 2004
"... Generic functions are defined by induction on the structural representation of types. As a consequence, by defining just a single generic operation, one acquires this operation over any particular type. An instance on a specific type is generated by interpretation of the type's structure. A dire ..."
Abstract
-
Cited by 7 (0 self)
- Add to MetaCart
Generic functions are defined by induction on the structural representation of types. As a consequence, by defining just a single generic operation, one acquires this operation over any particular type. An instance on a specific type is generated by interpretation of the type's structure. A direct translation leads to extremely ine#cient code that involves many conversions between types and their structural representations. In this
Staged Notational Definitions
- GENERATIVE PROGRAMMING AND COMPONENT ENGINEERING (GPCE), LECTURE NOTES IN COMPUTER SCIENCE
, 2003
"... Recent work proposed defining type-safe macros via interpretation into a multi-stage language. The utility of this approach was illustrated with a language called MacroML, in which all type checking is carried out before macro expansion. Building on this work, the goal of this paper is to develo ..."
Abstract
-
Cited by 6 (3 self)
- Add to MetaCart
Recent work proposed defining type-safe macros via interpretation into a multi-stage language. The utility of this approach was illustrated with a language called MacroML, in which all type checking is carried out before macro expansion. Building on this work, the goal of this paper is to develop a macro language that makes it easy for programmers to reason about terms locally. We show 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. Because the MacroML calculus is sensetive to renaming of (what appear locally to be) bound variables, we present a calculus of staged notational definitions (SND) that eliminates the renaming problem but retains MacroML's phase distinction. Additionally, SND incorporates the generality of Griffin's account of notational definitions. We exhibit a formal equational theory for SND and prove its soundness.
Logical Relations for Call-by-value Delimited Continuations
- In Trends in Functional Programming
, 2007
"... Abstract: Logical relations, defined inductively on the structure of types, provide a powerful tool to characterize higher-order functions. They often enable us to prove correctness of a program transformer written with higher-order functions concisely. This paper demonstrates that the technique of ..."
Abstract
-
Cited by 3 (3 self)
- Add to MetaCart
Abstract: Logical relations, defined inductively on the structure of types, provide a powerful tool to characterize higher-order functions. They often enable us to prove correctness of a program transformer written with higher-order functions concisely. This paper demonstrates that the technique of logical relations can be used to characterize call-by-value functions as well as delimited continuations. Based on the traditional logical relations for call-by-name functions, logical relations for call-by-value functions are first defined, whose CPS variant is used to prove the correctness of an offline specializer for the call-by-value λcalculus. They are then modified to cope with delimited continuations and are used to establish the correctness of an offline specializer for the call-by-value λcalculus with delimited continuation constructs, shift and reset. This is the first correctness proof for such a specializer. Along the development, correctness of the continuation-based and shift/reset-based let-insertion and A-normalization is established.

