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. 

 

 

Banner


Android L Is Lollipop And New Nexus Devices
16/10/2014

Google has finally officially launched Android 5 as Lollipop along with a bunch of new Nexus devices. So what does our new Android world look like?



Fear And Loathing In the App Store 8 - Apple Takes Down Innovative App
08/10/2014

Programming into the unknown - it is what keeps us all going. The idea that with nothing but some code we can do something that hasn't been done before. In the old days what you did was between you an [ ... ]


More News

Last Updated ( Friday, 22 March 2013 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.