Tuesday, October 13, 2015

Xtend: Active Annotation Processing in IntelliJ IDEA

This is a short screencast showing the use of @Accessors, @EqualsHashCode and @Data within IntelliJ IDEA 15.

See how getters, setters and other boiler plate gets eliminated in Xtend.

Note, that unlike case classes in Scala or data in Kotlin, in Xtend these annotations are just library. You can easily build your own!

Friday, October 02, 2015

Xtext for IntelliJ IDEA - Preview

Today we've released a preview version for the upcoming IntelliJ IDEA support of Xtext. With this it is now possible to develop Xtext languages entirely in IDEA and due to the cool Gradle support in any other environment, too.

The preview plugins for IntelliJ IDEA can be installed from the following repository location:


Note that Xtext requires the latest IDEA 15 Preview build.

I've recorded a small screencast that shows what Xtext in IntellijJ IDEA looks like:

Friday, September 11, 2015

What I learned at JavaZone 2015

This week I was lucky to go to Oslo to attend JavaZone, which is what they say "the largest community-driven developer conference in the world".
No matter that's true or not it is for sure one of the coolest conferences I have ever been to. It is generally extremely well organized and on top of that they have some really cool features like:

  •  an overflow area, where you can watch all sessions on a split screen and switch audio using a headset!
  •  different food stations, that open in the morning and serve delicious food all day!
  •  recordings of all sessions, uploaded to vimeo and made available in a couple of hours!
  •  ... many more cool things (e.g. I got a Raspberry Pi as a Sopeaker's present :-))

But that such a conference is all about the people and the content, which was equally great:


The first day I started with a talk about alternative implementations for collections. The speaker maintains a library with something he called a gap list, that had some clever techniques to make positional insertion cheaper (compared to ArrayList). It made sense to me and the measurements looked good, although there's a last bit of sceptic on my side, as he did the measurements "on his own".

The next session was the one about Neo4J by Michael Hunger. I already knew Neo4J a bit as did some examples using Xtend some time ago, but it was still very interesting. He showed a cool demo, where he imported data from twitter, github and stackoverflow and joined it together in the database. Also I didn't know the cool web frontend he used, that lets you enter some Cipher code (the Neo4J query language) and shows the results as dynamic diagrams. Cipher btw. is implemented using Scala's parboiled. They really should consider reimplementing it with Xtext, so they get proper editors for free ;-)

Next up was Rafael Winterhalter, talking about his open-source library "Byte Buddy". Byte Buddy is a bytecode library, that comes with builder APIs and some hooks for agents to make it easier to do byte code generation at runtime. The talk was well presented and very interesting. I especially liked the style of his slides, which were very reduced and calm (I'm kind of sick of stockimage-heavy slide decks - I know I use them myself too much :-))

The fourth talk was "How to make your code sustainable" by Christin Gorman. The room was very crowded and it seems like most people enjoyed that talk very much, as she was very enthusiastic. For me it was a bit too superficial and the enthusiasm was tiring me at some point. (nitpicking on)Also there were strange code examples that just wouldn't compile (nitpicking off).

"The Rule of Three" with Kevlin Henney came next. I went to the room, and of course it was overflown. It's Kevlin Henney after all. So I got to try the overflow area for the first time, and it worked flawlessly (as everything else at this conference). The talk was cool, it's always a pleasure listening to him, although he was doing jokes on IDEs :-). I didn't learn many new things (maybe some quotes I have forgotten about now already) but it was super entertaining.

Next up it was my turn to give an introduction to Xtext. The talk went well I think, there were at least some very excited attendees approaching me after the session. As always most of the talk is a demo. It has been recorded and you can watch it here (find all the other talks in the same album).

After that talk I went to the hotel to watch the silly Apple Event (what a waste of time!) and were too tired to get up and go back to the #AweZone party. Oh my, I'm getting old!

On the bright side, I was able to get some work done in the evening and wouldn't have a hangover on ...


I took the time to get in touch with some people and also get more work done. Also I found some cozy places on the conference site and enjoyed the great coffee, food, and ice cream along with some coding.

The only talk I attended was Neal Ford's take on "Microservices". As you might know microservices are the thing, these days and there were very many talks on this topic at JavaZone. I was reading up on microservices from time to time in the past months to understand what that hype is all about and I was still somehow skeptical. But Neil managed to explain the benfits so that I finally understood how, why and when such an architecture might be helpful. At the same time I also figured how much stupid stuff you can read about this topic on the internet. But maybe that's the case with every heavily hyped topic.

After that talk it was time for me to get to the airport and catch my plane to Hamburg. Everything went well and I was already sitting in front of the gate, when Germanwings sent me a note that my flight got canceled (40 mins before boarding). As I knew I couldn't do anything about it I rebooked for the next flight Friday 12:15 and booked a hotel room.


