Results 1 - 10
of
24
MetaML and Multi-Stage Programming with Explicit Annotations
- Theoretical Computer Science
, 1999
"... . We introduce MetaML, a practically-motivated, staticallytyped multi-stage programming language. MetaML is a "real" language. We have built an implementation and used it to solve multi-stage problems. MetaML allows the programmer to construct, combine, and execute code fragments in a type-safe ..."
Abstract
-
Cited by 201 (30 self)
- Add to MetaCart
. We introduce MetaML, a practically-motivated, staticallytyped multi-stage programming language. MetaML is a "real" language. We have built an implementation and used it to solve multi-stage problems. MetaML allows the programmer to construct, combine, and execute code fragments in a type-safe manner. Code fragments can contain free variables, but they obey the static-scoping principle. MetaML performs typechecking for all stages once and for all before the execution of the first stage. Certain anomalies with our first MetaML implementation led us to formalize an illustrative subset of the MetaML implementation. We present both a big-step semantics and type system for this subset, and prove the type system's soundness with respect to a big-step semantics. From a software engineering point of view, this means that generators written in the MetaML subset never generate unsafe programs. A type system and semantics for full MetaML is still ongoing work. We argue that multi-...
Multi-Stage 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 79 (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 object-programs. 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 ...
Tagless Staged Interpreters for Typed Languages
- In the International Conference on Functional Programming (ICFP ’02
, 2002
"... Multi-stage programming languages provide a convenient notation for explicitly staging programs. Staging a definitional interpreter for a domain specific language is one way of deriving an implementation that is both readable and efficient. In an untyped setting, staging an interpreter "removes a co ..."
Abstract
-
Cited by 43 (11 self)
- Add to MetaCart
Multi-stage programming languages provide a convenient notation for explicitly staging programs. Staging a definitional interpreter for a domain specific language is one way of deriving an implementation that is both readable and efficient. In an untyped setting, staging an interpreter "removes a complete layer of interpretive overhead", just like partial evaluation. In a typed setting however, Hindley-Milner type systems do not allow us to exploit typing information in the language being interpreted. In practice, this can have a slowdown cost factor of three or more times.
XMlambda - A Functional Language for Constructing and Manipulating XML Documents
, 2000
"... XML has been widely adopted as a standard language for describing static documents and data. However, many application domains require XML, and it's cousin HTML, to be ltered and generated dynamically, and each such domain has adopted a language for the tasks at hand. These languages are often ill-s ..."
Abstract
-
Cited by 41 (2 self)
- Add to MetaCart
XML has been widely adopted as a standard language for describing static documents and data. However, many application domains require XML, and it's cousin HTML, to be ltered and generated dynamically, and each such domain has adopted a language for the tasks at hand. These languages are often ill-suited, unsafe, and interact poorly with each other. In this paper we present XM, a small functional language which has XML documents as its basic data types. It is expressly designed for the task of generating and ltering XML fragments. The language is statically typed, which guarantees every document it generates at run-time will conform to its DTD, but also uses type inference to avoid the need for many tedious type annotations. The language is also higher-order and polymorphic, which allows many common programming patterns to be captured in a small highly reusable library. Furthermore, the language uses pattern-matching so that XML fragments may be deconstructed into their components ...
Macros as multi-stage computations: Type-safe, generative, binding macros in MacroML
- in MacroML. In the International Conference on Functional Programming (ICFP ’01
, 2001
"... ..."
An Idealized MetaML: Simpler, and More Expressive
, 1999
"... MetaML is a multi-stage functional programming language featuring three constructs that can be viewed as statically-typed refinements of the back-quote, comma, and eval of Scheme. Thus it provides special support for writing code generators and serves as a semantically sound basis for systems involv ..."
Abstract
-
Cited by 29 (13 self)
- Add to MetaCart
MetaML is a multi-stage functional programming language featuring three constructs that can be viewed as statically-typed refinements of the back-quote, comma, and eval of Scheme. Thus it provides special support for writing code generators and serves as a semantically sound basis for systems involving multiple interdependent computational stages. In previous work, we reported on an implementation of MetaML, and on a small-step semantics and type-system for MetaML. In this paper, we present An Idealized MetaML (AIM) that is the result of our study of a categorical model for MetaML. An important outstanding problem is finding a type system that provides the user with a means for manipulating both open and closed code. This problem has eluded efforts by us and other researchers for over three years. AIM solves the issue by providing two type constructors, one classifies closed code and the other open code, and describing how they interact.
Closed Types for a Safe Imperative MetaML
, 2001
"... This paper addresses the issue of safely combining computational eects and multi-stage programming. We propose a type system, which exploits a notion of closed type, to check statically that an imperative multi-stage program does not cause run-time errors. Our approach is demonstrated formally for a ..."
Abstract
-
Cited by 28 (11 self)
- Add to MetaCart
This paper addresses the issue of safely combining computational eects and multi-stage programming. We propose a type system, which exploits a notion of closed type, to check statically that an imperative multi-stage program does not cause run-time errors. Our approach is demonstrated formally for a core language called MiniML ref . This core language safely combines multi-stage constructs and ML-style references, and is a conservative extension of MiniML ref , a simple imperative subset of SML. In previous work, we introduced a closed type constructor , which was enough to ensure the safe execution of dynamically generated code in the pure fragment of MiniML ref .
Closed Types as a Simple Approach to Safe Imperative Multi-Stage Programming
, 2000
"... Safely adding computational eects to a multi-stage language has been an open problem. In previous work, a closed type constructor was used to provide a safe mechanism for executing dynamically generated code. This paper proposes a general notion of closed type as a simple approach to safely intro ..."
Abstract
-
Cited by 24 (14 self)
- Add to MetaCart
Safely adding computational eects to a multi-stage language has been an open problem. In previous work, a closed type constructor was used to provide a safe mechanism for executing dynamically generated code. This paper proposes a general notion of closed type as a simple approach to safely introducing computational eects into multistage languages. We demonstrate this approach formally in a core language called Mini-ML BN ref . This core language combines safely multi-stage constructs and ML-style references. In addition to incorporating state, Mini-ML BN ref also embodies a number of technical improvements over previously proposed core languages for multi-stage programming.
Logical Modalities and Multi-Stage Programming
, 1999
"... . Multi-stage programming is a method for improving the performance of programs through the introduction of controlled program specialization. This paper makes a case for multi-stage programming with open code and closed values. We argue that a simple language exploiting interactions between two log ..."
Abstract
-
Cited by 18 (13 self)
- Add to MetaCart
. Multi-stage programming is a method for improving the performance of programs through the introduction of controlled program specialization. This paper makes a case for multi-stage programming with open code and closed values. We argue that a simple language exploiting interactions between two logical modalities is well suited for multi-stage programming, and report the results from our study of categorical models for multi-stage languages. Keywords: Multi-stage programming, categorical models, semantics, type systems (multi-level typed calculi) , combination of logics (modal and temporal). 1 Introduction Multi-stage programming is a method for improving the performance of programs through the introduction of controlled program specialization [15, 13]. MetaML was the first language designed specifically to support this method. It provides a type constructor for "code" and staging annotations for building, combining, and executing code, thus allowing the programmer to have finer cont...
DSL Implementation Using Staging and Monads
- In Second Conference on Domain-Specific Languages (DSL'99
, 1999
"... The impact of Domain Specific Languages (DSLs) on software design is considerable. They allow programs to be more concise than equivalent programs written in a high-level programming languages. They relieve programmers from making decisions about data-structure and algorithm design, and thus allows ..."
Abstract
-
Cited by 15 (5 self)
- Add to MetaCart
The impact of Domain Specific Languages (DSLs) on software design is considerable. They allow programs to be more concise than equivalent programs written in a high-level programming languages. They relieve programmers from making decisions about data-structure and algorithm design, and thus allows solutions to be constructed quickly. Because DSL's are at a higher level of abstraction they are easier to maintain and reason about than equivalent programs written in a highlevel language, and perhaps most importantly they can be written by domain experts rather than programmers. The problem is that DSL implementation is costly and prone to errors, and that high level approaches to DSL implementation often produce inefficient systems. By using two new programming language mechanisms, program staging and monadic abstraction, we can lower the cost of DSL implementations by allowing reuse at many levels. These mechanisms provide the expressive power that allows the construction of many compil...

