itemis blogs

Xtend - Perfect for Code generation

Stefan Oehme

Before Xtend became a general purpose language, it was designed for building code generators and model-to-model transformations in the Xtext framework. And even though this is no longer Xtend's main focus, the related features are useful in other situations, too!Template ExpressionsPretty much every modern language has some way to insert variables into a String template. In Xtend this is called a Rich String and has the following syntax:But Xtend doesn't just have placeholders. You can have loops [...]

Xtend - Operator Overloading

Stefan Oehme

Xtend has a nice list of operators you can use out of the box. But you can also overload them for your own types and even for types that others have written. Let's just look at a typical numeric type, Complex numbers:As you can see, overloading an operator is just done by writing a method whose name matches the operator and its signature. In our example I have overloaded the binary plus and minus operators as well as the unary minus operator. I left out the constructor, toString, equals, hashCode [...]

Xtend - Extension Methods

Stefan Oehme

This is the feature that gave Xtend its name and one of its most powerful tools. At the same time it is one of the least understood features among beginners, so I'll give you a head start.Extension methods can be called on instances of their first parameter type as if they were defined in that type. That's quite a mouthful, so let's just look at an example:We defined an isPrime method that takes an int and then we could call 2.isPrime. You can extend any existing type this way. But which methods [...]

Xtend - Basic Syntax Sugar

Stefan Oehme

Xtend comes with a lot of syntactic sugar that makes your code more readable. In this post we will look at the basics and see how you can make your code much shorter even without learning Xtend's advanced features.Let us take this simple snippet of Java code as an example and make it more readable step by step.For starters, here is the 1-to-1 translation to Xtend, without using any syntax sugar.I was serious when I said Xtend is similar to Java. Now let's remove all the small distractions: Visibility [...]

Xtend - The Series

Stefan Oehme

Xtend is a statically typed programming language that compiles to readable Java code. It stays true to Java's type system and libraries, giving it the best interoperability of all the popular JVM languages. On top of that it adds a lot of syntactic sugar and powerful abstraction features that really cut down on the boilerplate you have to write. Together with its flat learning curve, top-notch IDE and build-system integration, it is easy to pick up and will give you immediate benefits.The release [...]

Xtext, Xtend, JavaFX and Robots

Jan Köhnlein

It is autumn again and EclipseCon Europe 2014 is just around the corner. To me as an Eclipse committer from Germany ECE always feels a bit like meeting the family. In fact, I have been attending for seven years in a row now. I even remember the times when it was called Eclipse Summit Europe. Oh man, I am getting old…As every year, my colleagues and me are contributing the program: I have counted 14 sessions by itemis and I am going to give three myself. Of course there is a lot about Xtext and [...]

See you at EclipseCon Europe

Stefan Oehme

EclipseCon Europe is just around the corner, so it is time for some shameless self-promotion ;) Among the many awesome talks on Xtend and Xtext will also be one given by me and my colleague Sebastian Zarnekow.Tue 16:45 to 17:20: New & Noteworthy in XtendIn this overview we will show you many great features that were added in the 2.6 and 2.7 releases. Among them are inner classes, swifty lambda sugar and improved operator overloading. The small standard library also got some often requested [...]

Eclipse Xtext goes IntelliJ IDEA

Sven Efftinge

The Xtext framework has been in development for six years now. With a team size between five and nine people (we are now at nine) plus many contributors working on it, it has become a successful framework for development of domain specific languages and programming languages in general. From parsers, linkers and compilers to interpreters, type-checkers and full IDE-support, the framework covers everything a grown up language infrastructure needs. So far however, the IDE part has been Eclipse-only. [...]

Musing about Eclipse UX Metaphors: The Blocking Build

Sebastian Zarnekow

tl;drFor the upcoming version of Xtext we are revising the approach to building. It appears to be promising to rethink the overall lifecycle of the Xtext builder to aim at:Better user experience by introducing a non-blocking build infrastructureImproved performance due to improved parallelizationIncremental builds also on the command lineThe Problem The Xtext framework implements an Eclipse builder and is thereby immediately affected by the builder's user experience metaphor (even bad experience [...]

A Floor Wax or a Dessert Topping?

Ed Merks

For those as old as I am and as influenced by American culture as most Canadians certainly are, the question "Is it a floor wax or a dessert topping?" likely rings a bell. Unfortunately, because the internet aims to curb the exchange cultural media—I use the term "cultural media" loosely in this case—you likely can't watch the video via that Wikipedia link where you live, but there are alternatives, thanks to the wonders of Google search. How could modern society, and effective software developers, [...]