Results 1 - 10
of
58
Lambda Lifting: Transforming Programs to Recursive Equations
, 1985
"... Lambda lifting is a technique for transforming a functional program with local function definitions, possibly with free variables in the function definitions, into a program consisting only of global function (combinator) definitions which will be used as rewrite rules. Different ways of doing lambd ..."
Abstract
-
Cited by 159 (4 self)
- Add to MetaCart
Lambda lifting is a technique for transforming a functional program with local function definitions, possibly with free variables in the function definitions, into a program consisting only of global function (combinator) definitions which will be used as rewrite rules. Different ways of doing lambda lifting are presented, as well as reasons for rejecting or selecting the method used in our Lazy ML compiler. An attribute grammar and a functional program implementing the chosen algorithm is given. Originally publised in Proceedings 1985 Conference on Functional Programming Languages and Computer Architecture, Lecture Notes in Computer Science 201, Nancy, France, 1985. Springer Verlag. y As part B of author's thesis. Main addition: the attribute grammar formulation. 1 Introduction When compiling a lazy functional language using the technique described in [Joh84] it is presumed that the input program is in the form of a set of function definitions, possibly mutually recursive, tog...
Higher-Order Functions for parsing
, 1993
"... In combinator parsing, the text of parsers resembles BNF notation. We present the basic method, and a number of extensions. We address the special problems presented by white-- space, and parsers with separate lexical and syntactic phases. In particular, a combining form for handling the "offside ru ..."
Abstract
-
Cited by 94 (3 self)
- Add to MetaCart
In combinator parsing, the text of parsers resembles BNF notation. We present the basic method, and a number of extensions. We address the special problems presented by white-- space, and parsers with separate lexical and syntactic phases. In particular, a combining form for handling the "offside rule" is given. Other extensions to the basic method include an "into" combining form with many useful applications, and a simple means by which combinator parsers can produce more informative error messages. 1 Introduction Broadly speaking, a parser may be defined as a program which analyses text to determine its logical structure. For example, the parsing phase in a compiler takes a program text, and produces a parse tree which expounds the structure of the program. Many programs can be improved by having their input parsed. The form of input which is acceptable is usually defined by a context--free grammar, using BNF notation. Parsers themselves may be built by hand, but are most often ge...
Compiling Embedded Languages
- Proc. Semantics, Applications, and Implementation of Program Generation (SAIG 2000), LNCS
, 2000
"... . Functional languages are particularly well-suited to the implementation of interpreters for domain-specific embedded languages (DSELs). We describe an implemented technique for producing optimizing compilers for DSELs, based on Kamin's idea of DSELs for program generation. The technique uses ..."
Abstract
-
Cited by 31 (1 self)
- Add to MetaCart
. Functional languages are particularly well-suited to the implementation of interpreters for domain-specific embedded languages (DSELs). We describe an implemented technique for producing optimizing compilers for DSELs, based on Kamin's idea of DSELs for program generation. The technique uses a data type of syntax for basic types, a set of smart constructors that perform rewriting over those types, some code motion transformations, and a back-end code generator. Domain-specific optimization results from chains of rewrites on basic types. New DSELs are defined directly in terms of the basic syntactic types, plus host language functions and tuples. This definition style makes compilers easy to write and, in fact, almost identical to the simplest embedded interpreters. We illustrate this technique with a language Pan for the computationally intensive domain of image synthesis and manipulation. 1 1 Introduction The "embedded" approach has proved an excellent technique for ...
Designing and Implementing Combinator Languages
- Third Summer School on Advanced Functional Programming, volume 1608 of LNCS
, 1999
"... this paper we will assume the availablity of a set of parsing combinators, that enables us to coinstruct such a mapping almost without e#ort. ..."
Abstract
-
Cited by 31 (7 self)
- Add to MetaCart
this paper we will assume the availablity of a set of parsing combinators, that enables us to coinstruct such a mapping almost without e#ort.
Forwarding in attribute grammars for modular language design
- In Proc. 11th Intl. Conf. on Compiler Construction, volume 2304 of LNCS
, 2002
"... Abstract. Forwarding is a technique for providing default attribute definitions in attribute grammars that is helpful in the modular implementation of programming languages. It complements existing techniques such as default copy rules. This paper introduces forwarding, and shows how it is but a sma ..."
Abstract
-
Cited by 30 (11 self)
- Add to MetaCart
Abstract. Forwarding is a technique for providing default attribute definitions in attribute grammars that is helpful in the modular implementation of programming languages. It complements existing techniques such as default copy rules. This paper introduces forwarding, and shows how it is but a small extension of standard higher-order attribute grammars. The usual tools for manipulating higher-order attribute grammars, including the circularity check (which tests for cyclic dependencies between attribute values), carry over without modification. The closure test (which checks that each attribute has a defining equation) needs modification, however, because the resulting higher-order attribute grammars may contain spurious attributes that are never evaluated, and indeed that need not be defined. 1
Benefits of Tree Transducers for Optimizing Functional Programs
- In FST & TCS'98, Chennai, India, Proceedings, volume 1530 of LNCS
, 1998
"... We present a technique to prevent the construction of intermediate data structures in functional programs, which is based on results from the theory of tree transducers. We first decompose function definitions, which correspond to macro tree transducers, into smaller pieces. Under certain restrictio ..."
Abstract
-
Cited by 29 (6 self)
- Add to MetaCart
We present a technique to prevent the construction of intermediate data structures in functional programs, which is based on results from the theory of tree transducers. We first decompose function definitions, which correspond to macro tree transducers, into smaller pieces. Under certain restrictions...
Aspect-Oriented Compilers
, 1999
"... . Aspect-oriented programming provides the programmer with means to cross-cut conventional program structures, in particular the class hierarchies of object-oriented programming. This paper studies the use of aspect orientation in structuring syntax directed compilers implemented as attribute gr ..."
Abstract
-
Cited by 17 (2 self)
- Add to MetaCart
. Aspect-oriented programming provides the programmer with means to cross-cut conventional program structures, in particular the class hierarchies of object-oriented programming. This paper studies the use of aspect orientation in structuring syntax directed compilers implemented as attribute grammars. Specifically, it describes a method for specifying definitions of related attributes as `aspects' and treating them as first-class objects, that can be stored, manipulated and combined. It is hoped that this embedding of an aspect-oriented programming style in Haskell provides a stepping stone towards a more general study of the semantics of aspect-oriented programming. 1 Introduction Compilers are often structured by recursion over the abstract syntax of the source language. For each production in the abstract syntax, one defines a function that specifies how a construct is to be translated. The method of structuring compilers in this syntax--directed manner underlies the for...
Compilation of Functional Languages Using Flow Graph Analysis
, 1994
"... syntax, and syntactic and semantic domains of a flow graph Figure 9. Semantic equations Def and Exp of a flow graph The first argument to the functions Def and Exp specifies a set of nodes that represent a flow graph, from which the element(s) of current interest are selected by pattern matching. ..."
Abstract
-
Cited by 16 (12 self)
- Add to MetaCart
syntax, and syntactic and semantic domains of a flow graph Figure 9. Semantic equations Def and Exp of a flow graph The first argument to the functions Def and Exp specifies a set of nodes that represent a flow graph, from which the element(s) of current interest are selected by pattern matching.
Declarative Program Transformation: a Deforestation case-study
, 1999
"... Software engineering has to reconcile modularity with e- ciency. One way to grapple with this dilemma is to automatically transform a modular-specied program into an ecient-implementable one. ..."
Abstract
-
Cited by 15 (2 self)
- Add to MetaCart
Software engineering has to reconcile modularity with e- ciency. One way to grapple with this dilemma is to automatically transform a modular-specied program into an ecient-implementable one.
Decompilation: The Enumeration of Types and Grammars
- ACM Transactions on Programming Languages and Systems (TOPLAS
, 1992
"... While a compiler produces object code from source code, a decompiler produces source code from object code, and has applications in the testing and validation of safety-critical software. Decompiling an object code provides an independent demonstration of correctness that is hard to better for indus ..."
Abstract
-
Cited by 14 (3 self)
- Add to MetaCart
While a compiler produces object code from source code, a decompiler produces source code from object code, and has applications in the testing and validation of safety-critical software. Decompiling an object code provides an independent demonstration of correctness that is hard to better for industrial purposes (the alternative is to prove the compiler correct). But although compiler compilers are in common use in the software industry, a decompiler compiler is much more unusual. It turns out that a data type specification representing a programming language grammar can be remolded into a functional program that enumerates all the abstract syntax trees. This observation is the springboard for a general method for compiling decompilers from the specifications of (non-optimizing) compilers. This paper deals with methods and theory, together with an application of the technique. The correctness of a decompiler generated from the specification for a simple occam-like compiler is demonstrated.

