I created a new language (again) for one of my clients this week. I love doing new languages and I’ve been working 20h a day on this one. I’ve been doing my last languages using the Microsoft tools, so I was afraid I would be a bit rusty on the open-source tools.
The language requires a textual syntax, so I decided to use ANTLR for the concrete syntax. EMF is of course my default choice for the abstract syntax.
After a few days I had completed the abstract and concrete syntax and had a pretty complete plan of how I wanted to perform the transformation. This is when I ran into some interesting choices.
First, I wanted to make sure I picked the proper transformation engine. The transformation is not very hard (it requires many transformers, but the distance from the abstract syntax to the finished products are not complex), so I decided for a direct model-to-text transformation (M2T). I usually try to avoid this as it makes the generation templates more complex than they need to be (that is, I like to do model-to-mode transformations until the transformation to text requires no logic), however, I’m not going to maintain this code and I did not want the client to have to also learn a M2M framework.
The M2T project at eclipse (http://www.eclipse.org/modeling/m2t) lists a few candidates. I was pretty sure I would select JET as the template engine. I already created a course section on JET (in our EMF course http://www.inferdata.com/training/java/emf.html), and I feel I know JET very well. It turns out that JET has taken leaps forward since I looked at it (and EMF does not take advantage of it yet), so I realized I’d have to spend some time learning the new constructs. I then went on to look at the alternative M2T engines. There are two listed in the M2T section:
  • Acceleo: http://wiki.eclipse.org/Acceleo
  • Xpand: http://wiki.eclipse.org/Xpand
After some quick evaluation, I could not find a reason to go from JET to any of these tools. Not that Acceleo and Xpand was not good, I just could not find any main reason to switch ideas.
Next, I wanted to also provide a good editor for the developers of my new DSL. I thought surely there has to be someone that has defined a code-generator with ANTLR as input and an Eclipse editor as output? I may have been sloppy, but I could not find one. Tempted as I was to write one, I realized, I will not have time… Then I ran across the Xtext project (http://www.eclipse.org/Xtext/). I’ve heard of it, but never fully investigated it. After my first investigation (and some communication with the main contributors, thanks guys!), I’m not pretty sure it is the right tool.
I’ll get back to the blog after I’ve finished my project, but it really looks as a brilliant piece of work. Xtext seems to be able to combine the ANTLR grammar (as concrete syntax) with ECORE models (as the abstract syntax). It also provides a very nice template based code generation language.
I’M ALL EXCITED!!!

2

View comments

Today, I want to introduce the word 'dugnad' (pronounced ˈdʉːgnɑd]) to my friends and colleagues.  
Dugnad is a word from Old Norse and it is wrongly translated as 'volunteer work' in the English dictionary. Dugnad has a much richer meaning and tradition in Norway. Dugnad is when a community comes together to fix a problem in their community. 
When I lived in Norway, it was usually used to describe a common effort like cleaning up a common area in your neighborhood or perhaps your sports club comes together to improve the sports facility.
The word, dugnad, is now used in Norway to talk about the shared effort required to fight the coronavirus. 
Source: Wikipedia. Picture of a Dugnad where a group came together to put down a roof 
I can't find a US word for dugnad, so I am hereby submitting it to the dictionary for inclusion (the last word I know we managed to sneak into the English dictionary was quisling, so it is time the Norwegian language contributes a positive word).
I have seen how the communities come together in the US as well. A great example is all the healthcare workers that have volunteered for working with the coronavirus patients in New York (76,000 of them at the latest count). Also, Jayde Powell, who started Angle Shopper (see https://www.cnn.com/2020/03/17/us/coronavirus-student-volunteers-grocery-shop-elderly-iyw-trnd/index.html). 
In fact, the USA is known to come together under a crisis. E.g., think of the effort that the USA put together to fight the Nazis during the second world war. In 1939, the airplane production in the US was 3,000... by the end of the war,  the US produced 300,000 planes.
I pledge to start my own dugnads. The first will be to share the lessons learned working remotely. I am one of the fortunate ones that work remotely and have been for the last 12 years. As of now, the virus has not hit me and my company because all our work is already remote.
I also plan to start free online seminars on various topics that I now teach for various companies and universities.
I'll post the article on how to work remotely here on my blog. I will also start my online seminars as soon as I can figure out which platform is best suited to handle the load (last time I taught a class online, I had 8,000 students and I'm pretty sure my Zoom subscription doesn't handle that :). 
1

View comments

About Me
About Me
Blog Archive
Subscribe
Subscribe
Links
Subscribe
Subscribe
Loading