Est. 2011 Intermediate

Xtend

A statically typed JVM language from the Eclipse Xtext team that compiles to readable Java source code - trading Java's ceremony for type inference, lambdas, extension methods, template expressions, and compile-time macros.

Created by Sven Efftinge and Sebastian Zarnekow (Eclipse Xtext project)

Paradigm Multi-paradigm: Object-Oriented, Functional, Imperative
Typing Static, Strong, Inferred
First Appeared 2011
Latest Version Xtend 2.43.0 (May 2026)

Xtend is a statically typed programming language for the Java Virtual Machine that made an unusual bet: instead of compiling to JVM bytecode like Scala, Groovy, or Kotlin, it compiles to readable Java source code. Created by Sven Efftinge and Sebastian Zarnekow of the Eclipse Xtext project and first released in June 2011, Xtend set out to be “a better Java” rather than a different language - it reuses Java’s type system unchanged, its generated output looks like code a careful human would write, and any Java library works from Xtend without wrappers or glue.

On top of that deliberately familiar foundation, Xtend layered the features Java conspicuously lacked in 2011: type inference, lambda expressions, extension methods, operator overloading, multiline template strings, powerful switch expressions, and - most distinctively - active annotations, compile-time macros that let ordinary libraries rewrite the code being generated. A decade and a half later, Java itself has absorbed many of those ideas, and Xtend’s own maintainers now steer new users back toward plain Java. But in its niche - code generation for domain-specific languages - Xtend remains quietly load-bearing across the Eclipse modeling world.

History & Origins

From openArchitectureWare to Xtext (2000s-2011)

Xtend’s roots are in model-driven software development. In the mid-2000s, the openArchitectureWare (oAW) framework - developed in large part at the German consultancy itemis - provided a toolchain for defining models and generating code from them, including a template language called Xpand and a functional model-transformation language called, confusingly for later historians, Xtend. When oAW’s language tooling migrated to Eclipse and was reborn as Xtext, a framework for building textual domain-specific languages with full IDE support, the team concluded that its aging generator languages needed a successor.

That successor was designed by Sven Efftinge and Sebastian Zarnekow as a general-purpose language rather than another special-purpose template dialect. Initially named Xtend2 - the numeral distinguishing it from the old oAW language, and the reason its versions have always been numbered 2.x - it shipped in June 2011 as part of Xtext 2.0 in the Eclipse Indigo release train. Fittingly, Xtend was itself built with Xtext, serving as the flagship demonstration that the framework could produce a real, IDE-grade programming language.

With the Eclipse Juno release in June 2012 (version 2.3), Xtend became a standalone Eclipse project. The timing placed it in a crowded field: Kotlin had been announced by JetBrains in 2011, Scala was ascendant, and Groovy was well established. Xtend’s differentiator was its radical Java-compatibility - no new type system, no new bytecode, no new runtime semantics, just better syntax over the platform everyone already ran.

The active annotations era (2013 onward)

Xtend 2.4, announced by the Eclipse Foundation in March 2013, was the language’s most consequential release. It introduced active annotations, along with collection literals and the ability to declare interfaces, enums, and annotations - and it was promoted for Android development, since generated Java source slotted straight into Android’s toolchain. In 2016, core committers led by Efftinge founded the consultancy TypeFox, which joined itemis and the broader Eclipse community as a steward of Xtext and Xtend’s continued development.

Design Philosophy

Three principles define Xtend:

  1. Java’s semantics, better syntax. Xtend deliberately adds no type-system novelty. It uses Java’s types, generics, and libraries as-is, so an Xtend class and a Java class are interchangeable citizens of the same project - callable in both directions, mixed freely in one source tree.
  2. Transparency over magic. Compiling to readable Java source means developers can always inspect exactly what their code becomes, debug through familiar output, and even abandon Xtend by keeping the generated Java. Nothing is hidden in bytecode.
  3. Extensibility as a library concern. Extension methods let libraries add operations to existing types; operator overloading maps operators to plainly named methods; active annotations let libraries extend the compiler. The language stays small by pushing expressiveness out to libraries.

Key Features

A flavor of the language - type inference with val, lambdas with the implicit it parameter, and extension-method chaining:

class Greeter {
    def static void main(String[] args) {
        val names = #["Ada", "Grace", "Barbara"]
        names.filter[length > 3].forEach [
            println('''Hello, «it»!''')
        ]
    }
}
  • Type inference: local variables (val/var), method return types, and lambda parameters rarely need explicit types, while everything remains statically checked.
  • Lambdas before Java had them: concise [x | x * 2] syntax with an implicit it receiver, three years before Java 8 brought lambdas to the mainstream.
  • Extension methods: any method can be called as if it belonged to its first argument’s type, so utility functions read like built-in operations.
  • Template expressions: triple-quoted strings with «guillemet» interpolation and intelligent whitespace handling - a direct inheritance from the Xpand template language, and the reason Xtend excels at code generation.
  • Active annotations: annotations such as the built-in @Data, @Accessors, @Delegate, and @ToString run at compile time and rewrite the generated Java - user-definable macros with full IDE awareness, achieving openly and extensibly what Lombok does through compiler internals, and anticipating what Java records later made native.
  • Everything is an expression: if, switch, and try return values; the last expression of a method body is its return value.
  • Switch with type guards: switching over an expression’s type both matches and casts in one step, with no fall-through - foreshadowing Java’s own pattern matching for switch by more than a decade.
  • Null-safe navigation: the ?. operator and Elvis-style ?: defaulting tame null handling.
  • Polymorphic dispatch: dispatch methods select an implementation by the runtime types of their arguments, replacing visitor-pattern boilerplate.

