abstractions for language independent transformations

Yesterday, Karl Trygve Kalleberg defended his PhD thesis at Bergen University. The thesis treats the subject of abstractions for program transformation, with the aim of making available transformation abstractions independent of the source language being transformed. The thesis introduces a number of extensions to the Stratego transformation language and reports on several case studies. I understand the thesis will be available soon. (More photos)

There it is. The first version of the 'Domain-Specific Language Engineering' paper. It is still somewhat rough around the edges and can use more meta-level reflection. Therefore, this is 'Mark I'. I expect at least another version, and maybe two before the final one. Comments on any aspect of the work would be greatly appreciated. Here is a quote from the introduction:

In recent years there has been an increasing momentum (some call it hype) for approaches with names as domain-specific languages, model-driven architecture, software factories, language workbenches, and intentional programming. While there are differences between these approaches (mostly of a technological nature?), the common goal is to achieve a higher-level of abstraction in software development by abstracting from low-level boilerplate code. (Making domain-specific languages the approach of my choice, I'll use its terminology from now on.) The idea of domain-specific languages has been around for a long time, but what seems to be new in the current wave, is the requirement to use DSL design and implementation as a standard tool in the software development process. The challenge then is to develop a systematic method for designing new domain-specific languages.

This tutorial describes an experiment in DSL design and implementation. The experiment is simply to take a new domain (web applications), to develop a DSL (set of DSLs) for this domain, and observe the process to extract ingredients for a standard process. The target of the experiment are web applications with a rich domain model that can serve as content management system editable via the browser, but also allow querying and aggretation based on the structure of the data. The tutorial takes one particular combination of technologies. The DSL will be a textual language. The generator targets Java with a certain collection of frameworks for implementation of web applications. The DSL is implemented using Stratego/XT, SDF, and Nix.

Eelco Visser. Domain-Specific Language Engineering. A Case Study in Agile DSL Development (Mark I). Technical Report TUD-SERG-2007-017, Software Engineering Research Group, Delft University of Technology, June 2007. To appear in the proceedings of the Summer School on Generative and Transformational Techniques in Software Engineering (GTTSE'07). (pdf)

In February I had promissed 'to report about my journey through webland and towards the GTTSE tutorial on this blog', but have failed miserably. I find I'm not a good blogger. Not that I have nothing to say. During the process of designing and implementing WebDSL I have thought about dozens of things I could blog about, but either didn't have the time, or didn't think it would be interesting for anyone but myself. I regret that; now that I have something that works it would have been interesting to see a log of the process. Not all is lost though. I am finalizing a paper for the GTTSE'07 summerschool in which I explain the design process.

Here's a quote from the paper:

The boilertemplate smell is characterized by similar target coding patterns used in different templates, only large chunks of target code (a complete page type) considered as a reusable programming pattern, and limited expressivity, since adding a slightly different pattern (type of page) already requires extending the generator.

High time for some generator refactoring. The refactoring we're going to use here is called 'find an intermediate language' also known as 'scrap your boilertemplate'. In order to gain expressivity we need to better cover the variability in the application domain. While implementing the domain model DSL, we've explored the capabilities of the target platform, so by now we have a better idea how to implement variations on the CRUD theme by combining the basics of JSF and Seam in different ways. What we now need is a language that sits in between the high-level domain modeling language and the low-level details of JSF/Seam and allows us to provide more variability to application developers while still maintaining an advantage over direct programming.

In preparation of my GTTSE presenation I have given a two part lecture at the MoDSE Colloquium entitled Domain-Specific Language Engineering (part 1, part 2).

At the first MoDSE workshop yesterday I gave a talk with the title A Sweet WebDSL focusing on the role of desugarings in a DSL for web applications.

"Software written in one language often needs to construct sentences in another language, such as SQL queries, XML output, or shell command invocations. This is almost always done using unhygienic string manipulation, the concatenation of constants and client-supplied strings. A client can then supply specially crafted input that causes the constructed sentence to be interpreted in an unintended way, leading to an injection attack. We describe a more natural style of programming that yields code that is impervious to injections by construction. Our approach embeds the grammars of the guest languages (e.g., SQL) into that of the host language (e.g., Java) and automatically generates code that maps the embedded language to constructs in the host language that reconstruct the embedded sentences, adding escaping functions where appropriate. This approach is generic, meaning that it can be applied with relative ease to any combination of host and guest languages."

The paper Preventing Injection Attacks with Syntax Embeddings, A Host and Guest Language Independent Approach by Martin Bravenboer, Eelco Dolstra, and Eelco Visser has been accepted at GPCE'07. (pdf)

We're having summer temperatures in april (27C at the moment) and no rain for more than four weeks now. Quite unbearable ;-)

summer in april

brown eyes