News for hackers. Stuff that matters.
Re:Eclipse launches new language to cut down Java boilerplat... by skrebbel on Saturday November 05, 2011 @04:05AM (#3199252)
Java's anonymous inner classes basically work like closures, except that they require that you mark some variables as final and that you have to write a lot of boilerplate. My underbelly feeling is that xtend's closures merely compile to those.

Often, such closures are enough. E.g. with Google Guava's predicates and filter/map methods, you can do with Java (guava + anonymous inner classes) what LINQ enables in C# (System.Linq + lambda expressions). The Java version has a lot more line noise than the C# version, however, which is what Xtend fixes.

I love it.

Re:Eclipse launches new language to cut down Java boilerplat... by buff-a on Saturday November 05, 2011 @05:26AM (#3199357)
And C++ classes merely compile to C methods with mangled names that also take a pointer to a C struct, the first member of which is a pointer to an array of such functions, and whose remaining members are the fields.

If you (or GP) are going to argue that C++ is no more productive than C simply because cfront turns C++ into C, then I think theory has gotten in the way of reality.

Re:Eclipse launches new language to cut down Java boilerplat... by scott_s on Saturday November 05, 2011 @08:14PM (#3201346)
I think the key difference is if the language feature automates a kind of abstraction that was manual in the other language. For example, one can write object-oriented programs in C, but you have to do it all yourself. And C++ programs can, as you pointed out, be translated to equivalent C programs. But classes and objects in C++ are language level abstractions that don't exist in C. In that regard, I agree with you: if you want to do OO programming, one can be more productive in C++ than C.

I have read much detail about Extend, but to me, the key question becomes: does it have language level abstractions that Java does not? I think closures and anonymous functions qualify, but I don't know if they're enough to make that much of a difference.

But what I've seen of Extend, with the exception of closures and anonymous functions, it doesn't actually have any new abstractions. It just cleans up the syntax.

Re:Eclipse launches new language to cut down Java boilerplat... by buff-a on Sunday November 06, 2011 @01:59AM (#3202074)
It doesn't have any new abstractions except for those two really useful ones. Oh, ok, but it other than those it doesn't have any new ones. =)
Re:Eclipse launches new language to cut down Java boilerplat... by skrebbel on Saturday November 05, 2011 @01:02PM (#3200215)
Eh. I was arguing the direct opposite. I have the feeling that you're just looking to pick a fight.