Network


Latest external collaboration on country level. Dive into details by clicking on the dots.

Hotspot


Dive into the research topics where S. Doaitse Swierstra is active.

Publication


Featured researches published by S. Doaitse Swierstra.


Advanced Functional Programming, Second International School-Tutorial Text | 1996

Deterministic, Error-Correcting Combinator Parsers

S. Doaitse Swierstra; Luc Duponcheel

We show how error-correcting, deterministic, combinator parsers can be constructed for grammars which have the LL(1) property. The normal disadvantages of conventional combinator parsers, such as their lack of speed and their poor error reporting, are remedied. Parsers constructed with these combinators are implicitly specialised for the grammar they describe. Because of this property the combinators act as a parser generator for LL(1) grammars. The techniques used to construct the combinators illustrate how partial parametrisation and careful ordering of computations can be used to achieve implicit partial evaluation in a lazy language.


International School on Advanced Functional Programming | 1998

Designing and Implementing Combinator Languages

S. Doaitse Swierstra; Pablo R. Azero Alcocer; João Saraiva

Ever since the Computer Science community has discovered the concept of a programming language there has been a continuous quest for the ideal, all-encompassing programming language; despite this we have been overwhelmed by an everlasting flow of all kinds of special purpose programming languages. Attempts to bridge this gap between a single language and infinitely many caused research into so-called extensible programming languages.


international conference on functional programming | 2002

Typing dynamic typing

Arthur I. Baars; S. Doaitse Swierstra

Even when programming in a statically typed language we every now and then encounter statically untypable values; such values result from interpreting values or from communicating with the outside world. To cope with this problem most languages include some form of dynamic types. It may be that the core language has been explicitly extended with such a type, or that one is allowed to live dangerously by using functions like unsafeCoerce. We show how, by a careful use of existentially and universally quantified types, one may achievem the same effect, without extending the language with new or unsafe features. The techniques explained are universally applicable, provided the core language is expressive enough; this is the case for the common implementations of Haskell. The techniques are used in the description of a type checking compiler that, starting from an expression term, constructs a typed function representing the semantics of that expression. In this function the overhead associated with the type checking is only once being paid for; in this sense we have thus achieved static type checking.


international conference on functional programming | 2003

Scripting the type inference process

Bastiaan Heeren; Jurriaan Hage; S. Doaitse Swierstra

To improve the quality of type error messages in functional programming languages,we propose four techniques which influence the behaviour of constraint-based type inference processes. These techniques take the form of externally supplied type inference directives, precluding the need to make any changes to the compiler. A second advantage is that the directives are automatically checked for soundness with respect to the underlying type system. We show how the techniques can be used to improve the type error messages reported for a combinator library. More specifically, how they can help to generate error messages which are conceptually closer to the domain for which the library was developed. The techniques have all been incorporated in the Helium compiler, which implements a large subset of Haskell.


Language Engineering and Rigorous Software Development | 2009

Combinator Parsing: A Short Tutorial

S. Doaitse Swierstra

There are numerous ways to implement a parser for a given syntax; using parser combinators is a powerful approach to parsing which derives much of its power and expressiveness from the type system and semantics of the host programming language. This tutorial begins with the construction of a small library of parsing combinators. This library introduces the basics of combinator parsing and, more generally, demonstrates how domain specific embedded languages are able to leverage the facilities of the host language. After having constructed our small combinator library, we investigate some shortcomings of the naive implementation introduced in the first part, and incrementally develop an implementation without these problems. Finally we discuss some further extensions of the presented library and compare our approach with similar libraries.


symposium/workshop on haskell | 2009

The architecture of the Utrecht Haskell compiler

Atze Dijkstra; Jeroen D. Fokker; S. Doaitse Swierstra

