Results 1  10
of
12
MultiStage Programming: Its Theory and Applications
, 1999
"... MetaML is a statically typed functional programming language with special support for program generation. In addition to providing the standard features of contemporary programming languages such as Standard ML, MetaML provides three staging annotations. These staging annotations allow the construct ..."
Abstract

Cited by 86 (18 self)
 Add to MetaCart
MetaML is a statically typed functional programming language with special support for program generation. In addition to providing the standard features of contemporary programming languages such as Standard ML, MetaML provides three staging annotations. These staging annotations allow the construction, combination, and execution of objectprograms. Our thesis is that MetaML's three staging annotations provide a useful, theoretically sound basis for building program generators. This dissertation reports on our study of MetaML's staging constructs, their use, their implementation, and their formal semantics. Our results include an extended example of where MetaML allows us to produce efficient programs, an explanation of why implementing these constructs in traditional ways can be challenging, two formulations of MetaML's semantics, a type system for MetaML, and a proposal for extending ...
Macros as multistage computations: Typesafe, generative, binding macros in MacroML
 in MacroML. In the International Conference on Functional Programming (ICFP ’01
, 2001
"... ..."
Tag Elimination and JonesOptimality
"... Tag elimination is a program transformation for removing unnecessary tagging and untagging operations from automatically... ..."
Abstract

Cited by 21 (3 self)
 Add to MetaCart
Tag elimination is a program transformation for removing unnecessary tagging and untagging operations from automatically...
Directly reflective metaprogramming
 Journal of Higher Order and Symbolic Computation
, 2008
"... Existing metaprogramming languages operate on encodings of programs as data. This paper presents a new metaprogramming language, based on an untyped lambda calculus, in which structurally reflective programming is supported directly, without any encoding. The language features callbyvalue and ca ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
Existing metaprogramming languages operate on encodings of programs as data. This paper presents a new metaprogramming language, based on an untyped lambda calculus, in which structurally reflective programming is supported directly, without any encoding. The language features callbyvalue and callbyname lambda abstractions, as well as novel reflective features enabling the intensional manipulation of arbitrary program terms. The language is scope safe, in the sense that variables can neither be captured nor escape their scopes. The expressiveness of the language is demonstrated by showing how to implement quotation and evaluation operations, as proposed by Wand. The language’s utility for metaprogramming is further demonstrated through additional representative examples. A prototype implementation is described and evaluated.
Godelisation in the Untyped Lambda Calculus
, 1999
"... It is wellknown that one cannot inside the pure untyped lambda calculus determine equivalence. I.e., one cannot determine if two terms are betaequivalent, even if they both have normal forms. This implies that it is impossible in the pure untyped lambda calculus to do Godelisation, i.e. to write a ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
It is wellknown that one cannot inside the pure untyped lambda calculus determine equivalence. I.e., one cannot determine if two terms are betaequivalent, even if they both have normal forms. This implies that it is impossible in the pure untyped lambda calculus to do Godelisation, i.e. to write a function that can convert a term to a representation of (the normal form of) that term, as equivalence of normalform terms is decidable given their representation. If the lambda calculus is seen as a programming language, this means that you can't from the value of a function find its text. Things are different for simply typed lambda calculus: Berger and Schwichtenberg showed that, given its type, it is possible to convert a function into a representation of its normal form. This was termed "an inverse to the evaluation function", as it turns values into representations. However, the main purpose was for normalising terms. Similarly, Goldberg has shown that for a subset (proper combinators) of the pure untyped lambda calculus, Godelisation is possible. However, the Godeliser itself is not a proper combinator, though it (as all closed lambda terms) can be written by combining proper combinators. In this paper, we investigate Godelisation for the full untyped lambda calculus. To overcome the theoretical impossibility of this, we extend the lambda calculus with a feature that allows limited manipulation of extensional aspects: A finite set of labels on lambda terms and a predicate for comparing these. Within this extended lambda calculus, we can convert terms in the subset corresponding to normal form terms in the classical lambda calculus into their representation. The extension of the lambda calculus (we conjecture) retains the ChurchRosser property. This implies that G...
Tag Elimination and JonesOptimality (includes proofs)
"... . Tag elimination is a program transformation for removing ..."
Decomposing lambda  the Kernel programming language
, 2003
"... The Kernel programming language attempts to expand on the simplicity and versatility of Scheme by exploiting a decomposition of Scheme's lambda constructor into two orthogonal constructors. The primary constructor, called $vau, builds compound combiners that act directly on their unevaluated oper ..."
Abstract
 Add to MetaCart
The Kernel programming language attempts to expand on the simplicity and versatility of Scheme by exploiting a decomposition of Scheme's lambda constructor into two orthogonal constructors. The primary constructor, called $vau, builds compound combiners that act directly on their unevaluated oper ands ("callbytext", or opct'ativ, compound combiners); while a second con structor, called simply wrap, induces evaluation of arguments. This report describes how these constructors work, and explores some of their consequences, including some design differences of Kernel from Scheme that help the programmer to manage the inherent volatility of firstclass operative combiners. This report is an expanded form of material presented to the NEPLS 7 conference, held at WPI in October 2002.
StepIndexing: The Good, the Bad and the Ugly
"... Over the last decade, stepindices have been widely used for the construction of operationallybased logical relations in the presence of various kinds of recursion. We first give an argument that stepindices, or something like them, seem to be required for defining realizability relations between h ..."
Abstract
 Add to MetaCart
Over the last decade, stepindices have been widely used for the construction of operationallybased logical relations in the presence of various kinds of recursion. We first give an argument that stepindices, or something like them, seem to be required for defining realizability relations between highlevel source languages and lowlevel targets, in the case that the lowlevel allows egregiously intensional operations such as reflection or comparison of code pointers. We then show how, much to our annoyance, stepindices also seem to prevent us from exploiting such operations as aggressively as we would like in proving program transformations.
Computational Effects across Generated Binders Maintaining futurestage lexical scope
"... Code generation is the leading approach to making highperformance software reusable. Effects are indispensable in code generators, whether to report failures or to insert letstatements and ifguards. Extensive painful experience shows that unrestricted effects interact with generated binders in und ..."
Abstract
 Add to MetaCart
Code generation is the leading approach to making highperformance software reusable. Effects are indispensable in code generators, whether to report failures or to insert letstatements and ifguards. Extensive painful experience shows that unrestricted effects interact with generated binders in undesirable ways to produce unexpectedly unbound variables, or worse, unexpectedly bound ones. These subtleties prevent experts in the application domain, not in programming languages, from using and extending the generator. A pressing problem is thus to express the desired effects while regulating them so that the generated code is correct, or at least correctly scoped, by construction. In an imminently practical codegeneration framework, we show how to express arbitrary effects, including mutable references and delimited control, that move open code across generated binders. The static types of our generator expressions not only ensure that a welltyped generator produces welltyped and wellscoped code, but also express the lexical scopes of generated binders and prevent mixing up variables with different scopes. This precise notion of lexical scope subsumes the complaints about intuitively wrong example generators in the literature. For the first time, we demonstrate statically safe letinsertion across an arbitrary number of binders. Our framework is implemented as a Haskell library that embeds an extensible typed higherorder domainspecific language. It may be regarded as ‘staged Haskell. ’ The library is convenient to use thanks to the maturity of Haskell, higherorder abstract syntax, and polymorphism over generated type environments.