Live data from Hacker News

Eclipse launches new language to cut down Java boilerplate - Extend

eclipse.org

141–150 of 229 posts

Re: Eclipse launches new language to cut down Java boilerplate - Extend

#141
post #139
post #137

Earlier quoted context omitted.

You misunderstand what a local syntax transformation is. A syntax transformation is just a function that takes syntax as input and returns syntax as output. The function can be arbitrarily complex, even "inferring" things from the input syntax. The key point is whether the transform is local or global. An example of a global transform is turning a program into continuation-passing style because it must change every f…

The referenced paper is way over my head, so I'll just say where I'm having difficulty and perhaps you can help me out. Java doesn't have closures. Xtend does. Closures seem to me to satisfy the paper's definition of providing greater expressibility. Certainly, I've done a lot of C# and Java, and having closures in C# has greatly influenced how I write code. And yet closures appear to be what you claim is a local syn…

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 boilerplate - Extend

#142
post #108

I'm pretty disappointed in the discussion that has gone here. There's been so much argument over things that don't matter much in the end, like whether or not optional semicolons and parenthesis are a good thing. These things are so superficial! It makes me believe that few people appreciate what actually makes a language good or bad. The fact that Xtend can be easily translated to Java source code is a big sign that…

> The fact that Xtend can be easily translated to Java source code is a big sign that it probably won't have any dramatic impact on your productivity.

It appears to be common Hackernewserthink that "productivity" equals "the ability to write code as fast as possible". Beyond the first few weeks of coding, you'll spend much more time reading code and refactoring it.

What Xtend offers is an object model and type system that anyone with Java experience can understand right away, but with significantly more readability. This means better maintainability, which means a significant productivity increase once you're past the "hack away, guys!" stadium.

Coffeescript has exactly the same major advantage over JavaScript. The point is that because CoffeeScript/Xtend so closely mimic their target language, there are no leaky abstractions, so no thinking-in-two-worlds headaches. Yet, the code becomes significantly more readable, which matters.

These developments really are major. There's a reason so many more people use CoffeeScript than, say, ClojureScript or GWT. The only reason why the same wouldn't happen with Xtend in the Java world is non-technical: too many Java shops are conservative and afraid of change, even change as low-barrier as Xtend.

They should've called it "Coffee", though.

Re: Eclipse launches new language to cut down Java boilerplate - Extend

#143
post #139
post #137

Earlier quoted context omitted.

You misunderstand what a local syntax transformation is. A syntax transformation is just a function that takes syntax as input and returns syntax as output. The function can be arbitrarily complex, even "inferring" things from the input syntax. The key point is whether the transform is local or global. An example of a global transform is turning a program into continuation-passing style because it must change every f…

The referenced paper is way over my head, so I'll just say where I'm having difficulty and perhaps you can help me out. Java doesn't have closures. Xtend does. Closures seem to me to satisfy the paper's definition of providing greater expressibility. Certainly, I've done a lot of C# and Java, and having closures in C# has greatly influenced how I write code. And yet closures appear to be what you claim is a local syn…

Closures are code+data and objects are also code+data, so adding closures to a language with an object system does not increase expressibility.

The main difference is that with closures you write the code and the data part (the environment) is captured implicitly, whereas with objects, both the code and data are explicit. This makes it possible to convert a closure into an object, and an object into a closure, without having to change the whole program.

It is a little more difficult to go from closures to objects because you have to find the free variables and make them explicit, but it still isn't a global transformation. If you want to see how to implement objects with closures, check out SICP.

Re: Eclipse launches new language to cut down Java boilerplate - Extend

#144
post #108

I'm pretty disappointed in the discussion that has gone here. There's been so much argument over things that don't matter much in the end, like whether or not optional semicolons and parenthesis are a good thing. These things are so superficial! It makes me believe that few people appreciate what actually makes a language good or bad. The fact that Xtend can be easily translated to Java source code is a big sign that…

HN is the wrong forum to discuss this. Many people here are not the target audience who don't use Java and have a preconceived dim view of it.

