News for hackers. Stuff that matters.
Re:Scala 2.12 roadmap by lmm on Saturday February 13, 2016 @03:18AM (#11093210)
I'm tired of the Kotlin hype (particularly with it unreleased, and so rarely used in production). Many of its features are already part of modern Java, and its language features are very ad-hoc. I can easily see a future for Scala (it offers more radical improvements that Java will never adopt), and maybe see a future for Ceylon (it's a very clean design and the union types are a genuine innovation). I can't see one for Kotlin.
Re:Scala 2.12 roadmap by incepted on Saturday February 13, 2016 @10:18AM (#11094228)
> I'm tired of the Kotlin hype (particularly with it unreleased, and so rarely used in production)

You call it hype, I call it enthusiasm.

But regardless of the names we use , what I find very interesting is that Kotlin is generating such positive feelings even though it's not even 1.0. I haven't seen this happen for languages in a while (probably "ever"). What's also striking is that most of what I read about Kotlin is positive, and again, languages hardly ever generate positive feelings so widely across the board.

Re:Scala 2.12 roadmap by lmm on Saturday February 13, 2016 @12:59PM (#11094912)
Do you not remember when Java itself came out?

The positive feelings ring very false to me. Kotlin has announced a lot of features long before they were delivered, and taken a lot longer to deliver a working language than they originally claimed. It's the old "two types of languages" - most languages sound good when you talk about their features, it's only when you actually use them that the negatives become apparent.

I don't know anyone who's actually used both Kotlin and Ceylon and prefers Kotlin, and Ceylon is actually more mature (1.2 released recently, IIRC). But since King only advertises features that are actually implemented and release dates he can actually make, there's a lot more hype for Kotlin.

Re:Scala 2.12 roadmap by aembleton on Saturday February 13, 2016 @05:24AM (#11093450)
Many features are part of Java, but they are much more succinct. For example, if I've got a List of Integers and I want to add 5 to each one, then in Java I'd have to do something like:

`List<Int> myNewList = myList.stream().map(i -> i +5).collect(Collectors.toList());`

In Kotlin:

`val myNewList = myList.map(it+5)`

Can you see how that can be clearer and simpler to read? Technically it is doing the same thing, but it is much simpler to reason with. On top of that, you've got improved null safety, monkey patching and type inference.

Re:Scala 2.12 roadmap by lmm on Saturday February 13, 2016 @05:37AM (#11093471)
Is "it" some kind of magic value? So much for Kotlin being simpler / more readable than Scala. At least _ looks like syntax.

That comparison looks misleading - the .stream() and .collect() are conversions, not necessary on every call by any means.

Kotlin's approach to null safety is ad-hoc and integrated into the language in a way that makes it hard to abstract over. I think it will lead to inconsistent code as the JVM ecosystem moves on to make more use of Option-like alternatives.

Monkey patching is pure evil in any large codebase.

I think Java will likely add more and more type inference in future releases.

Don't get me wrong, syntax and sugar are important. But a language that only offers those is probably not worth the overhead, and such things are relatively easy for the "parent" language to adopt.

Re:Scala 2.12 roadmap by incepted on Saturday February 13, 2016 @10:23AM (#11094245)
"it" is a magic value that was introduced in Groovy, so a lot of people are familiar with it. You got used to "this" being a magic value, "it" is a pretty easy concept to grasp.

Besides, it's not any more magical than "_" (which has, what... eleven different meanings? [1]) and it's super convenient. Still, don't like it? Just explicitly name your closure parameter. But you'll be surprised how you will quickly stop doing that for trivial closure uses because finding names is such a pain.

You're right that Java 8 has been closing the gap, though, but note that Java 9 doesn't have any new language features that will close that gap further.

[1] http://stackoverflow.com/a/8001065/162410

Re:Scala 2.12 roadmap by lmm on Saturday February 13, 2016 @01:05PM (#11094938)
> You got used to "this" being a magic value, "it" is a pretty easy concept to grasp.

FWIW I avoid "this" as much as possible. I prefer a named self, which Scala has a nice concise syntax for.

> Besides, it's not any more magical than "_"

Like I said, "_" looks like syntax. "it" looks like an ordinary value.

> which has, what... eleven different meanings? [1]

Sort of, but it's always obvious from context. I have literally never been confused by an occurrence of "_" in 3+ years of full-time Scala programming.

Re:Scala 2.12 roadmap by vorg on Sunday February 14, 2016 @10:57PM (#11101437)
> ... was introduced in Groovy, so a lot of people are familiar with it

You're assuming here that a lot of people have used Groovy. People generally don't even use "it" in Gradle, the most common access people have to Groovy.

Re:Scala 2.12 roadmap by EdwardDiego on Saturday February 13, 2016 @04:25AM (#11093357)
> I can't see one for Kotlin.

You can't see a future for a language that offers far more succinct code than Java, but maintains the ease of Java?

Re:Scala 2.12 roadmap by lmm on Saturday February 13, 2016 @05:19AM (#11093438)
I think Java will close the succinctness gap with Kotlin. And I don't think Kotlin will be able to maintain ease as it evolves, because the design is very ad-hoc.
Re:Scala 2.12 roadmap by incepted on Saturday February 13, 2016 @10:28AM (#11094271)
I don't see any syntactic features in Java 9 that will close that gap further, but I guess we'll see.