News for hackers. Stuff that matters.
Re:Scala 2.12 roadmap by incepted on Saturday February 13, 2016 @01:38AM (#11092908)
Scala was nice when it was the only alternative to Java but Kotlin has been slowly gaining some pretty solid momentum as a candidate for Java's replacement.
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.
Re:Scala 2.12 roadmap by eklavya on Saturday February 13, 2016 @01:45AM (#11092929)
Assuming it's really gaining momentum over Scala I won't understand why. What Kotlin has over Scala? Compile times? After coding for 1 hour I compile once to check if Intellij and I missed something. Are those 3-4 minutes too much time?
Re:Scala 2.12 roadmap by reality_czech on Saturday February 13, 2016 @02:16AM (#11093039)
Well, that's the thing. If you have a small amount of code, the compile times are never a problem. Try compiling something like Apache Spark. It will be somewhere between 30-60 minutes depending on your disk speed, CPUs, etc. etc. The incremental builds are faster, but never less than 2 or 3 minutes for any change. You could potentially avoid this with the REPL, or use inotify to trigger a background compilation, but none of those really works all the time.
Re:Scala 2.12 roadmap by eklavya on Saturday February 13, 2016 @03:07AM (#11093196)
And yet it was written in Scala. That shows how little the compile times offset the goodies of using Scala.
Re:Scala 2.12 roadmap by reality_czech on Thursday February 25, 2016 @10:39PM (#11179668)
At the time Spark was started, Java didn't have lambdas or closures, making the equivalent Java code for functional-programming-style ML code much more verbose. Whether the same decision would be made today is an open question (and probably depends on who you ask). A lot of other frameworks have made different decisions, such as keeping the core of the project in Java and supporting other languages as shims on top (in my opinion a more sensible decision...)
Re:Scala 2.12 roadmap by incepted on Saturday February 13, 2016 @02:50AM (#11093151)
To me, the benefit is what Kotlin has less than Scala.

It's an incremental improvement over Java and it fixes exactly all the complaints I have over Java and nothing more.

Also, its IDE support is just as good as Java.

But the language is not even out officially, let's see in five years how it fares. Right now, it's just a breath of fresh air over Java.

Re:Scala 2.12 roadmap by airplane on Saturday February 13, 2016 @02:35AM (#11093100)
From what I observed it's close enough to Java that people can easily switch and are willing to. There's also enough brevity with the language to be at ease with it daily (not as much as Scala) where it may be enough that perhaps people might not want to invest time to go all the way to Scala.
Re:Scala 2.12 roadmap by lmm on Saturday February 13, 2016 @01:17PM (#11094987)
One of the things I love about Scala is that you don't have to "go all the way" though - you can start by writing Java-like code using Java libraries, and move on to writing Kotlin-like code as and when you want to, and move on to more advanced features than that as and when you want to.
Re:Scala 2.12 roadmap by incepted on Saturday February 13, 2016 @01:31PM (#11095058)
> One of the things I love about Scala is that you don't have to "go all the way" though

This is true of any language so it doesn't mean much.

Still, we went through the same thing with C++ 20 years ago. Google even used to have (still does?) a style guide saying which features to use and which ones not to use.

Instead of having to use a guide that tells me which features of a language are dangerous, I prefer a language that doesn't require such a guide in the first place.

Re:Scala 2.12 roadmap by lmm on Saturday February 13, 2016 @01:58PM (#11095180)
Unfortunately it's impossible to combine that with seamless Java interoperability, because so many Java features are dangerous (null, exceptions, pervasive mutability, all of the methods on Object, finalizers, low-level thread manipulation) or at least cumbersome (use-site variance and the resulting existential types, control flow constructs built into the language syntax).

I don't think there are any dangerous things you can do in Scala that you can't do in Kotlin. Only safe alternatives that exist in Scala but not in Kotlin.

Re:Scala 2.12 roadmap by pjmlp on Sunday February 14, 2016 @02:43AM (#11097517)
> Google even used to have (still does?) a style guide saying which features to use and which ones not to use.

Which is a good example on how not to write modern C++, given the things they don't allow to use and not loved that much in the C++ community.

Re:Scala 2.12 roadmap by pjmlp on Saturday February 13, 2016 @02:10AM (#11093005)
Right now, I would say the only thing it has is momentum on Android, given JetBrains relation to Studio.

Using Scala on Android requires a bit more tinkering with ProGuard than Kotlin does, and it isn't a focus of the Scala designers.

Also with Scala 2.12 going Java 8, one will be stuck with 2.11 for Android.

Re:Scala 2.12 roadmap by lmm on Saturday February 13, 2016 @01:16PM (#11094984)
2.12 doesn't include any (non-gated) changes though, so you can keep the same codebase and cross-build for 2.12 (for performance) and 2.11. So we're talking what, at least 3 years ("Aida", either 2.13 or 3.0) before Java 8 becomes a blocker for source-level features, at which point I imagine Android will have an answer.
Re:Scala 2.12 roadmap by pjmlp on Sunday February 14, 2016 @02:41AM (#11097509)
I doubt Google team will change, given their attitude regarding Java 8, as demonstrated at both Google IO 2014 and 2015.

Also the way they are cherry picking features from OpenJDK 7 and some kind of lambda support.

For me, Android Java has become similar to Symbian C++ in terms of dev experience and language fork.

Re:Scala 2.12 roadmap by merb on Saturday February 13, 2016 @04:00AM (#11093311)
No Android will switch to newer OpenJDK so Scala 2.12 would be a valid target.
Re:Scala 2.12 roadmap by pjmlp on Saturday February 13, 2016 @05:38AM (#11093475)
Spend some time reading the Android source code.

According to Jake Warton, they only cherry picked some parts of OpenJDK 7.

From the commits they also don't appear to ever fully support Java 8, only lambdas.

Re:Scala 2.12 roadmap by merb on Saturday February 13, 2016 @08:09AM (#11093800)
ever is a strong word. I know that at the moment they use some parts of OpenJDK 7, but If they need to comply the Java (tm) caused by licensing, they will be forced (sooner or later) to actually don't use a deprecated JVM. As I know OpenJDK will be depracted on 2024. so it will take some time, but it will come.
Re:Scala 2.12 roadmap by pjmlp on Saturday February 13, 2016 @08:14AM (#11093815)
Given the rumors of ChromeOS and Android becoming one OS, by 2024 it will hardly matter.
Re:Scala 2.12 roadmap by ninjakeyboard on Saturday February 13, 2016 @09:36AM (#11094048)
It's worth noting that typesafe are prioritizing reducing compile time but it's a 32 pass compiler (!)

We're working on gigantic production systems currently and with good modularization compile times are not a problem for us.

Re:Scala 2.12 roadmap by pjmlp on Saturday February 13, 2016 @02:04AM (#11092986)
Here in Germany I am yet to see any job posting about it.

It is all about Java, Scala and Clojure.

Re:Scala 2.12 roadmap by airplane on Saturday February 13, 2016 @02:27AM (#11093074)
Well Kotlin isn't even officially released yet (1.0 candidate came out last week) so no company is probably using it for production yet.
Re:Scala 2.12 roadmap by incepted on Saturday February 13, 2016 @02:53AM (#11093159)
And even after that, it wouldn't be reasonable for any big company to adopt a language that's not at least at version 1.1 or 1.2.

I don't think one can make any pronouncement about Kotlin's success or failures for several years.

Re:Scala 2.12 roadmap by hannes2000 on Saturday February 13, 2016 @04:43AM (#11093382)
I wouldn't be so sure. A bunch of Android developers are severely hurt from being stuck with Java 7. I'd expect many production apps to be written in Kotlin pretty soon, about as fast as the switch from Objective-C to Swift went.
Re:Scala 2.12 roadmap by pjmlp on Saturday February 13, 2016 @05:41AM (#11093480)
Scala is also an option and currently looks better on the cv.

This will of course improve for Kotlin, specially if they get some Google blessing.

EDIT: Also forgot to mention that on Swift's case, it is a first class language being pushed by the platform's owner, not a 2nd class language without any kind of consideration from the platform SDK.

Re:Scala 2.12 roadmap by EdwardDiego on Saturday February 13, 2016 @04:28AM (#11093360)
It's a trivial conversion from Java to Kotlin, as opposed to Scala or Clojure, so I wouldn't expect people to be hiring explicitly for it.

And the fact that 1.0 RC was just released this month might tell you other reasons why. How many Scala jobs did you see advertised when 1.0 was released in 2004?

Re:Scala 2.12 roadmap by lmm on Saturday February 13, 2016 @05:27AM (#11093456)
I wouldn't've described Scala as "gaining momentum" in 2004 either. Kotlin may eventually be successful (I don't think it should be; IMO Ceylon does everything that Kotlin does and does it better, but that's just, like, my opinion man), but the present hype is certainly premature.
Re:Scala 2.12 roadmap by EdwardDiego on Sunday February 14, 2016 @11:56PM (#11101597)
I agree - Kotlin is gaining momentum in hype. Give it a couple of years and we'll see how it actually moves. Ceylon does not do Java interop as well as Kotlin does, IMO.