(I'm expecting downvotes but whatever.)

Re: Eclipse launches new language to cut down Java boilerplate - Extend

#145

This reminds me quite a bit of Groovy, just with a different compiler back end (outputting Java source instead of bytecode). However, this makes me wonder what the point is. Groovy is more-or-less source compatible with Java already (a valid Java program is also a valid Groovy program), so I'm not sure what Extend brings to the table.

I agree, I don't see a reason to switch from Groovy. I don't see the Scala or Clojure people switching, either. But even if you're just trying to convince Java developers, Groovy's ecosystem (including Grails) is hard to beat.

And actually, I'm using Groovy++ (http://code.google.com/p/groovypptest/), which addresses the concerns about static typing, inference, and performance, all for the cost of an extra jar. It's really surprising how few people - even Groovy programmers - have heard of this. I think it really ought to be included in the core language.

Re: Eclipse launches new language to cut down Java boilerplate - Extend

#146
post #139
post #137

Earlier quoted context omitted.

You misunderstand what a local syntax transformation is. A syntax transformation is just a function that takes syntax as input and returns syntax as output. The function can be arbitrarily complex, even "inferring" things from the input syntax. The key point is whether the transform is local or global. An example of a global transform is turning a program into continuation-passing style because it must change every f…

The referenced paper is way over my head, so I'll just say where I'm having difficulty and perhaps you can help me out. Java doesn't have closures. Xtend does. Closures seem to me to satisfy the paper's definition of providing greater expressibility. Certainly, I've done a lot of C# and Java, and having closures in C# has greatly influenced how I write code. And yet closures appear to be what you claim is a local syn…

[deleted]

Re: Eclipse launches new language to cut down Java boilerplate - Extend

#147
post #143
post #139

Earlier quoted context omitted.

The referenced paper is way over my head, so I'll just say where I'm having difficulty and perhaps you can help me out. Java doesn't have closures. Xtend does. Closures seem to me to satisfy the paper's definition of providing greater expressibility. Certainly, I've done a lot of C# and Java, and having closures in C# has greatly influenced how I write code. And yet closures appear to be what you claim is a local syn…

Closures are code+data and objects are also code+data, so adding closures to a language with an object system does not increase expressibility. The main difference is that with closures you write the code and the data part (the environment) is captured implicitly, whereas with objects, both the code and data are explicit. This makes it possible to convert a closure into an object, and an object into a closure, withou…

[deleted]

Re: Eclipse launches new language to cut down Java boilerplate - Extend

#148
post #139

Earlier quoted context omitted.

The referenced paper is way over my head, so I'll just say where I'm having difficulty and perhaps you can help me out. Java doesn't have closures. Xtend does. Closures seem to me to satisfy the paper's definition of providing greater expressibility. Certainly, I've done a lot of C# and Java, and having closures in C# has greatly influenced how I write code. And yet closures appear to be what you claim is a local syn…

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# (Sy…

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 boilerplate - Extend

#149
post #143
post #139

Earlier quoted context omitted.

The referenced paper is way over my head, so I'll just say where I'm having difficulty and perhaps you can help me out. Java doesn't have closures. Xtend does. Closures seem to me to satisfy the paper's definition of providing greater expressibility. Certainly, I've done a lot of C# and Java, and having closures in C# has greatly influenced how I write code. And yet closures appear to be what you claim is a local syn…

Closures are code+data and objects are also code+data, so adding closures to a language with an object system does not increase expressibility. The main difference is that with closures you write the code and the data part (the environment) is captured implicitly, whereas with objects, both the code and data are explicit. This makes it possible to convert a closure into an object, and an object into a closure, withou…

It's all code plus data. I can implement any java, C#, Xtend feature in C or assembly language, but by your argument that makes C# no more expressive then C.

If this is your argument, then it would appear that your argument is that the entire class of imperative languages are a waste of time and we should all be using lisp or scala.

Back in the real world, I find C# to be more productive than C, because I am able to express myself more succinctly. Xtend seems to do that for java. In the imperative world, your definition of expressibility is insufficient to determine increases in productivity.

Re: Eclipse launches new language to cut down Java boilerplate - Extend

#150

This reminds me quite a bit of Groovy, just with a different compiler back end (outputting Java source instead of bytecode). However, this makes me wonder what the point is. Groovy is more-or-less source compatible with Java already (a valid Java program is also a valid Groovy program), so I'm not sure what Extend brings to the table.

I agree, I don't see a reason to switch from Groovy. I don't see the Scala or Clojure people switching, either. But even if you're just trying to convince Java developers, Groovy's ecosystem (including Grails) is hard to beat. And actually, I'm using Groovy++ ( http://code.google.com/p/groovypptest/ ), which addresses the concerns about static typing, inference, and performance, all for the cost of an extra jar. It's…

>I don't see a reason to switch from Groovy

> Groovy's ecosystem (including Grails) is hard to beat

Are you part of Groovy's echo system too?

Post reply on HN