Readit News logoReadit News
weddpros · 12 years ago
I've used xtend last year, before I switched to Scala. Eclipse integration is better with Scala (autocompletion among others), and Scala has more to offer. Biggest pain point: stack traces point to the Java translations, not to xtend's source code. That made me switch to Scala.
renszarv · 12 years ago
Interestingly, I've made the opposite switch. And I can't even compare the difference between the slow, unreliable ScalaIDE, with the the hardly understandable compiler errors, and the much quicker, leaner Xtend IDE, where you can see, what's the compiled code, which I really enjoy.
bad_user · 12 years ago
I've been using IntelliJ IDEA for Scala for about a year. Best IDE ever.

With Scala IDE I've only had painful experiences, plus I hate Eclipse with a passion - but folks keep telling me that it got better. Well, I don't really care as long as IntelliJ IDEA exists.

They are also extremely fast and responsive in fixing bugs of any kind. I personally couldn't be happier and other communities can only dream about such IDE support. Of course, if you compare IDEA's Java support with the Scala plugin, it's worse, but IDEA works better for Scala than Eclipse does for Java, like seriously ;-)

IReadYourCode · 12 years ago
Autocompletion in the Xtend editor is quite excellent, you might want to try a recent version. The last time I tried the Scala IDE (during the first Coursera lecture), Scala's autocompletion suggested may invalid proposals. It felt more like the editor was guessing about types than actually doing proper type analysis. If you happen to have a Java stack trace from Xtend code and click on a stack frame, Eclipse will open the Xtend file and highlight the proper line in your Xtend code.
weddpros · 12 years ago
Good to hear Xtend got better... but too late for me, I'm afraid. I learnt to like Scala, but I'm working with node.js now (coffee-script)...

I think Scala is a good language, but maybe it has too many features for me. Xtend did not leave me a bad impression anyway :)

bad_user · 12 years ago
Try IntelliJ IDEA next time you play around with Scala.
valevk · 12 years ago
Could you tell me something about the difference between Xtend and Groovy. To me, Xtend looks like Groovy with a stricter syntax, and instead of directly translating to Java byte code, it gets transalted to Java source first.
IReadYourCode · 12 years ago
Xtend is statically typed but your Xtend code can be as lean and concise as your groovy code because the Xtend compiler can infer the correct types for you.

Because Xtend is statically typed, the Eclipse Xtend editor has quite an excellent autocomplete. For your cursors's location it can propose you a list of all valid keyword, methods names, filed names, local variable names, Class names, etc.

And by excellent I mean: Autocompletion will not forget things and it won't show invalid proposals. No guessing!

For Groovy this just isn't possible because it is mostly unknown to the editor which methods and fields an object has. It's only known at runtime.

tinco · 12 years ago
"Modernized Java", it's basically a slightly uglier C#.

Not that I'd argue C# isn't modern, it's in fact one of the most 'modern' languages I can imagine at the moment, but it's kind of wry that C# did such a good job of keeping current where Java lagged so terribly behind.

bad_user · 12 years ago
Same can be said for the JVM vs CLR, only in reverse.
moonchrome · 12 years ago
JVM doesn't even have value types or generics making it practically unusable in some scenarios. While JVM implementations might be better quality for specific problem domains I'd say CIL is probably better than JVM.

Not to mention CIL was designed to be a Common Intermediate Language from start so language interop is nicer (generics are a nice example)

commentzorro · 12 years ago
I had always thought that the CLR was considerably ahead of the JVM, though admittedly only anecdotally. What is in the JVM that is not in the CLR that makes the JVM further ahead, so to speak.
aerique · 12 years ago
Would you mind expanding on what you think is modern about C#?
egeozcan · 12 years ago
Async, lambdas, extension methods, linq and "the dynamic type" (late binding). Yes, many similar but older implementations for these exist, I know, but in C# they work in harmony - and that's a bit hard to explain for me =)
sidmkp96 · 12 years ago
Properties, lambdas (thought they have it in Java 8, but it is still too late) to start with.
dtech · 12 years ago
I don't see any advantages in this over Scala.
kitd · 12 years ago
Many enterprise shops won't look too far beyond plain Java. Xtend is not as far beyond plain Java as Scala is. One of its selling points is that you can just generate plain Java from Xtend into your normal source folders.

Yes, yes, I know enterprise CTOs need a good slapping, but at least this gives their down-trodden devs an option.

As such, I think it will come under threat from Java 8 rather than Scala.

ZoFreX · 12 years ago
Probably easier to write for Android with Xtend than Scala.
bad_user · 12 years ago
Why is that? Tooling support at this point is much better for Scala than it is for many JVM languages, including Xtend.

Checkout: https://github.com/pocorall/scaloid

