A Language Prototyping Tool based on Semantic Building Blocks



Similar documents
LPS: A Language Prototyping System Using Modular Monadic Semantics

A tutorial on the universality and expressiveness of fold

Object-Oriented Software Specification in Programming Language Design and Implementation

Categorical Monads and Computer Programming

The countdown problem

Annotated bibliography for the tutorial on Exploring typed language design in Haskell

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic

Functional Programming. Functional Programming Languages. Chapter 14. Introduction

Computer Science at Kent

Type Classes with Functional Dependencies

POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful

Integrating Formal Models into the Programming Languages Course

Adding GADTs to OCaml the direct approach

The Clean programming language. Group 25, Jingui Li, Daren Tuzi

Programming Languages

The Designer's Guide to VHDL

Linearly Used Effects: Monadic and CPS Transformations into the Linear Lambda Calculus

The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant

Moving from CS 61A Scheme to CS 61B Java

Chapter 15 Functional Programming Languages

The C Programming Language course syllabus associate level

Run-time Variability Issues in Software Product Lines

Asymptotic Improvement of Computations over Free Monads

Functional Programming

[Refer Slide Time: 05:10]

Domain specific language on automata: Design and Implementation problems. Loïc Fosse

Coeffects: Unified static analysis of context-dependence

Implementing Generate-Test-and-Aggregate Algorithms on Hadoop

Anatomy of Programming Languages. William R. Cook

Curriculum Vitae. Shan Shan Huang

Applicative programming with effects

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

The Open University s repository of research publications and other research outputs

Monads for functional programming

EMBEDDED SOFTWARE DEVELOPMENT: COMPONENTS AND CONTRACTS

Semantic Analysis: Types and Type Checking

Computing Concepts with Java Essentials

The Art of Interpretation for Domain-Specific Embedded Languages

Jieh Hsiang Department of Computer Science State University of New York Stony brook, NY 11794

Programming Language Concepts for Software Developers

KEEP THIS COPY FOR REPRODUCTION PURPOSES. I ~~~~~Final Report

NEW YORK CITY COLLEGE OF TECHNOLOGY/CUNY Computer Systems Technology Department

Infinite Pretty-printing in exene

Publications of Rod Burstall, Infornmatics, University of Edinbugh, UK

Regular Expressions and Automata using Haskell

Java (12 Weeks) Introduction to Java Programming Language

Lecture 1: Introduction

Curriculum Map. Discipline: Computer Science Course: C++

Extraction of certified programs with effects from proofs with monadic types in Coq

Translating Generalized Algebraic Data Types to System F

Checking Access to Protected Members in the Java Virtual Machine

Coinductive Big-Step Semantics for Concurrency

Compiling CAO: from Cryptographic Specifications to C Implementations

ML for the Working Programmer

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Relational Databases

Chapter 7: Functional Programming Languages

First Class Overloading via Insersection Type Parameters

PROPERTECHNIQUEOFSOFTWARE INSPECTIONUSING GUARDED COMMANDLANGUAGE

Origin Tracking in Attribute Grammars

Ralf Hinze Generic Programs and Proofs

CSE 307: Principles of Programming Languages

A Multi-layered Domain-specific Language for Stencil Computations

Rigorous Software Development CSCI-GA

Exploring the Regular Tree Types

Division of Mathematical Sciences

TEHNICAL UNIVERSITY OF CLUJ-NAPOCA FACULTY OF ELECTRICAL ENGINEERING

CS422 - Programming Language Design

AN INTELLIGENT TUTORING SYSTEM FOR LEARNING DESIGN PATTERNS

A Tool for Generating Partition Schedules of Multiprocessor Systems

Practical Generic Programming with OCaml

Tail Recursion Without Space Leaks

Programming Language Pragmatics

Advanced Functional Programming (9) Domain Specific Embedded Languages

Code Generation for High-Assurance Java Card Applets

William Paterson University of New Jersey Department of Computer Science College of Science and Health Course Outline

Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder

Handlers in Action. Ohad

