Eclipse Xtend on JVM: Not as 'scary' as rival Scala

Co-architect Sebastian Zarnekow discusses's statically typed language, benefits of compiling to Java source

By , InfoWorld |  Software, java

InfoWorld: The old Xtend didn't run on the JVM, did it?

Zarnekow: No, it was an interpreted language.

InfoWorld: You mentioned that Xtend is similar to but not as scary as Scala. What's scary about Scala and why isn't Xtend scary?

Zarnekow: The Scala type system is quite complicated for most developers. [It is] so complicated that it's even hardly possible to create a reasonable IDE for that. Even though Scala is statically typed, there are so many implicit things going on that a developer has a really hard time to understand what happens there.

InfoWorld: For what type of applications is Xtend best suited?

Zarnekow: Basically, everything that you would otherwise do with Java can be done with Xtend.

InfoWorld: What is the main advantage of Xtend compiling to Java source code and not to Java byte code?

Zarnekow: The Java compiler does a lot of checks for us that otherwise would happen at runtime only, so it helps. It's far more complicated from a given viewpoint to create source code, that's true. But on the other hand, for the end-user it's far easier to understand what happens under the hood, so being able to look at the result of compilation is a benefit that cannot be overvalued.

InfoWorld: You say Xtend has exceptional DSL support and offers annotations on steroids. Can you elaborate on those two concepts?

Zarnekow: Exceptional DSL support is mainly about being able to use other languages that are built with Xtext on the one hand side, so [it is about] interacting with external DSLs. But more importantly, [Xtend has] a syntax that is so flexible that an API can be created in order to directly express the intent of the code without leaving encapsulation or static typing. That is possible with Xtend. By combining orthogonal concepts such as overt overloading or extension methods in combination with the support for lambda expressions and type inference, one can achieve quite readable and remarkable APIs for specific use cases.

InfoWorld: What about annotations?

Zarnekow: Annotations support is something that we have in the pipeline for the next release. What you can do is develop the client of an annotation and the annotation processing itself side by side and without having to deploy something, you can live-influence the way that Xtend is compiled to Java source code. There's again an advantage in compiling to source code -- you immediately see what your annotation processor does by simply looking at the resulting Java code. You can write annotations in order to validate the structures of your Xtend classes in a domain-specific manner.

Originally published on InfoWorld |  Click here to read the original story.
Join us:






Answers - Powered by ITworld

Ask a Question