Live data from Hacker News

Eclipse launches new language to cut down Java boilerplate - Extend

eclipse.org

201–210 of 229 posts

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

#201
post #39
post #29

You know that when even Eclipse is coming out with an updated JVM/Java.next language that Java proper has some major issues.

The biggest issues are less about syntax and more about having to restart containers etc again and again. But everyone except Play! and a few others seems to be jumping the new syntax bandwagon. Being a php/python/Java developer I'm afraid I'd trade all improvements after generics for a no restart required jvm

If your biggest issue with java is about restarting containers/redeploying your app, you should check out JRebel (http://zeroturnaround.com/jrebel). It's a tool (javaagent) that will pick up changes you make to your code and introduce them in your running application. Unlike Play! it supports your application server and your framework stack.

Also it supports picking up changes in the configuration of major frameworks, like spring, for example.

Basically, with JRebel you can develop in java as you would do in python :)

disclaimer: I'm employed by the company that develops JRebel, but this fact doesn't make it any less awesome.

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

#202
post #148

Earlier quoted context omitted.

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.

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

#203

Earlier quoted context omitted.

I don't know what your beef with Scala is, but you're seriously deluded.

Your problem is that you think that Scala can overcome its perception problem. No, it can't. Scala is history and will never be anything. Look to Kotlin.

Erm, you're an idiot.

You're talking about perception problems like everyone knows there is one.

You do realize Scala is being used everywhere right? Twitter, Linked In, Meetup, foursquare, etc, etc. The list is endless.

TL:DR; your vaporware language isn't anything new or exciting. Let me know when it actually exists.

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

#204

Earlier quoted context omitted.

I can tell why I (a java programmer who slowly moves to Clojure) didn't go the Scala route. Because every time I've seen code sample comparisons, the clojure one was shorter then the java original and the scala was longer. Plus it's foreign enough from java... so if I do it, better to go all the way and make it worth it.

I'm surprised how is that even possible? You can probably translate every Java file, line-by-line into Scala. Then remove the redundant type declarations and you're already shorter. Then you can actually rewrite it to something less imperative and still shorter. Do you have any real examples of longer Scala code? I couldn't find any.

As I didn't delve into scala I can't really offer examples. But this was the impression I was left with when reading code samples 2-3 years ago. I think it was collections-related? I know it doesn't make much sense, and I do intend to revisit scala sometimes, but this is the impression me, a novelty-seeking programmer was left with when researching jvm languages.

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

#205
I'm surprised there's been no mention of Lombok (http://projectlombok.org/) since the goals seem to be the same. Lombok of course, is not a language but just a set of annotions and annotation processors to handle the code generation behind the scenes. Will have to look at this more closely to see how the two compare...

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

#206
post #116

Earlier quoted context omitted.

The evidence for this statement best comes from a research paper* that attempts to formalize language expressibility . According to their formalization, language features are classified as macro expressible if they can be implemented in terms of local syntax transformations of other language features. The paper shows that expressivity, power, and conciseness come the most from those features that are not macro expres…

"The paper shows that expressivity, power, and conciseness come the most from those features…" I do not accept your implicit claim that a language must be more expressive, powerful, or concise to be more productive. As a counter-argument for the expressive claim, consider a language that required one to prefix each line with the number of non-blank characters it contains. I am fairly sure I would be more productive u…

There are no real Turing-complete languages, as Turing-completeness requires infinite hardware. And certainly there are degrees of incompleteness, expressed by which programs run out of memory faster.

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

#207
post #116

Earlier quoted context omitted.

The evidence for this statement best comes from a research paper* that attempts to formalize language expressibility . According to their formalization, language features are classified as macro expressible if they can be implemented in terms of local syntax transformations of other language features. The paper shows that expressivity, power, and conciseness come the most from those features that are not macro expres…

First, the fact that this language is coming from the Eclipse team suggests to me that they are probably not limited to macro transformations, at least at a fundamental level. The main reason Java folks like Eclipse is that it has a global understanding of Java code (this is why plugins for text editors tend to flat out suck compared to real Java IDEs, they are mostly dealing with local information), and I'd imagine…

The single thing I would say Java is missing, from the perspective of a beginner, is the ability to change code while running it. Eval and Exec are useful functions, and there is no way to replicate them in Java.

Lists in Java are an unholy pain that redefine cruelty in an entirely new way. You can't make a list, to the best of my knowledge, that accepts arbitrary inputs. Does the utter lack of a slice operator count for the addition of multiple lines of code to replace what is normally three or four characters?

Please, tell me how. This is an honest question. I have been learning Java since school started, and I miss my functional techniques.

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

#208
post #177
post #95

Earlier quoted context omitted.

So instead of a simple, uniform rule that () invokes a function, and no-() references the function, you add yet a third syntax? This is not an improvement, it is an unnecessary complication.

That's not the same thing. You obviously use partial application only if the function takes params. And I just can't see why you'd like to pass a reference on a parameter-less function.

Closures don't need to take parameters to be useful, but you're missing the point.

There is a simple, unambiguous rule -- () calls, no-() references. In order to... what? save two keystrokes? -- you have added a strange corner case, and then tacked on a new bit of punctuation for partial application. Though now it seems you're adding the rule that functions without parameters can't be referenced.

This takes a simple yes-or-no rule and adds edge cases for no reason. Two keystrokes on the occasional parameterless function call is not a real savings, and you've just made it harder for someone reading the code to spot all the function calls.

This fundamentally makes no sense. Why would this be a good idea?

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

#209
post #184

Earlier quoted context omitted.

> 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…

> 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. And even more time thinking . This is one of the reasons I never understood the obsession many people have with vim/emacs/whatever shortcuts and the like, for me they are distractions from what is real…

These things are a form of "premature optimization," which I think anyone can be misguided into, but which younger/less experienced programmers are particularly prone to, because they naturally tend to have uneven skill development, so they'll try to build from strengths before branching out.

Premature optimization of typing = complex text editor

Premature optimization of debugging = excessive unit tests or formalism

Premature optimization of product = coding features without feedback

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

#210
post #148

Earlier quoted context omitted.

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.

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:…

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. =)
Post reply on HN