Meta-programming languages provide infrastructure to generate and execute object programs at run-time. In a typed setting, they contain a modal type constructor which classifies object code. These code types generally come in two flavors:... more
Meta-programming languages provide infrastructure to generate and execute object programs at run-time. In a typed setting, they contain a modal type constructor which classifies object code. These code types generally come in two flavors: closed and open. Closed code expressions can be invoked at run-time, but the computations over them are more rigid, and typically produce less efficient residual object programs. Open code provides better inlining and partial evaluation of object programs, but once constructed, expressions of this type cannot in general be evaluated.Recent work in this area has focused on combining the two notions into a sound system. We present a novel way to achieve this. It is based on adding the notion of names from the work on Nominal Logic and FreshML to the λ -calculus of proof terms for the necessity fragment of modal logic S4. The resulting language provides a more fine-grained control over free variables of object programs when compared to the existing la...
Abstract: Ciao Prolog incorporates a module system which allows separate compilationand sensible creation of standalone executables. We describe some of the main aspectsof the Ciao modular compiler, ciaoc, which takes advantage of the... more
Abstract: Ciao Prolog incorporates a module system which allows separate compilationand sensible creation of standalone executables. We describe some of the main aspectsof the Ciao modular compiler, ciaoc, which takes advantage of the characteristics ofthe Ciao Prolog module system to automatically perform separate and incremental compilationand eciently build small, standalone executables with competitive run-timeperformance. ciaoc can also detect statically a
This paper presents a semantics-based compilation frame- work for an aspect-oriented programming language based on its operational semantics model. Using partial evalua- tion, the framework can explain several issues in compilation... more
This paper presents a semantics-based compilation frame- work for an aspect-oriented programming language based on its operational semantics model. Using partial evalua- tion, the framework can explain several issues in compilation processes, including how to find places in program text to insert aspect code and how to remove unnecessary run-time checks. It also illustrates optimization of calling-context sen- sitive pointcuts
Meta-programming is a discipline of writing programs in a certain programming language that generate, manipulate or execute programs written in another language. In a typed setting, meta-programming languages usually contain a modal type... more
Meta-programming is a discipline of writing programs in a certain programming language that generate, manipulate or execute programs written in another language. In a typed setting, meta-programming languages usually contain a modal type constructor to dis- tinguish the level of object programs (which are the manipulated data) from the meta programs (which perform the computations). In functional programming, modal types
This paper presents an experimental implementation of a self-applicable partial evaluator in Prolog used for compiler generation and compiler generator generation. The partial evaluator is an extension of a simple meta interpreter for... more
This paper presents an experimental implementation of a self-applicable partial evaluator in Prolog used for compiler generation and compiler generator generation. The partial evaluator is an extension of a simple meta interpreter for Prolog programs, and its self-application is straightforward because of its simplicity. A method of incremental compilation is also described as a promising application of the partial evaluator
This Ph.D. progress report documents a combination of partial evaluation and compilation that enables "just-in-time program specialization". To this end, we have composed a type-directed partial evaluator for OCaml programs with... more
This Ph.D. progress report documents a combination of partial evaluation and compilation that enables "just-in-time program specialization". To this end, we have composed a type-directed partial evaluator for OCaml programs with a run-time code generator for the OCaml virtual machine. The composition is deforested, i.e., residual programs are directly expressed as byte code, which is then dynamically loaded. The implementation seamlessly extends OCaml with two new keywords for generating code dynamically. The system has been applied to traditional examples of partial evaluation and run-time code generation, such as the first Futamura projection for Action Semantics and the BSD Packet Filter. iii iv Contents 1 Introduction 1 1.1 Partial evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.1 What . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.2 How . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
This paper gives a theoretical foundation for partial evaluation in logic programming. Let P be a normal program, G a normal goal, A a finite set of atoms, and P ′ a partial evaluation of P wrt A. We study, for both the declarative and... more
This paper gives a theoretical foundation for partial evaluation in logic programming. Let P be a normal program, G a normal goal, A a finite set of atoms, and P ′ a partial evaluation of P wrt A. We study, for both the declarative and procedural semantics, conditions under ...