You can do that in combination with IntelliJ IDEA for example, which has awesome support for both Scala and Android. Google's new Android Studio is actually the same as IntelliJ Android plugin that they distribute as part of their open-source distribution. It's also the best IDE ever.

lmm · 12 years ago
Why's that? If you're worried about generating lots of extra inner classes, isn't that still a problem with Xtend? Other than that, what's the problem with using Scala on Android?
coldtea · 12 years ago
Not having to mess with the Scale typesystem is a great advantage.
klibertp · 12 years ago
You don't need to mess with a type system unless you're doing some fairly advanced stuff. And then messing with type system starts to be better than messing with reflection, anyway. I'm a dynamic-languages kind of guy, but Scala type system is one of its advantages. Scala type system is comparable with OCaml and Haskell and that's really something you can't say about Java.
kushti · 12 years ago
Oh, how many "next Java" options we have now... Kotlin, Ceylon, Gosu, Xtend, Java 8 :) (Scala not mentioned as I refuse to call it "the next Java", it's a new player)
andrewflnr · 12 years ago
Had not seen or forgotten Gosu. Thanks. Not that I'm likely to use it, Kotlin will be my first choice when I get back to my Android app.
stewbrew · 12 years ago
Doesn't Kotlin target jvm 1.6?
cpfohl · 12 years ago
It's like Coffeescript for Java...

I hereby suggest it be renamed "Coffee".

xutopia · 12 years ago
That would be an evil prank on us all though... We'll have job offers with "12 years of Coffee experience with jQuery".
txmikester · 12 years ago
I've used Xtend many times over the last few years.  In fact, I'm using it right now at my "real" job for an internal project.  I'm mostly a Clojure guy who still has to do a lot of Java work to pay the bills - when I can't use Clojure on a project, Xtend is a breath of fresh air.

The current form of Xtend has been around for a few years now, and has steadily improved.  Its origins go back many years, to the OpenArchitectureWare project where its predecessor (called Xpand) was used as a templating and model transformation language for the framework.  Since oaw moved to the Eclipse foundation (5-6 years ago?), most of the tools have been dropped, reworked, or merged in with other Eclipse projects.

Out of all this reworking for the new generation of Xtext came Xbase, which is an expression language that you can just drop into your DSL and have pretty much the entire Java language available (type system, expressions, scoping, etc.).  If you're doing serious modeling/DSL work, this is about as good as it gets without going to something like MPS (which is awesome, but has its own set of limitations).  Xtend is essentially this Xbase language in stand-alone form, with a few other goodies.  There is also another project called Xcore which lets you create EMF models in plain text, mixing behavior along with structure, and it uses Xtend/Xbase as well.  This is one of the reasons why I'm not too worried about Xtend becoming "abandonware" or anything like that - its main components are pretty essential to some key projects in the Eclipse ecosystem.

So why wouldn't you just use (Scala, Groovy, etc.)?  Well for one thing, I can (and have) bring Java developers up to speed on Xtend in about an hour (less if they know anything about functional programming).  You can see some benefits in more concise code right away, and it only takes a couple days to get productive with it.  No one can do that in Scala or Clojure.  If you're looking for a strategic platform to build your next JVM architecture on - well, that's not really Xtend's place, you're looking for Scala or Clojure (hint - the latter).  But there are a lot of projects where Xtend is a very nice fit, and as a bonus, I've found that developers who learn Xtend first have a much easier time learning a more "serious" language like Scala or Clojure later.

thescrewdriver · 12 years ago
Compared to other JVM languages Xtend seems to be seeing very little adoption or interest. I have yet to encounter anyone who's actually using it.
pjmlp · 12 years ago
It is a me too language from Eclipse foundation without any clear roadmap why anyone in the industry would care to use it given the more mature JVM languages, specially given its dependency to Eclipse and generation of Java code instead of bytecode.
kitd · 12 years ago
Xtext, the Eclipse/JVM language development toolkit behind Xtend, is in many ways more interesting than Xtend itself. In fact (I may be wrong) but Xtend was really done as an Xtext example/test/advertisement.

I have used Xtend a little (not in production) and it was interesting when first introduced. I suspect Java 8 will make it redundant.

IReadYourCode · 12 years ago
A search on Github for Xtend classes reveals 10,502 results: https://github.com/search?q=class+extension%3Axtend&type=Cod...

This beats Ceylon by factor two (4,189 results) and is close to Kotlin (12,233 result).

eurg · 12 years ago
Xtend seems to be a very conservative, but sensible iteration on Java. Does anybody have some experience with it, knows some pitfalls, etc.?
creatio · 12 years ago
I think its only usable with eclipse. I do wish it had ADT and pattern matching.