Evolution

Xtend’s version history tracks Xtext’s, moving through the 2.x line on the Eclipse simultaneous release cadence for fifteen years. The early releases raced to out-feature Java; the later ones tell a different story - one of Java catching up. Lambdas (Java 8, 2014), local-variable type inference with var (Java 10, 2018), switch expressions (Java 14, 2020), text blocks (Java 15, 2020), records (Java 16, 2021), and pattern matching for switch (Java 21, 2023) each absorbed an argument for choosing Xtend.

The project acknowledged this openly. In March 2020, long-time committer Christian Dietrich opened a “Call To Action” issue on securing Xtext and Xtend’s future maintenance, recommending among other things that the project itself stop using Xtend so extensively and no longer encourage users to pick Xtend for things modern Java does as well or better. Since then, release notes have carried a standing notice that the future maintenance of Xtext and especially Xtend is at risk as the pool of regular contributors declines.

Even so, the releases keep coming: Xtend 2.38.0 (February 2025) raised the minimum Java version to 17, and version 2.43.0 shipped in May 2026 on the usual quarterly rhythm.

Current Relevance

Xtend today is a maintained language with a candid maintainability warning attached. Where it persists, it persists for good reasons:

  • DSL engineering: In the Xtext world, Xtend remains the idiomatic language for code generators and JVM model inferrers, where its template expressions have no real equal in Java itself.
  • Eclipse modeling stack: Xtext’s own codebase, Xcore models, and a long tail of industrial DSL projects built over the past fifteen years all carry Xtend code that continues to be maintained.
  • openHAB’s rules DSL: the Xbase expression language underlying Xtend powers the classic rule syntax of one of the most popular open-source home-automation platforms.

For general-purpose “better Java” programming, the ecosystem’s verdict is equally clear: Kotlin won that contest, and modern Java itself closed much of the gap. Xtend’s own maintainers say as much.

Why It Matters

Xtend earns its place in the language encyclopedia on three counts:

  • It was right early. Type inference, lambdas, expression-oriented switch with type patterns, compact data classes, string templates - Xtend shipped mainstream-friendly versions of all of these on the JVM in 2011-2013, and watching Java adopt them one by one over the following decade is a case study in how features migrate from challenger languages into incumbents.
  • Transpiling to readable source. Xtend demonstrated that source-to-source compilation - with output meant for human eyes - could be a first-class strategy on the JVM, easing adoption fears, simplifying debugging, and enabling targets like Android and GWT-era toolchains that consumed Java source. The same philosophy later became standard practice in the JavaScript world.
  • Macros with IDE support. Active annotations offered Lisp-style compile-time metaprogramming in a statically typed, IDE-friendly package years before annotation-driven code generation became routine, and did it without bytecode manipulation.

Xtend is also an honest story about what happens to a “better X” language when X gets better. It never displaced Java, and its maintainers no longer suggest it should. But in the corner of the software world where languages are built - grammars, generators, models, and templates - the language that Xtext built still does exactly what it was designed for.

Timeline

2011
Xtend is first released in June as part of Xtext 2.0 in the Eclipse Indigo release train; designed by Sven Efftinge and Sebastian Zarnekow, it is initially called 'Xtend2' to distinguish it from an earlier model-transformation language of the same name in the openArchitectureWare framework - which is also why its version numbers begin at 2.x
2012
Xtend 2.3 ships with Eclipse Juno in June, and Xtend becomes a standalone Eclipse project with its own identity separate from Xtext
2013
Xtend 2.4 is released in March with active annotations - compile-time macros that let libraries participate in the translation of Xtend code to Java - along with collection literals, the ability to declare interfaces, enums, and annotations, and promoted support for writing Android apps via generated Java source
2016
Core Xtext and Xtend committers led by Sven Efftinge found the consultancy TypeFox, which becomes one of the main stewards of the languages' development alongside itemis and the wider Eclipse community
2020
Long-time committer Christian Dietrich opens a 'Call To Action' issue in March on securing the future maintenance of Xtext and Xtend, recommending that the project reduce its own reliance on Xtend now that modern Java has closed much of the expressiveness gap
2025
Xtend 2.38.0 (February) raises the minimum supported Java version to 17; the project's release notes carry a standing notice that future maintenance of Xtext and especially Xtend is at risk as regular contributors decline
2026
Xtend 2.43.0 ships in May, continuing the quarterly release cadence aligned with Xtext and the Eclipse simultaneous release

Notable Uses & Legacy

Eclipse Xtext

The language-workbench framework that Xtend was born from uses Xtend extensively in its own implementation, and Xtend has long been the recommended language for writing code generators and JVM model inferrers in Xtext-based DSL projects, where its template expressions shine.

openHAB

The open-source home-automation platform's classic rules DSL is built on Xbase, and its documentation describes the rule syntax as the same expression language used in Xtend - making Xtend idioms the daily dialect of thousands of smart-home tinkerers.

SARL

The agent-oriented programming language for multi-agent systems is built on the same Xtext infrastructure and derives much of its syntax from Xtend, compiling to Java in the same source-to-source style.

Eclipse Xcore

EMF's textual modeling language lets developers define Ecore models with behavior written in Xbase, the statically typed expression language that Xtend is built on, turning what were XML-and-wizard workflows into plain text files.

Early Android development

Because Xtend compiles to plain Java source rather than bytecode, the 2.4 release in 2013 was promoted for building Android apps with less code - years before Kotlin became Android's officially supported alternative language.

Language Influence

Influenced By

Influenced

SARL

Running Today

Run examples using the official Docker image:

docker pull
Last updated: