Some Updates

I intend to make my posting here more regular from now on, basically I haven’t been posting anything at all lately. So here’s the first one.

As you may or may not know, I recently (well, three months ago) start with my Ph.D. It’s part of the MoDSE project (Model Driven Software Evolution). I have a post in my drafts folder about what exactly that is all about, but I have a hard time finishing it, so I’ll just briefly explain what I’m work on at the moment.

We’re working on a DSL (Domain Specific Language) for the web, called WebDSL (better website, built with WebDSL is coming up). The idea behind this language is that web development today always consists of combining many different technologies and languages. Some examples are HTML, CSS, PHP and some database. WebDSL attempts to combine all these things into one language. It has language constructs to define page structure, business logic and data access (through embedded HQL, a kind of SQL). Layout currently is still a separate thing (done in CSS), but this will be integrated as well. The nice thing about this is that not only do you have to learn half a dozen frameworks and languages, it is also easier to check that all the different components work well together (you can do type checking for example).

We translate WebDSL applications into a J2EE applications, using Java, JSF, Hibernate and SEAM (running on JBoss), a script will then compile all that and you will end up with a .ear file that you can deploy on any JBoss Java application server. For the parsing and translating we use SDF and Stratego/XT.

WebDSL is essentially an exercise in designing and building such programming languages geared towards a particular domain. There will be more information when the first WebDSL version will be released, (planned on December 20th), but here’s a piece of WebDSL code (a very bare-bone wiki system), so you can get a flavor of what it looks like (the only thing missing are some simple templates and the CSS):

application com.example.wiki
description {
This is an automatically generated description
}
imports templates
section data model
entity Page {
name :: String (name, id)
text :: WikiText
}
section global variables
globals {
var mainPage : Page := Page {
name := "HomePage"
text := "This is text for the main page.nn
Here's a link to [[page(AnotherPage)|another page]]"
};
}
section pages
define page home() {
main()
define body() {
section {
header {"All page"}
list {
for(p : Page) {
listitem { output(p) }
}
}
}
}
}
define page page(p : Page) {
init {
if(p.text = "") {
goto editPage(p);
}
}
main()
define body() {
section {
header {output(p.name)}
output(p.text)
section { navigate(editPage(p)) { "Edit this page" } }
}
}
}