Breakfast, some work, and then to the airport. On my way I wanted to check the boarding time once more: 20:15. Huh? WTF! They silently canceled that second flight, too, and rebooked my for an even later flight! Fun times.

So now I'm sitting here in front of Oslo Airport writing this and wait for the next possible flight to go out tonight. I hope they won't cancel it again.


JavaZone was a blast. Thanks for having me I hope I can come back next year.
Also: Germanwings I hate you!

Thursday, May 28, 2015

The Future of Xtext

this is a write up of a presentation I gave together with Sebastian last week at XtextCON. It is about our future plans of Xtext. But before we talk about the future I would like to start with a quick summary of ...

The Status Quo

Xtext is in development for seven years now. We have always been between 6 and 10 active developers, currently being 9. With a total LOC of 5.747.523 our code base is huge. However you have to take into account that we not only check in generated code (it sometimes helps us to spot problems) but have many, many tests. All in all there is 27.539 usages of @Test which are executed in many different scenarios and against different platforms. All together we count over 180k unit tests.

This kind of test coverage together with a passion for code quality is key keep a software system maintainable and extensible after years.

Xtext 2.8.x

In the coming week we will release 2.8.3, a bugfix version of the 2.8.x stream that introduced many cool new features. With version 2.8.3 we have fixed over 120 bugs and improved quality furthermore. This is also the release that will be part of Eclipse Mars.

Error Reporting

Not sure if you have noticed, but with Mars also comes the new error reporting tool, an initiative by the developers behind Eclipse Code Recommenders. It basically asks you to automatically send in error reports for all kinds of exceptions and UI freezes you experience when working with Eclipse. Although it is not yet included in the Luna SR2 packages we already got many helpful tickets through that feature from the milestone builds. Please, turn this feature on and provide as much information as possible. It really helps!

What about future releases?

To figure our what the community demands, we did a survey. Thanks for everyone who attended! The survey was targeted at Xtext users, and besides some more demographic questions, the most important question was:

"What should be changed or improved?"

The answers included a lot of valuable feedback. Most of them could be assigned to one of the following four themes. I put some of the original answers and comments from the survey on the slides.

People asked for more documentation, specifically around Xbase and in the code (i.e. JavaDoc). Also many asked for an overview chapter where a bird's eye view of the architecture and life cycles is explained. We agree that these parts should be added and enhanced and have put it on our agenda. Fortunately the documentation is now written in markdown and change is only one pull-request away (for everyone ;-)).

Performance has always been high on our list and for every release we spend a lot of time on profiling and optimization. If you suffer from performance problems, first make sure, that you are on the latest version. Performance makes huge steps from release to release.

Here is some of the improvements we have been working on lately:

  • Do nothing in UI thread - computations of any UI services have been moved to background jobs, such that nothing blocks the user.
  • Cancel everything - all UI services, such as outline, mark occurences, semantic highlighting, etc. get canceled on change (i.e. as you type). Since the state is outdated we can stop waste CPU cycles on it.
  • Cancelable builds - also incremental builds now get automatically canceled, when another change comes in.
  • Storaged Resources - Xtext can write fully resolved and computed resources to disk in a binary format, so it can later be loaded again quickly
  • Incremental standalone compilation (new in 2.9) - The eclipse builder has always been incremental. Now Xtext also has an incremental standalone compiler, that together with a running demon ensures super slick incremental compilation of changed files.

Of course, improving performance is never done!

Continuous integration with Xtext and Xtext-based languages has traditionally been a bit of a pain. This is mostly because we started out as an Eclipse only project, and building Eclipse plug-ins is "different". The Xtext project has had a continuous integration build for years, but our build infrastructure is not exactly simple. Targeting different platforms requires a bit of a zoo of build technologies on our side, which should not be necessary for clients. Since almost two years now, there is Maven support, including a plug-in to run your language in an arbitrary maven build. The same has been added for Gradle as well.

The next step is to allow for different project layouts, i.e. Eclipse vs. Maven/Gradle layout and allow for developing Xtext languages without any kind of Eclipse dependency. Which brings us to the last theme.

Xtext is a language framework that has significantly lowered the barrier to develop programming languages and external domain-specific languages. One of the sweet things is the cool Eclipse support you get. However even if you only need a compiler for a language without any Eclipse tooling the Xtext framework provides you with rich abstractions for scoping, indexing, incremental compilation and more. With the next release (version 2.9) it should be possible to create a runtime project only, without any Eclipse dependencies and without the necessity to deal with OSGi or eclipse plug-in mechanism. Our goal is to allow for vanilla Java projects with a normal Gradle or Maven build.

