Eclipse Indigo Highlights: Five Good Reasons To Check Out Xtext 2.0
Join the DZone community and get the full member experience.Join For Free
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
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.
support for rich hovers
rich hovers are now shown on any reference or declaration.
you'll also get quick fix hovers for xtext grammars.
there are some huge improvements in xtext 2.0. check out the difference in build time:
not to mention the memory usage improvements:
Opinions expressed by DZone contributors are their own.