A STUDY OF SEMANTICS, TYPES AND LANGUAGES FOR DATABASES AND OBJECT-ORIENTED PROGRAMMING ATSUSHI OHORI. Computer and Information Science

Computational Mathematics with Python

Timber: A Programming Language for Real-Time Embedded Systems

Non-Archimedean Probability and Conditional Probability; ManyVal2013 Prague F.Montagna, University of Siena

Rigorous Software Engineering Hoare Logic and Design by Contracts

A Complexity Measure Based on Cognitive Weights


Language. Johann Eder. Universitat Klagenfurt. Institut fur Informatik. Universiatsstr. 65. A-9020 Klagenfurt / AUSTRIA

A View Integration Approach to Dynamic Composition of Web Services

Using Patterns and Composite Propositions to Automate the Generation of Complex LTL

Programming Languages

1.1 WHAT IS A PROGRAMMING LANGUAGE?

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Sources: On the Web: Slides will be available on:

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

Cedalion A Language Oriented Programming Language (Extended Abstract)

Doctor of Philosophy in Computer Science

Constructing Contracts: Making Discrete Mathematics Relevant to Beginning Programmers

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Transcription:

A Language Prototyping Tool based on Semantic Building Blocks J. E. Labra Gayo, J. M. Cueva Lovelle, M. C. Luengo Díez, and B. M. González Rodríguez Department of Computer Science, University of Oviedo C/ Calvo Sotelo S/N, 3307, Oviedo, Spain {labra,cueva,candi,martin}@lsi.uniovi.es Abstract. We present a Language Prototyping System that facilitates the modular development of interpreters from semantic specifications. The theoretical basis of our system is the integration of ideas from generic programming and modular monadic semantics. The system is implemented as a domain-specific language embedded in Haskell and contains an interactive framework for language prototyping. In the monadic approach, the semantic spscification of a programming language is captured as a function Σ M V where Σ represents the abstract syntax, M the computational monad, and V the domain value. In order to obtain more extensibility, we use folds or catamorphisms over the fixpoint of non-recursive pattern functors that capture the structure of the abstract syntax. For each pattern functor F, the semantic specifications are defined as independent F-Algebras whose carrier is M V, where M is the computational monad and V models the domain value. The copmputational monad M can itself be obtained from the composition of several monad transformers applied to a base monad, and the domain value V can be defined using extensible union types. In this paper, we also show that when the abstract syntax contains several categories, it is possible to define many-sorted algebras obtaining the same modularity. 1 Introduction E. Moggi [39] applied monads to denotational semantics in order to capture the notion of computation and the intuitive idea of separating computations from values. After his work, there was some interest in the development of modular interpreters using monads [49,43,10]. The problem was that, in general, it is not possible to compose two monads to obtain a new monad [25]. A proposed solution was the use of monad transformers [33,32] which transform a given monad into a new one adding new operations. This approach was called modular monadic semantics. In a different context, the definition of recursive datatypes as least fixpoints of pattern functors and the calculating properties that can be obtained be means

of folds or catamorphisms led to a complete discipline which could be named as generic programming [3,34,35]. In [9], L. Duponcheel proposed the combined use of folds or catamorphisms with modular monadic semantics allowing the independent specification of the abstract syntax, the computational monad and the domain value. Following [36], we applied monadic folds to modular monadic semantics allowing the separation between recursive evaluation and semantic specification [28,29,30]. In practice, the abstract syntax is usually formed from n mutually recursive categories, In this paper we show how we can extend our previous work to handle many-sorted algebras. The paper is organized as follows. In section 2 we give an informal presentation of modular monadic semantics defining some monad transformers. Section 3 presents the basic concepts from generic programming extending previous work to handle many-sorted algebras. In section 4 we specify the semantics of a simple imperative programming language from reusable components. Along the paper, we use Haskell syntax with some freedom in the use of mathematical operators and datatype declarations. As an example, the predefined datatype data Either a b = Left a Right b could be defined with our notation as α β L α R β We also omit the type constructors in some definitions for brevity. The notions we use from category theory are defined in the paper, so it is not a prerequisite. 2 Modular Monadic Semantics A monad M captures the intuitive notion of computation. In this way, the type M α represents a computation the returns a value of type α In functional programming, a monad can be defined as a type constructor M with 2 operations return : α M α ( =) : M α (α M β) M β which satisfy a number of laws (see [47,49,48]). Example 1. The simplest monad is the identity monad Id α α return = λx x m = f = f x

