Results 1 -
8 of
8
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 ...
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.
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...
Meta-programming through typeful code representation
- In Proceedings of the Eighth ACM SIGPLAN International Conference on Functional Programming
, 2003
"... By allowing the programmer to write code that can generate code at run-time, meta-programming offers a powerful approach to program construction. For instance, meta-programming can often be employed to enhance program efficiency and facilitate the construction of generic programs. However, meta-prog ..."
Abstract
-
Cited by 18 (4 self)
- Add to MetaCart
By allowing the programmer to write code that can generate code at run-time, meta-programming offers a powerful approach to program construction. For instance, meta-programming can often be employed to enhance program efficiency and facilitate the construction of generic programs. However, meta-programming, especially in an untyped setting, is notoriously error-prone. In this paper, we aim at making meta-programming less error-prone by providing a type system to facilitate the construction of correct meta-programs. We first introduce some code constructors for constructing typeful code representation in which program variables are replaced with deBruijn indices, and then formally demonstrate how such typeful code representation can be used to support meta-programming. The main contribution of the paper lies in recognition and then formalization of a novel approach to typed meta-programming that is practical, general and flexible.
A Categorical Analysis of Multi-Level Languages (Extended Abstract)
, 1999
"... We propose categorical models for fl, 2 , MetaML, and AIM. First, we focus on the underlying logical modalities and the interactions between them, then we investigate the interactions between logical modalities and computational monads. We give two examples of categorical model: one simpler but with ..."
Abstract
-
Cited by 10 (7 self)
- Add to MetaCart
We propose categorical models for fl, 2 , MetaML, and AIM. First, we focus on the underlying logical modalities and the interactions between them, then we investigate the interactions between logical modalities and computational monads. We give two examples of categorical model: one simpler but with some limitations, the other more complex but able to model all features of AIM.
Evolving Domain Specific Languages Project Summary
"... We believe that the use of Domain Specific Languages (DSLs) can significantly improve the ability ofdomain experts to use computers effectively in their work. However the cost of developing and deploying DSLs is significant, and this has severely limited their deployment. Intellectual Merit: Like ot ..."
Abstract
- Add to MetaCart
We believe that the use of Domain Specific Languages (DSLs) can significantly improve the ability ofdomain experts to use computers effectively in their work. However the cost of developing and deploying DSLs is significant, and this has severely limited their deployment. Intellectual Merit: Like other software, DSLs have a well-defined life-cycle. SQL is a "mature " DSL: itsdesign is specified by international standards, and its stand-alone implementations are carefully crafted by hand to be stable, robust and to operate with high performance in specific execution environments. TheDSLs that we have designed are experimental: their designs vary week-by-week as researchers try out new ideas, their implementations must be malleable, and efficiency and the quality of the error messages are lessimportant. The simplest way to implement an experimental DSL is by embedding it as a library of functions within an existing programming language. These two approaches have both advantages and disadvantages,and the point in the life cycle of a particular DSL seems to favor one approach over another.
Meta-Programming With Intensional Analysis
"... syntax as an MetaMLdatatype declare x = 10 in -- x := x - 1; print x Sample program in concrete Syntax val S1 = Declare("x",Constant 10, Seq(Assign("x",Minus(Variable "x", Constant 1)), Print(Variable "y"))); Datatype encoding of sample program. !Do %mswo -- %push 10 ; a !- %read 1 ; b ..."
Abstract
- Add to MetaCart
syntax as an MetaMLdatatype declare x = 10 in -- x := x - 1; print x Sample program in concrete Syntax val S1 = Declare("x",Constant 10, Seq(Assign("x",Minus(Variable "x", Constant 1)), Print(Variable "y"))); Datatype encoding of sample program. !Do %mswo -- %push 10 ; a !- %read 1 ; b !- Return %mswo a %- 1 ; c !- %write 1 b ; d !- %read 1 ; e !- %output d ; Return %mswo () ; %pop ? Residual result of staging example program. (* interpret2 : Com -? index -? !unit M? *) fun interpret2 stmt index = case stmt of Assign(name,e) =? let val loc = position name index in !Do mswo -- n !- ~(eval2 e index) ; write ~(lift loc) n ? end --- Seq(s1,s2) =? !Do mswo -- x !- ~(interpret2 s1 index) ; y !- ~(interpret2 s2 index) ; Return mswo () ? --- Cond(e,s1,s2) =? !Do mswo -- x !- ~(eval2 e index) ; if x=1 then ~(interpret2 s1 index) else ~(interpret2 s2 index)? --- While(e,b) =? !let fun loop () = Do mswo -- v !- ~(eval2 e index) ; if v=0 then Return mswo...

