Eclipse Xtend Reaches 2.4
Written by Alex Armstrong   
Friday, 22 March 2013

If you haven't heard of Xtend don't feel too bad as it isn't making news headlines like Go or Dart, but it might be important and the latest version has some interesting new features.

Xtend is essentially a language that compiles to Java, human readable Java, and it aims to improve the Java language much as CoffeeScript improves JavaScript.

Xtend 2.4 has some interesting new features, but really it is the ideas that drive the Xtend project that are really interesting. It is a Java-like language but, according to the publicity, not intended to replace Java but to improve it. 

At first look Xtend seems to be Java with some extra bits. It compiles to Java code. Yes you heard that correctly - it produces human readable Java, not machine executable byte code. This is supposed to mean that you can use your Java knowledge to go in and edit the compiled source code. It has been implemented using the Xtext system, a tool to enable the easy creation of Domain Specific Languages. In this light, Xtend is a really impressive demonstration of how powerful Xtext is.

If you would like to see it in action watch the following video which is about an earlier version: 

Xtend Intro from Xtext Team on Vimeo.

 

Xtend introduces lots of new features to Java that make it easier to write code. For example, it uses type inference to make it possible to write strongly typed code but without you have to declare the type of every variable. In version 2.4 the entire type system has been re-implemented to be faster and more consistent. The type inference engine is also claimed to be smarter and capable of infering type where languages such as Scala fail. 

The second big new feature is the ability to use Lisp-like macros as active annotations. You can add an annotation to indicate how elements should be translated to Java. If the term "Lisp-like" is putting you off the idea, then you need to see it in action. As the documentation says, "this is code generation like it should be".

 

xtend

 

There are also lots of smaller improvements, including a more polished IDE with formating, refactoring and generally more help. 

The new system can be used with desktop Java or it can be used with Android as this too is dependent on the JDK. The standard development environment for Android is also Eclipse, so the two fit together quite well. The new version of Xtend has support for debugging Android using the emulator and other new integration.

If you want a better Java. but still need to work with Java. then Xtend might be worth looking at. If you need to create a DSL, then certainly Xtext should be on your list of possible approaches. If it can build Xtend then it can be used for just about anything. 

 

 

More Information

Xtend

Xtext

Related Articles

Eclipse Launches a JDK language

The Adventurous Developer’s Guide to JVM Languages

Go Programming Language Turns 3

Rust 0.4 Full Integration of Borrowed Pointers

First Release of Dart SDK

Kotlin Goes Open Source

Ceylon IDE Officially Released

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Banner


The Feds Want Us To Move On From C/C++
13/11/2024

The clamour for safe programming languages seems to be growing and becoming official. We have known for a while that C and C++ are dangerous languages so why has it become such an issue now and is it  [ ... ]



Flutter Forked As Flock
05/11/2024

One of developers who worked on the Flutter team at Google has created an open-source form of the framework. Matt Carroll says Flock will be "Flutter+", will remain constantly up to date with Flutter, [ ... ]


More News

Last Updated ( Friday, 22 March 2013 )