Pieter Koopman

Types make your life safer and easier

I am an experience researcher in functional programming. I have been deeply involved in the design and implementation of embedded DSLs for property-based testing, state-based testing, task-oriented programming and tierless IoT programming. All of these topics are described in scientific publications. I wrote several publications on implementation techniques of eDSLs. My master course about advanced programming is largely focused about the design and implementation of embedded DSLs.


AUTHORS: Pieter Koopman, Steffen Michels and Rinus Plasmeijer  

Interactive systems can require complex input from their users. A grammar specifies the allowed expressions in such a Domain Specific Language, DSL. An algebraic DataType, ADT, is a direct representation of such a grammar. For most end-users a structured editor with pull-down menus is much easier to use than a free text editor. The iTask system can derive such structured editors based on an ADT using datatype generic programming. However, the input DSL has often also semantic constraints, like proper use of types and variables. A solution is to use a shallow embedded DSL or a DSL based on a Generalized ADT to specify the input. However, such a specification cannot be handled by datatype generic programming. Hence, one cannot derive structured editors for such a DSL.  

As a solution, we introduce structured web-editors that are based on dynamic types. These dynamic types are more expressive; they can express the required DSL constraints. In the new dynamic editor library we need to specify just the dynamic relevant for the DSL. The library takes care of displaying the applicable instances to the user and calls itself recursively to create the arguments of the dynamic functions. In this paper we show how this can be used to enforce the requires constraints on ADTs, to create structured web-editors for shallow embedded DSLS, and to create those editors for GADT based DSLs.  

OBJECTIVES: Better prevent type errors than having to handle them  

AUDIENCE: Programmers handling complex user input via a webpage

Video ←Back