In the rest of the paper, we will use the do-notation defined as: do { m; e } m = λ do { e } do { x m; e } m = λ x do { e } do { let exp; e } let exp in do { e } do { e } e It is possible to define monads that capture different kinds of computations, like partiality, nondeterminism, side-effects, exceptions, continuations, interactions, etc. [39,40,5]. Table 1 presents two classes of monads that will be used in the rest of the paper. Table 1. Some classes of monads Name Operations Environment Access rdenv : M Env inenv : Env M α M α State transformer update : (State State) M State fetch : M State set : State M State When describing the semantics of a programming language using monads, the main problem is the combination of different classes of monads. It is not possible to compose two monads to obtain a new monad in general [25]. Nevertheless, a monad transformer T can transform a given monad M into a new monad T M that has new operations and maintains the operations of M. The idea of monad transformer is based on the notion of monad morphism that appeared in Moggi s work [39] and was later proposed in [33]. The definition of a monad transformer is not straightforward because there can be some interactions between the intervening operations of the different monads. These interactions are considered in more detail in [31,32,33] and in [17] it is shown how to derive a backtracking monad transformer from its specification. Our system contains a library of predefined monad transformers corresponding to each class of monad and the user can also define new monad transformers. When defining a monad transformer T over a monad M, it is necessary to specify the new return and ( =), the lift : M α T M α operation that transforms any operation in M into an operation in the new monad T M, and the new operations provided by the new monad. Table 2 presents the definitions of the two monad transformers that will be used in the paper. 2.1 Extensible domains [33] defines extensible union types using multi-parameter type classes. Although we are not going to give the full details, we can assume that if α is a subtype

Table 2. Some monad transformers with their definitions Environment reader T Env M α Env M α return x = λρ returnx x = f = λρ (xρ) =(λa f a ρ) lift x = λρ x =return rdenv = λρ returnρ inenv ρ x = λ x ρ State transformer T State M α State M (α, State) return x = λς return(x, ς) x = f = λς (xς) =(λ(v, ς ) f v ς ) lift x = λς x =(λx return(x, ς)) update f = λς return(ς, f ς) fetch = update (λς ς) set ς = update (λ ς) of β, which will be denoted as α β, then we have the functions : α β and : β α. We also assume that α (α β) and that β (α β). As an example, if we define a domain of integers and booleans as Int Bool, then ( 3) belongs to that domain and to further extensions of it. 3 Generic Programming concepts 3.1 Functors, Algebras and Catamorphisms As in the case of monads, functors also come from category theory but can easily be defined in a functional programming setting. A functor F can be defined as a type constructor that transforms values of type α into values of type F α and a function map F : (α β) F α F β. The fixpoint of a functor F can be defined as µf In (F (µf)) In the above definition, we explicitly write the type constructor In because we will refer to it later. A recursive datatype can be defined as the fixpoint of a non-recursive functor that captures its shape. Example 2. The following inductive datatype for arithmetic expressions Term Term N Int Term + Term Term Term

can be defined as the fixpoint of the functor A T x N Int x + x x x where the map T is 1 : map T : (α β) (T α Tβ) map T f (N n) = n map T f (x 1 + x 2 ) = f x 1 + f x 2 map T f (x 1 x 2 ) = f x 1 f x 2 Once we have the shape functor T, we can obtain the recursive datatype as the fixpoint of T Term µt In this way, the expression 2 + 3 can be represented as In ((In (N 2)) + (In (N 3))) : Term The sum of two functors F and G, denoted by F G can be defined as (F G) x F x G x where map F G is map F G : (α β) (F G) α (F G) β map F G f (L x) = L (map F f x) map F G f (R x) = R (map G f x) Using the sum of two functors, it is possible to extend recursive datatypes. Example 3. We can define a new pattern functor for boolean expressions B x = B Bool x == x x < x and the composed recursive datatype of arithmetic and boolean expressions can easily be defined as Expr µ(t B) Given a functor F, an F-algebra is a function ϕ F : F α α where α is called the carrier. An homomorphism between two F-algebras ϕ : F α α and ψ : F β β is a function h : α β which satisfies 1 h. ϕ = ψ. map F h In the rest of the paper we omit the definition of map functions as they can be automatically derived from the shape of the functor.

