Live data from Hacker News

Eclipse launches new language to cut down Java boilerplate - Extend

eclipse.org

101–110 of 229 posts

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

#101

I don't know, but, often get irriated by the usage of "closures" when it means "anonymous function/expression". > The term closure is often mistakenly used to mean anonymous function. This is probably because most languages implementing anonymous functions allow them to form closures and programmers are usually introduced to both concepts at the same time. An anonymous function can be seen as a function literal, whil…

You don't have to assume that they actually mean anonymous functions. There's no real reason why the Xtend compiler couldn't translate closures to Java objects.

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

#102

Very cool. One nitpick (unless the video glossed over the details) is that the double arrows in the video for "personToGreet" looks weird because it's not a basic key on the keyboard.

No problem, when you hit Ctrl+Space on the Eclipse editor it completes with a pair (opening and closing) these "chevrons"

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

#104
post #93

Earlier quoted context omitted.

Ruby does not get rid of semicolons or brackets. Heck, you can write Java/C++ style curly brace code in Ruby if you wanted.

Of course, if you did write Java/C++ style curly brace code in Ruby, those of us who like Ruby would bring out the pitchforks.

At least then vim would understand it and you wouldn't have to deindent every 'end' yourself. It would be nice to be able to use % and some other stuff that you get with most other languages.

The fact is that the visual style of a language is trivial to get used to. Breaking my text editor is a real issue though.

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

#106
post #56

Granted Im not the target market, but Implicit returns do not seem like a good idea.

Yeah, is there precedent for that? It looks fucking nutty. Can you do it in the middle of the function!? So odd. There's a lot of cruft in java, but I'm not sure the return statement is even on the list of things I'd bother attacking.

As far as a precedent, lisp does it that way, and it may be older than the existence of the return statement. Any language that lacks statements usually does it this way.

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

#107
post #37

Earlier quoted context omitted.

Optional parenthesis if no argument is given was already a feature of at least pascal in the seventies. All those new "cool and innovative" languages are just rediscovering it after almost a decade of everything with C syntax. Not that it's bad or anything, it's just my OCD tingling.

IMHO, it's less readable, and more ambiguous. Is it a variable or a function? Who knows!

This is actually half of the value of it. It allows you to easily change the implementation without breaking the public semantics. Generally speaking, the first-pass practice in Scala is to use public fields and to make them vals (final/C# readonly). Where you need to provide mutability, you use a var. But due to C#-esque properties, you can go from

  var x = 1
to (not great code, but illustrative of the point)

  private var _x: Int = 1
  def x: Int =  _x
  def x_= (value: Int) = {
      if (value > 1337)
          throw new ArgumentOutOfRangeException() 
 
      _x = value
  }
The convention is to use empty parents after zero-argument functions that have side effects, much like the ! in Scheme.

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

#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 it probably won't have any dramatic impact on your productivity. I think the comparison that has been made between Xtend and Coffeescript is most accurate. Xtend will likely be more pleasant to work in than Java, but it won't be a game changer in terms of what you can accomplish with it. Still many people are happy with Coffeescript, and if Xtend does thing right many people might be happy with it as well.

And, I'm pretty sure David Pollak is the only Scala evangelist who is worried Scala won't or shouldn't overtake Java. Everyone else seems to be committed to making Scala a better and better out-of-the-box experience, and there continues to be initiatives and commercial investment in improving things like IDE support, documentation, coding standards, training opportunities, and more.

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

#109

Earlier quoted context omitted.

You still have a dot in there! greetABunchOfPeople List people people do _ sayHello println

You left a type in there! greetABunchOfPeople people people do _ sayHello println

While we're at it, let's switch to haskell (delete the unnecessary people argument):

  greetABunchOfPeople = mapM_ (putStrLn . sayHello)
Explanation:

mapM_ is a function that takes two arguments.

  mapM_ lambda list
It calls lambda on each element on list.

In the greetABunchOfPeople definition, notice we only gave mapM_ 1 argument instead of 2. That means greetABunchOfPeople would have to take an extra argument for the call to execute.

  greetABunchOfPeople $MISSING$ = mapM_ (putStrLn . sayHello) $MISSING$

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

#110
post #5

Oh, it looks like Xtend is to Java as Coffeescript is to Javascript. Although I'm sceptical about it compiling to Java source. Java seems to be going through a period of experimentation, and alternative Java-like and JVM languages. Interesting times.

It is also great for using with Android/GWT. Scala can be both used with Android[1] and GWT[2], but it is not a walk in the park. It seems like a great gateway drug for Scala. [1] https://github.com/danielribeiro/HelloScalaOnAndroid [2] http://news.ycombinator.com/item?id=3198154

I agree. I use Scala for a personal Android app. Once you get over the antbuild and proguard hurdle - agree its no walk in the park - its smooth sailing. Scala meshes well with the android libraries and is fast. Although it gets highly wonky if you need to add a library that is not a jar but instead a package.

The major downsides which are super troublesome are that it takes 2 minutes to build each time - even for trivial changes and I have to debug the old school way with messages.

Post reply on HN