Saturday, August 18, 2007

Mixing Concrete And Abstract Syntax

I wanted to write a few lines about the decision that Xtext derives the meta model from the grammar.
Of course I agree that it is best to come up with a set of abstractions (i.e. the meta model) first and afterwards define a (or two) concrete syntax based on it.
However you'll need a concrete syntax to define the meta model, don't you. For me the Xtext grammar language is such a concrete syntax enriched with concrete syntax information (leave it out if you don't want to care in the first iteration). And to me it is much more handy and convenient then creating the meta model with en EMF editor or even worse with a graphical editor.
Moreover designing a DSL is no big-up-front work. You can't get all the abstractions you will need first and then define a concrete syntax for it. Instead developing a DSL needs to be done in very short increments, you will add, remove, rename concepts and features as your framework grows. Xtext focusses on a very short turnaround enabled by the concrete/abstract syntax grammar language and the right abstractions.

Unfortunately mixing grammar and meta model definition becomes complicated when it comes to more complex languages.
Therefore I'm thinking about separating the two things in one of the next versions in order to support all languages an LL(*) (Antlr 3) parser can work with.
This may have an impact on the turnarounds, but maybe we can do our best by providing meta model refactorings and the kind.

Sunday, August 12, 2007

Xtext 2.0

I'm currently working on the next version of Xtext. And I'm very excited about it :-)
It will provide all kind of things you know from JDT's Java editor such as real code completion (not the pseudo / typed-once stuff), rename refactoring, find references, go to declaration, type hierarchy, code folding outline view, auto formatting, toggle comment, etc..

I want to thank Stefan Ocke who gave me the needed hint on how to get code completion work (actually he implemented it based on the old version - I just rewrote and extended it).
Yesterday my brother Lars (yes, he is a software developer, too) convinced me that defining cross-references on grammar level is a good idea. So I've added support for it.
Finally DSL editors won't do the parsing and analyzation "on save" anymore but do it in a background thread. So you will get feedback while typing and you don't have to wait for that process on save.
The first draft of Xtext 2.0 will make it in the upcoming oAW release train (called 4.2).
I hope it will provide all of the mentioned features (I'm not finished yet but Itemis (btw. MANY THANKS!!!) support me, so I can take the time needed without being afraid of loosing my house ;-))

I will create a screencast showing Xtext 2.0 in action, soon!