For the IDE part, we are working on supporting web editors and IntelliJ IDEA specifically at the moment. But maybe even more important in the long run, is the general extraction of the IDE services from Eclipse dependencies, such that they can be reused on other platforms easily. Tom Schindl for instance already uses Xtext in JavaFX applications and we are in contact with a group that has ported Xtext to Visual Studio through IKVM.

Just to be clear: The Eclipse support stays important and will be a first class citizen for the Xtext framework in the future, too!


As you can see, the direction is a mixture of improving quality and performance, making accessibility easier but also reaching out to new platforms. I hope you find this direction as exciting as we do. We plan to release Xtext 2.9 in the last quarter of 2015. In case you want to try the current state of the web or intelliJ IDEA support, go ahead and download the recently released beta version. More betas will be released in the coming weeks / months.
So long, have fun and remember your feedback is helpful and very welcome!

Monday, March 16, 2015

Xtext moved to Github

I'm just back from EclipseCon and XtextDay in San Francisco, where we announced the new 2.8.0 release of Xtext and Xtend among some other interesting developments. One of those is our...

Move to Github

In order to simplify the contributor's story, Xtext is taking part in the "social coding initiative" of the eclipse foundation, and the primary git repository has been moved over to github. As a consequence we will no longer use gerrit for code reviews but github pull requests. Also it now makes more sense to fork, watch and star our repository.

Xtext is of course still an Eclipse project!

Changing documentation in two clicks

The website has been reimplemented in jekyll and the entire documentation is now written in github-flavored markdown. A link on every page that says 'edit on github' will open up a markdown editor on github, where anybody can do changes and propose them in form of a pull-request with a second click. This allows for wiki-style turnarounds but with a review and CLA check in it.
Just go try it out :-)

Automated setup

While documentation and website improvements can be made in the browser, you usually want to run some of our over 30.000 unit tests when you did code changes, or be able to compile and debug code. With a big project like Xtext that targets multiple platforms, the setup of a workspace and the corresponding tools is unfortunately not exactly simple. But fear not, this is all automated, thanks to an oomph setup. So even here it is only a couple of clicks until you have a fully working setup, that includes an IDE, the workspace, correct target platform, the team's workspace preferences and so on. Just everything you need and everything like we committer have it.

Code contributions

The team has many active committers that are very happy to review your high-quality pull-requests. If you want to start working on something it would be best if you pick up one of the bugzillas flagged with 'v2.9' or whatever the upcoming release is in case you read this post at a later point in time. This is how we schedule the things we agreed on working on.

Thursday, January 29, 2015

Auto-GWT - Boilerplate Free GWT Programming

Maybe not especially new for everybody, but: GWT is NOT dead!

I've been at the GWT.create conference yesterday, a two-day conference on GWT only that took place in San Jose last week and this week in Munich. With over 400 attendees it was sold out. If that is not enough evidence of the liveliness of the project, you may have missed that Google runs huge projects on GWT. The latest one is Google Inbox. Add all the nice improvements (like increased compile speed) the latest releases have to offer and you will conclude that GWT is the best way to write browser apps in Java or any JVM language. The generated JavaScript code is highly optimized and runs even much faster than typical hand-written JavaScript code.

I had the pleasure to present the new Auto-GWT library we have built for GWT together with my colleague Anton. Thanks to all the attendees for the great questions and the overwhelmingly positive feedback. As a kind of wrap up after the conference I have uploaded the slides, the demo and the Auto-GWT project.

You can find all necessary information on the project's website : auto-gwt.org
Forks and pull requests are very welcome!

Auto-GWT in action:

Slides from GWT.create:

Friday, January 23, 2015

XtextDay and EclipseCon San Francisco 2015

In case you've missed it, we are organizing a so called XtextDay co-located with EclipseCon 2015. The program is already online for a couple of weeks:

Sebastian and I will start the day talking about the newest developments (e.g. Intellij IDEA support, web editor support, incremental standalone builders, etc.). After that we will hear how Xtext languages are used to design REST APIs. In the afternoon we have in-depth sessions on Xbase, performance and scoping, and after the coffee break we will learn how a silicon valley company use Xtext to build a commercial product for designing systems on a chip (IoT). The full program details can be found here. But that's not all..

Additional Xtext content at EclipseCon

Although it's possible to register only for the XtextDay, I recommend to book the whole EclipseCon conference as it is not only an awesome community event where you will find many new friends, but in addition to the XtextDay, there is some Xtext-related content there as well. It starts with a beginner's tutorial on Monday, which is a good preparation for the technically deeper talks following. In addition to the XtextDay and the tutorial we have:

So quite some content in addition to XtextDay. If you consider using Xtext for something or you are already using it, then you should definitely come and join the sessions, discussions and party! :-)