We consider a new category with F-algebras as objects and homomorphisms between F-algebras as morphisms. In this category, In : F(µF) µf is an initial object, i.e. for any F-algebra ϕ : F α α there is a unique homomorphism ([ϕ]) : µf α satisfying the above equation. ([ϕ]) is called fold or catamorphism and satisfies a number of calculational properties [3,6,35,42]. It can be defined as: ([ ]) : (Fα α) (µf α) ([ϕ]) (In x) = ϕ ( map F ([ϕ]) x) Example 4. We can obtain a simple evaluator for arithmetic expressions defining an T-algebra whose carrier is the type m v, where m is, in this case, any kind of monad, and Int is a subtype of v. ϕ T : (Monad m, Int v) T(m v) m v ϕ T (Num n) = return ( n) ϕ T (e 1 + e 2 ) = do v 1 e 1 v 2 e 2 return( ( v 1 + v 2 )) ϕ T (e 1 e 2 ) = do v 1 e 1 v 2 e 2 return( ( v 1 v 2 )) Applying a catamorphism over ϕ T terms: we obtain the evaluation function for eval Term : (Monad m, Int v) Term m v eval Term = ([ϕ T ]) The operator allows to obtain a (F G)-algebra from an F-algebra ϕ and a G-algebra ψ : (F α α) (G α α) (F G)α α (ϕ ψ)(l x) = ϕ x (ϕ ψ)(r x) = ψ x Example 5. The above definition allows to extend the evaluator of example 4 to arithmetic and boolean expressions. We can specify the semantics of boolean expressions with the following B- algebra ϕ B : (Monad m, Bool v) B(m v) m v ϕ B (B b) = return ( b)

ϕ B (e 1 == e 2 ) = do v 1 e 1 v 2 e 2 return( ( v 1 == v 2 )) ϕ B (e 1 < e 2 ) = do v 1 e 1 v 2 e 2 return( ( v 1 < v 2 )) Now, the new evaluator of boolean and arithmetic expressions is automatically obtained as a catamorphism over the (T B)-algebra. eval Expr : (Monad m, Int v, Bool v) Expr m v eval Expr = ([ϕ T ϕ B ]) The theory of catamorphisms can be extended to monadic catamorphisms as described in [12,19,28,30]. 3.2 Many-sorted algebras and catamorphisms The abstract syntax of a programming language is usually divided in several mutually recursive categories. It is possible to extend the previous definitions to handle many-sorted algebras. In this section, we present the theory for n = 2, but it can be defined for any number of sorts [11,37,21,41]. A bifunctor F is a type constructor that assigns a type F α β to a pair of types α and β and an operation bimap F : (α γ) (β δ) (F α β F γ δ) The fixpoint of two bifunctors F and G is a pair of values (µ 1 FG,µ 2 FG) that can be defined as: µ 1 FG In 1 (F (µ 1 FG) (µ 2 FG)) µ 2 FG In 2 (G (µ 1 FG) (µ 2 FG)) Given two bifunctors F and G, a two-sorted F, G-algebra is a pair of functions (ϕ, ψ) such that: ϕ : F α β α ψ : G α β β where α, β are called the carriers of the two-sorted algebra. It is possible to define F, G-homomorphisms and a new category where (In 1, In 2 ) form the initial object. This allows the definition of bicatamorphisms as: ([, ]) 1 : (F α β α) (G α β β) (µ 1 FG α) ([ϕ, ψ]) 1 (In 1 x) = ϕ (bimap F ([ϕ, ψ]) 1 ([ϕ, ψ]) 2 x)

