Results 1 - 10
of
15
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 ...
Multi-Stage Programming: Axiomatization and Type Safety (Extended Abstract)
- In 25th International Colloquium on Automata, Languages, and Programming
, 1998
"... Multi-staged programming provides a new paradigm for constructing efficient solutions to complex problems. Techniques such as program generation, multi-level partial evaluation, and run-time code generation respond to the need for general purpose solutions which do not pay run-time interpretive over ..."
Abstract
-
Cited by 33 (15 self)
- Add to MetaCart
Multi-staged programming provides a new paradigm for constructing efficient solutions to complex problems. Techniques such as program generation, multi-level partial evaluation, and run-time code generation respond to the need for general purpose solutions which do not pay run-time interpretive overheads. This paper provides a foundation for the formal analysis of one such system. We introduce a multi-stage language and present its axiomatic, reduction, and natural semantics. Our axiomatic semantics is an extension of the call-by-value -calculus with staging constructs. We demonstrate the soundness of the axiomatic semantics with respect to the natural semantics. We show that staged-languages can "go Wrong" in new ways, and devise a type system that screens out such programs. Finally, we present a proof of the soundness of this type system with respect to the reduction semantics, and show how to extend this result to the natural semantics. 1 Introduction Recently, there has been signi...
Certifying Compilation and Run-time Code Generation
- IN ACM WORKSHOP ON PARTIAL EVALUATION AND SEMANTICS-BASED PROGRAM MANIPULATION
, 1999
"... A certifying compiler takes a source language program and produces object code, as well as a "certificate" that can be used to verify that the object code satisfies desirable properties, such as type safety and memory safety. Certifying compilation helps to increase both compiler robustness and prog ..."
Abstract
-
Cited by 31 (0 self)
- Add to MetaCart
A certifying compiler takes a source language program and produces object code, as well as a "certificate" that can be used to verify that the object code satisfies desirable properties, such as type safety and memory safety. Certifying compilation helps to increase both compiler robustness and program safety. Compiler robustness is improved since some compiler errors can be caught by checking the object code against the certificate immediately after compilation. Program safety is improved because the object code and certificate alone are sufficient to establish safety: even if the object code and certificate are produced on an unknown machine by an unknown compiler and sent over an untrusted network, safe execution is guaranteed as long as the code and certificate pass the verifier. Existing work in certifying compilation has addressed statically generated code. In this paper, we extend this to code generated at run time. Our goal is to combine certifying compilation with run-time code generation to produce programs that are both verifiably safe and extremely fast. To achieve this goal, we present two new languages with explicit run-time code generation constructs: Cyclone, a type safe dialect of C, and TAL/T, a type safe assembly language. We have designed and implemented a system that translates a safe C program into Cyclone, which is then compiled to TAL/T, and finally assembled into executable object code. This paper focuses on our overall approach and the front end of our system; details about TAL/T will appear in a subsequent paper.
Macros as multi-stage computations: Type-safe, generative, binding macros in MacroML
- in MacroML. In the International Conference on Functional Programming (ICFP ’01
, 2001
"... ..."
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 .
An Automatic Program Generator for Multi-Level Specialization
- LISP AND SYMBOLIC COMPUTATION
, 1997
"... Program specialization can divide a computation into several computation stages. This paper investigates the theoretical limitations and practical problems of standard specialization tools, presents multi-level specialization, and demonstrates that, in combination with the cogen approach, it is far ..."
Abstract
-
Cited by 27 (4 self)
- Add to MetaCart
Program specialization can divide a computation into several computation stages. This paper investigates the theoretical limitations and practical problems of standard specialization tools, presents multi-level specialization, and demonstrates that, in combination with the cogen approach, it is far more practical than previously supposed. The program generator which we designed and implemented for a higher-order functional language converts programs into very compact multi-level generating extensions that guarantee fast successive specialization. Experimental results show a remarkable reduction of generation time and generator size compared to previous attempts of multi-level specialization by self-application. Our approach to multi-level specialization seems well-suited for applications where generation time and program size are critical.
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.
Run-time code generation in c++ as a foundation for domain-specific optimisation
- In Proceedings of the 2003 Dagstuhl Workshop on Domain-Specific Program Generation
, 2003
"... www.doc.ic.ac.uk/{~ob3,~phjk} Abstract. The TaskGraph Library is a C++ library for dynamic code generation, which combines specialisation with dependence analysis and loop restructuring. A TaskGraph represents a fragment of code which is constructed and manipulated at runtime, then compiled, dynamic ..."
Abstract
-
Cited by 16 (4 self)
- Add to MetaCart
www.doc.ic.ac.uk/{~ob3,~phjk} Abstract. The TaskGraph Library is a C++ library for dynamic code generation, which combines specialisation with dependence analysis and loop restructuring. A TaskGraph represents a fragment of code which is constructed and manipulated at runtime, then compiled, dynamically linked and executed. TaskGraphs are initialised using macros and overloading, which forms a simplified, C-like sub-language with first-class arrays and no pointers. Once a TaskGraph has been constructed, we can analyse its dependence structure and perform optimisations. In this Chapter, we present the design of the TaskGraph library, and two sample applications to demonstrate its use for runtime code specialisation and restructuring optimisation. 1
Binding-Time Analysis in Partial Evaluation: One Size Does Not Fit All
, 2000
"... Existing partial evaluators usually fix the strategy for binding-time analysis. But a single strategy cannot fulfill all goals without leading to compromises regarding precision, termination, and code explosion in partial evaluators. Our goal is to improve the usability of partial evaluator systems ..."
Abstract
-
Cited by 4 (1 self)
- Add to MetaCart
Existing partial evaluators usually fix the strategy for binding-time analysis. But a single strategy cannot fulfill all goals without leading to compromises regarding precision, termination, and code explosion in partial evaluators. Our goal is to improve the usability of partial evaluator systems by developing an adaptive approach that can accommodate a variety of different strategies ranging from maximally polyvariant to entirely uniform analysis, and thereby make offline specialization more practical in a realistic setting. The core of the analysis has been implemented in FSpec, an offline partial evaluator for a subset of Fortran 77.

