Xtend – a better Java with less "noise"

Xtend is a statically typed language and it uses the Java type system (including Java generics). Thus Xtend and Java are completely interoperable.

Most of the linguistic concepts of Xtend are very similar to Java, that is, classes, interfaces, and methods. Moreover, Xtend supports most of the features of Java annotations. One of the goals of Xtend is to have a less "noisy" version of Java; indeed, in Java, some linguistic features are redundant and only make programs more verbose.

Let's write a "Hello World" program in Xtend:

package org.example.xtend.examples

class XtendHelloWorld {
  def static void main(String[] args) {
    println("Hello World")
  }
}

You can see that it is similar to Java, though there are some ...

Get Implementing Domain-Specific Languages with Xtext and Xtend now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.