Eclipse Indigo Highlights: Five Good Reasons To Check Out Xtext 2.0
Modelling is a huge part of the Eclipse eco-system, and the Indigo release train brings Xtext 2.0, the new version of the award winning framework for developing domain specific languages. Besides hundreds of bug fixes and significant performance improvements, Xtext 2.0 introduces a refactoring framework and support for rich hover information. A new expression language can be embedded in any DSL and allows users to write computational logic right within their own language. The statically typed template language Xtend eases the development and maintenance of code generators, which are now tightly integrated with Eclipse.
"Xtext 2.0 comes with huge performance improvements and lots of shiny new IDE features such as refactorings and rich hovers for all domain-specific languages (DSL). The most important addition is the statically-typed base language which can be reused within any DSL, which unveils a whole new world of possibilities."
Xbase: A Reusable Expression Language
Xbase is a partial programming language implemented in Xtext and can be embedded and extended within other languages written in Xtext. Expressions are at the heart of every programming language, but can be difficult to get right. Xbase helps you to allow more complex programming within your DSL, using an expression language that is closely related to Java.
You can read more about how Xbase works at Sven Efftinge's blog, or just take it for a spin in the new Indigo release.
Xtend: A Code Generation Language
Xtend is a statically-typed programming language which tightly integrates with, and runs on, the Java VM. It improves on the following concepts:
- Advanced Type Inference - You rarely need to write down type signatures
- Full support for Java Generics - Including all conformance and conversion rules
- Closures - concise syntax for anonymous function literals
- Injected extension methods - Enhance closed types with new functionality injected via JSR-330
- Multiple dispatch aka polymorphic method invocation
- Operator overloading - make your libraries even more expressive
- Powerful switch expression - type based switching with implicit casts
- No statements - Everything is an expression
- Template syntax with intelligent whitespace handling
- Translates to Java not bytecode - understand what's going on and use your code for platforms such as Android or GWT
Refactoring Framework
All Xtext based languages now get support for rename refactorings for free, simply by adding the RefactorElementNameFragment. See Jan Köhnlein's blog post about this for more details.
Xtext Refactoring from Xtext Team on Vimeo.
Support For Rich Hovers
Rich Hovers are now shown on any reference or declaration.

You'll also get quick fix hovers for Xtext grammars.
Performance Improvements
There are some huge improvements in Xtext 2.0. Check out the difference in build time:
Not to mention the memory usage improvements:






Comments
Mark Unknown replied on Thu, 2011/06/23 - 7:42am
Cloves Almeida replied on Thu, 2011/06/23 - 10:03pm
In general, you write DSLs in order to provide higher-abstraction. Say, for instance, declaring "entities" instead of "class passing as entities", or "workflow" instead of "xml passing as workflow", or "access rules" instead of "java code passing as access rules".
When dealing with business apps with hundreds of these, declaring stuff in a easier-to-read-and-understand way instead of plain Java or XML can help a lot.
Mark Unknown replied on Fri, 2011/06/24 - 7:38am
in response to:
Cloves Almeida
John J. Franey replied on Fri, 2011/06/24 - 3:39pm
in response to:
Mark Unknown
Here is Tom Schindl's example just introduced....a java/fx editor using xtext. This is not a business domain editor (unless your business produces java/fx code) but it is not contrived or trivial.
Mark Unknown replied on Sat, 2011/06/25 - 2:09pm
in response to:
John J. Franey