Eclipse releases Xtend, a new language that compiles to Java

Following hot on the heels of Google’s announcement of a new programming language in the form of Dart, the Eclipse Foundation felt the need to get in on the act and have made available “Xtend”.

Xtend is based on the idea of “Embrace Java… but kill the noise… and add some sugar!” according to the website. Xtend doesn’t work like Scala, in that it compiles to byte code that can be run on the JVM, but instead cross-compiles to Java (much like Dart can compile to JavaScript) before compilation to byte code. Additionally, it allows you to drop back into the generated Java whenever you like, without affecting your code.

As you’d expect from the Eclipse foundation, the integration with the Eclipse IDE is very good – in fact much what you’d expect from the Java support.

“Xtend is really not meant to replace Java but to modernize it a bit” says the website: and in some ways it does that. Xtend brings closure to Java; a functioning switch statement; better string support (multiline literals!) and better multiple dispatch.

However it’s all not fun and games. Some of the shorthand introduced is dubious and detracting from meaningful and useful code – I wouldn’t go converting your tens of thousands of lines of code to Xtend in a hurry. However, for weekend projects or hackathons its benefits could be twofold: quicker development time, and the ability to translate the whole lot easily to Java if you need to do anything more complicated later.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Memory is like an orgasm. It's a lot better if you don't have to fake it.” - Seymour Cray