In this paper we describe the architecture of the Utrecht Haskell Compiler (UHC). UHC is a new Haskell compiler, that supports most (but not all) Haskell 98 features, plus some experimental extensions. It targets multiple backends, including a bytecode interpreter backend and a whole-program analysis backend, both via C. The implementation is rigorously organized as stepwise transformations through some explicit intermediate languages. The tree walks of all transformations are expressed as an algebra, with the aid of an Attribute Grammar based preprocessor. The compiler is just one materialization of a framework that supports experimentation with language variants, thanks to an aspect-oriented internal organization.


international conference on functional programming | 2009

Attribute grammars fly first-class: how to do aspect oriented programming in Haskell

Marcos Viera; S. Doaitse Swierstra; Wouter Swierstra

Attribute Grammars (AGs), a general-purpose formalism for describing recursive computations over data types, avoid the trade-off which arises when building software incrementally: should it be easy to add new data types and data type alternatives or to add new operations on existing data types? However, AGs are usually implemented as a pre-processor, leaving e.g. type checking to later processing phases and making interactive development, proper error reporting and debugging difficult. Embedding AG into Haskell as a combinator library solves these problems. Previous attempts at embedding AGs as a domain-specific language were based on extensible records and thus exploiting Haskells type system to check the well formedness of the AG, but fell short in compactness and the possibility to abstract over oft occurring AG patterns. Other attempts used a very generic mapping for which the AG well-formedness could not be statically checked. We present a typed embedding of AG in Haskell satisfying all these requirements. The key lies in using HList-like typed heterogeneous collections (extensible polymorphic records) and expressing AG well-formedness conditions as type-level predicates (i.e., type-class constraints). By further type-level programming we can also express common programming patterns, corresponding to the typical use cases of monads such as Reader, Writer and State. The paper presents a realistic example of type-class-based type-level programming in Haskell.


Journal of Functional Programming | 2004

Parsing permutation phrases

Arthur I. Baars; Andres Löh; S. Doaitse Swierstra

A permutation phrase is a sequence of elements (possibly of different types) in which each element occurs exactly once and the order is irrelevant. Some of the permutable elements may be optional. We show how to extend a parser combinator library with support for parsing such free-order constructs. A user of the library can easily write parsers for permutation phrases and does not need to care about checking and reordering the recognized elements. Applications include the generation of parsers for attributes of XML tags and Haskells record syntax.


compiler construction | 2000

Functional Incremental Attribute Evaluation

João Saraiva; S. Doaitse Swierstra; Matthijs F. Kuiper

This paper presents a news trict, purely functional implementation of attribute grammars. Incremental evaluation is obtained via standard function memoization. Our new implementation of attribute grammars increases the incremental behaviour of the evaluators by both reducing the memoization overhead and increasing their potential incrementallity. We present also an attribute grammar transformation, which increases the incremental performance of the attribute evaluators after a change that propagates its effects to all parts of the syntax tree. These techniques have been implemented in a purely functional attribute grammar system and the first experimental results are presented.


conference on current trends in theory and practice of informatics | 1999

Fast, Error Correcting Parser Combinatiors: A Short Tutorial

S. Doaitse Swierstra; Pablo R. Azero Alcocer

Compiler writers have always heavily relied on tools: parser generators for generating parsers out of context free grammars, attribute grammar systems for generating semantic analyzers out of attribute grammars, and systems for generating code generators out of descriptions of machine architectures. Since designing such special formalisms and constructing such tools deals with one of the most important issues in computer science, courses on compiler construction have always formed part of the core computer science curriculum.

Collaboration


Dive into the S. Doaitse Swierstra's collaboration.

Top Co-Authors

Avatar
Top Co-Authors

Avatar
Top Co-Authors

Avatar
Top Co-Authors

Avatar

Arthur I. Baars

Polytechnic University of Valencia

View shared research outputs
Top Co-Authors

Avatar
Top Co-Authors

Avatar
Top Co-Authors

Avatar
Top Co-Authors

Avatar
Top Co-Authors

Avatar
Top Co-Authors

Avatar
Researchain Logo
Decentralizing Knowledge