([, ]) 2 : (F α β α) (G α β β) (µ 2 FG β) ([ϕ, ψ]) 2 (In 2 x) = ψ (bimap G ([ϕ, ψ]) 1 ([ϕ, ψ]) 2 x) The sum of two bifunctors F and G is a new bifunctor F G and can be defined as: (F G) α β F α β G α β where the bimap operator is bimap F G : (α γ) (β δ) ((F G) α β ((F G) γ δ) bimap F G f g (L x) = L (bimap F G f g x) bimap F G f g (R x) = R (bimap F G f g x) In order to extend two-sorted algebras, we define the operators 1 and 2 as: ( 1 ) : (F α β α) (G α β α) (F G) α β α (φ 1 1 φ 2 ) (L x) = φ 1 x (φ 2 1 φ 2 ) (R x) = φ 2 x ( 2 ) : (F α β β) (G α β β) (F G) α β β (ψ 1 2 ψ 2 ) (L x) = ψ 1 x (ψ 2 2 ψ 2 ) (R x) = ψ 2 x 3.3 From functors to bifunctors When specifying several programming languages, it is very important to be able to share common blocks and to reuse the corresponding specifications. For example, arithmetic expressions should be specified in one place and their specification should be reused between different languages. In order to reuse specifications made using single-sorted algebras in a twosorted framework, it is necessary to extend functors to bifunctors. Given a functor F, we define the bifunctors F 2 1 and F 2 2 as: F 2 1 α β F α F 2 2 α β F β where the bimap operations are defined as bimap F 2 1 f g x = f x bimap F 2 2 f g x = g x Given an F-algebra, the operators ɛ 2 1 and ɛ 2 2 obtain the corresponding twosorted algebras ɛ 2 1 : (F α α) F 2 1 α β α ɛ 2 1 ϕ x = ϕ x ɛ 2 2 : (F β β) F 2 2 α β β ɛ 2 2 ϕ x = ϕ x

4 Specification of a simple imperative language 4.1 Abstract syntax A typical imperative programming language can be divided in two different worlds: expressions and commands. In our example, the expressions will be arithmetic, boolean and variables. The abstract syntax of arithmetic and boolean expressions are captured by the functors T and B defined in examples 2 and 3. Variables are defined using the functor V V x V Name We will define commands in two steps. Firstly, sequence and assignments are defined using the bifunctor S S e c c ; c String := e Secondly, control structures (conditional and loops) are defined using the bifunctor R R e c If e c c While e c In order to define the imperative languge, we need a bifunctor that represents the shape of expressions and another one representing commands. The bifunctor of expressions can be defined as an extension of the functor obtained as the sum of T, B and V E (T B V) 2 1 The bifunctor of commands is defined as the sum of the bifunctors S and R C S R Finally, the imperative language is the fixpoint of E and C Imp µ 2 E R 4.2 Computational structure In this simple language, the computational structure needs to access the environment and to transform a global state. We will use the monad Comp which is obtained by transforming the identity monad using the monad transformers T State and T Env defined in table 2. Comp (T State. T Env ) Id The domain value of expressions consist of integer and boolean values

Value Int Bool and the domain value of commands is the null type () 2 indicating that commands do not return any value. The state and environment are defined as: Env Name Loc State Loc Value where Loc represent memory locations. We will also use the notation ς {x/v} to represent the updated state ς which assigns v to x. 4.3 Semantic functions The semantic specification of arithmetic and boolean expressions were defined in the examples 4 and 5. We will reuse those specifications in the imperative language. With regard to variables, the V-algebra is ϕ V : V(Comp Value) Comp Value ϕ V (Var x) = do ρ rdenv ς fetch return(ς (ρ x)) The specification of sequence and assignment is ψ S : S (Comp Value) (Comp ()) Comp () ψ S (c 1 ; c 2 ) = do c 1 c 2 ψ S (x := e) = do v e ρ rdenv ς fetch set (ς {ρ x/v}) return () In the same way, the specification of conditional and repetitive commands is: ψ R : R (Comp Value) (Comp ()) Comp () ψ R (If e c 1 c 2 ) = do v e if v then c 1 else c 2 2 () is a predefined Haskell datatype that only contains the value ()

ψ R (While e c) = loop where loop = do v e if v then do { c ; loop } else return() Finally, the interpreter is automatically obtained as a bicatamorphism Inter Imp : Imp Comp () Inter Imp = ([ɛ 2 1(ϕ T ϕ B ϕ V ), ϕ S 2 ϕ R ]) 2 Although in the above definition we have explicitily written the particular algebras, it is not necessary to do so in the implementation because the overloading mechanism of Haskell allows to detect which is the corresponding algebra. 5 Conclusions and future work We have presented an integration of modular monadic semantics and generic programming concepts that allows the definition of programming languages from reusable semantic especifications. This approach has been implemented in a Language Prototyping System which allows to share semantic building blocks and provides an interactive framework for language testing. The system can be considered as another example of a domain-specific language embedded in Haskell [46,26,20]. This approach has some advantages: The development is easier as we can rely on the fairly good type system of Haskell, it is possible to obtain direct access to Haskell libraries and tools, and we do not need to define a new language with its syntax, semantics, type system, etc. At the same time, the main disadvantages are the mixture of error messages from the domain-specific language and the host language, Haskell type system limitations and the Haskell dependency which impedes the development of interpreters implemented in different languages. It would be interesting to define an independent domain specific meta-language for semantic specifications following [5,7,38]. On the theoretical side, [17] shows how to derive a backtracking monad transformer from its specification. That approach should be applied to other types of monad transformers and it would be interesting to define a general framework for the combination many-sorted algebras and monadic catamorphisms. It would also be fruitful to study the combination of algebras, coalgebras, monads and comonads in order to provide the semantics of interactive and object-oriented features [4,23,22,27,45]. Another line of research is the automatic derivation of compilers from the interpreters built. This line has already been started in [14,15].

With regard to the implementation, we have also made a simple version of the system using first-class polymorphism [24] and extensible records [13]. This allows the definition of monads as first class values and monad transformers as functions between monads without the need of type classes. However, this feature is still not fully implemented in current Haskell systems. Recent advances in generic programming would also improve the implementation [18,16]. At this moment, we have specified simple imperative, functional, objectoriented and logic programming languages. The specifications have been made in a modular way reusing common components of the different languages. The original goal of our research was to develop prototypes for the abstract machines underlying the integral object-oriented operating System Oviedo3 [2] whith the aim to test new features as security, concurrency, reflectiveness and distribution [8,44]. More information on the Language Prototyping System can be obtained at [1]. References 1. Language Prototyping System. http://lsi.uniovi.es/~labra/lps/lps.html. 2. D. Álvarez, L. Tajes, F. Álvarez, M. A. Díaz, R. Izquierdo, and J. M. Cueva. An object-oriented abstract machine as the substrate for an object-oriented operating system. In J. Bosch and S. Mitchell, editors, Object Oriented Technology ECOOP 97, Jÿvaskÿla, Finland, June 1997. Springer Verlag, LNCS 1357. 3. Roland Backhouse, Patrik Jansson, Johan Jeuring, and Lambert Meertens. Generic programming - an introduction. In S. D. Swierstra, P. R. Henriques, and J. N. Oliveira, editors, Advanced Functional Programming, volume 1608 of Lecture Notes in Computer Science. Springer, 1999. 4. L. S. Barbosa. Components as processes: An exercise in coalgebraic modeling. In S. F. Smith and C. L. Talcott, editors, FMOODS 2000 - Formal Methods for Open Object-Oriented Distributed Systems, pages 397 417, Stanford, USA, September 2000. Kluwer Academic Publishers. 5. N. Benton, J. Hughes, and E. Moggi. Monads and effects. In International Summer School On Applied Semantics APPSEM 2000, Caminha, Portugal, 2000. 6. R. Bird and Oege de Moor. Algebra of Programming. Prentice Hall, 1997. 7. Pietro Ceciarelli and Engenio Moggi. A syntactic approach to modularity in denotational semantics. In 5th Biennial Meeting on Category Theory and Computer Science, volume CTCS-5. CWI Technical Report, 1993. 8. M. A. Díaz, D. Álvarez, A. García-Mendoza, F. Álvarez, L. Tajes, and J. M. Cueva. Merging capabilities with the object model of an object-oriented abstract machine. In S. Demeyer and J. Bosch, editors, Ecoop 98 Workshop on Distributed Object Security, volume 1543, pages 273 276. LNCS, 1998. 9. Luc Duponcheel. Writing modular interpreters using catamorphisms, subtypes and monad transformers. Utrecht University, 1995. 10. David Espinosa. Semantic Lego. PhD thesis, Columbia University, 1995. 11. Maarten M. Fokkinga. Law and Order in Algorithmics. PhD thesis, University of Twente, February 1992. 12. Maarten M. Fokkinga. Monadic maps and folds for arbitrary datatypes. Memoranda Informatica 94-28, Dept. of Computer Science, Univ. of Twente, June 1994.

13. Benedict R. Gaster and Mark P. Jones. A Polymorphic Type System for Extensible Records and Variants. Technical Report NOTTCS-TR-96-3, Department of Computer Science, University of Nottingham, November 1996. 14. William Harrison and Samuel Kamin. Modular compilers based on monad transformers. In Proceedings of the IEEE International Conference on Computer Languages, 1998. 15. William Harrison and Samuel Kamin. Compilation as metacomputation: Binding time separation in modular compilers. In 5th Mathematics of Program Construction Conference, MPC2000, Ponte de Lima, Portugal, June 2000. 16. R. Hinze. A generic programming extension for Haskell. In E. Meijer, editor, Proceedings of the 3rd Haskell Workshop, Paris, France, September 1999. The proceedings appear as a technical report of Universiteit Utrecht, UU-CS-1999-28. 17. Ralf Hinze. Deriving backtracking monad transformers. In Roland Backhouse and J.Ñ. Oliveira, editors, Proceedings of the 2000 International Conference on Functional Programming, Montreal, Canada, September 2000. 18. Ralf Hinze. A new approach to generic functional programming. In Conference Record of POPL 00: The 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, January 2000. 19. Z. Hu and H. Iwasaki. Promotional transformation of monadic programs. In Workshop on Functional and Logic Programming, Susono, Japan, 1995. World Scientific. 20. P. Hudak. Domain-specific languages. In Peter H. Salus, editor, Handbook of Programming Languages, volume III, Little Languages and Tools. Macmillan Technical Publishing, 1998. 21. H. Iwasaki, Z. Hu, and M. Takeichi. Towards manipulation of mutually recursive functions. In 3rd. Fuji International Symposium on Functional and Logic Programming (FLOPS 98), Kyoto, Japan, 1998. World Scientific. 22. B. Jacobs and E. Poll. A monad for basic java semantics. In T. Rus, editor, Algebraic Methodology and Software Technology, number 1816 in LNCS. Springer, 2000. 23. Bart Jacobs. Coalgebraic reasoning about classes in object-oriented languages. In Coalgebraic Methods in Computer Science, number 11. Electronic Notes in Computer Science, 1998. 24. Mark P. Jones. First-class Polymorphism with Type Inference. In Proceedings of the Twenty Fourth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Paris, France, January 15-17 1997. 25. Mark P. Jones and L. Duponcheel. Composing monads. YALEU/DCS/RR 1004, Yale University, New Haven, CT, USA, 1993. 26. S. Kamin. Research on domain-specific embedded languages and program generators. Electronic Notes in Theoretical Computer Science, Elsevier Press, 12, 1998. 27. Richard B. Kieburtz. Designing and implementing closed domain-specific languages. Invited talk at the Workshop on Semantics, Applications and Implementation of Program Generation (SAIG), 2000. 28. J. E. Labra. An implementation of modular monadic semantics using folds and monadic folds. In Workshop on Research Themes on Functional Programming, Third International Summer School on Advanced Functional Programming, Braga - Portugal, 1998. 29. J. E. Labra, J. M. Cueva, and C. Luengo. Language prototyping using modular monadic semantics. In 3rd Latin-American Conference on Functional Programming, Recife - Brazil, March 1999.

30. J. E. Labra, J. M. Cueva, and M. C. Luengo. Modular development of interpreters from semantic building blocks. In The 12th Nordic Workshop on Programming Theory, Bergen, Norway, October 2000. University of Bergen. 31. Sheng Liang. Modular Monadic Semantics and Compilation. PhD thesis, Graduate School of Yale University, May 1998. 32. Sheng Liang and Paul Hudak. Modular denotational semantics for compiler construction. In Programming Languages and Systems ESOP 96, Proc. 6th European Symposium on Programming, Linköping, volume 1058 of Lecture Notes in Computer Science, pages 219 234. Springer-Verlag, 1996. 33. Sheng Liang, Paul Hudak, and Mark P. Jones. Monad transformers and modular interpreters. In 22nd ACM Symposium on Principles of Programming Languages, San Francisco, CA. ACM, January 1995. 34. Grant Malcolm. Data structures and program transformation. Science of Computer Programming, 14:255 279, 1990. 35. E. Meijer, M. M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In Functional Programming and Computer Architecture, pages 124 144. Springer-Verlag, 1991. 36. E. Meijer and J. Jeuring. Merging monads and folds for functional programming. In J. Jeuring and E. Meijer, editors, Advanced Functional Programming, Lecture Notes in Computer Science 925, pages 228 266. Springer-Verlag, 1995. 37. Erik Meijer. Calculating Compilers. PhD thesis, University of Nijmegen, February 1992. 38. E. Moggi. Metalanguages and applications. In A. M. Pitts and P. Dybjer, editors, Semantics and Logics of Computation, Publications of the Newton Institute. Cambridge University Press, 1997. 39. Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Edinburgh University, Dept. of Computer Science, June 1989. Lecture Notes for course CS 359, Stanford University. 40. Eugenio Moggi. Notions of computacion and monads. Information and Computation, (93):55 92, 1991. 41. Alberto Pardo. Fusion of monadic (co)recursive programs. In Roland Backhouse and Tim Sheard, editors, Proceedings Workshop on Generic Programming, WGP 98, Marstrand, Sweden, 18 June 1998. Dept. of Computing Science, Chalmers Univ. of Techn., and Göteborg Univ., June 1998. 42. Tim Sheard and Leonidas Fegaras. A fold for all seasons. In Proceedings 6th ACM SIGPLAN/SIGARCH Intl. Conf. on Functional Programming Languages and Computer Architecture, FPCA 93, Copenhagen, Denmark, 9 11 June 1993, pages 233 242. ACM, New York, 1993. 43. Guy L. Steele, Jr. Building interpreters by composing monads. In Conference record of POPL 94, 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages: Portland, Oregon, January 17 21, 1994, pages 472 492, New York, USA, 1994. ACM Press. 44. L. Tajes, F. Álvarez, D. Álvarez, M. A. Díaz, and J.M. Cueva. A computational model for a distributed object-oriented operating system based on a reflective abstract machine. In S. Demeyer and J. Bosch, editors, Ecoop 98 Workshop on Reflective Object-Oriented Programming and Systems, volume 1543, pages 382 383. LNCS, 1998. 45. Daniele Turi and Jan Rutten. On the foundations of final coalgebra semantics: non-well-founded sets, partial orders, metric spaces. Mathematical Structures in Computer Science, 8(5):481 540, 1998.

46. Arie van Deursen, Paul Klint, and Joost Visser. Domain-specific languages: An annotated bibliography. ACM SIGPLAN Notices, 35(6):26 36, June 2000. 47. P. Wadler. Comprehending monads. In ACM Conference on Lisp and Functional Programming, pages 61 78, Nice, France, June 1990. ACM Press. 48. P. Wadler. Monads for functional programming. Lecture notes for Marktoberdorf Summer School on Program Design Calculi, Springer-Verlag, Aug 1992. 49. P. Wadler. The essence of functional programming. In POPL 92, Albuquerque, 1992.