News for hackers. Stuff that matters.
Re:Kotlin becomes second most popular language on the JVM by BossingAround on Thursday February 06, 2020 @02:07AM (#22254068)
There's also the question of long-term sustainability. Groovy was very cool and popular in 2010. Ten years later, Groovy is still in the production codebase while the language is essentially dead.

I personally wouldn't go for anything but Java (on JVM, that is) for anything that isn't a pet project.

Re:Kotlin becomes second most popular language on the JVM by fgonzag on Thursday February 06, 2020 @03:28AM (#22254445)
Kotlin is officially supported by Android which is huge, and the fact that IntelliJ dog foods their own product into their most important product also gives a degree of security about its future.

Another huge advantage Kotlin has over Scala is tooling, which is basically all thanks to an IDE company creating the language. Tooling will never fall behind because they are in the business of selling tools.

Re:Kotlin becomes second most popular language on the JVM by scarface74 on Thursday February 06, 2020 @09:17AM (#22256075)
Yes because Google is known for its long term commitment to initiatives.

As far as JetBrains, I am big fan, I have a license for R# that I gladly pay for, but JetBrains is just one company whose core set of products are rapidly being encroached upon by free alternatives.

Re:Kotlin becomes second most popular language on the JVM by blattimwind on Thursday February 06, 2020 @09:20AM (#22256100)
I see lots of shiny new free editors, but IDEs, especially with deep semantic models and refactorings, are a rare breed.
Re:Kotlin becomes second most popular language on the JVM by Scarbutt on Thursday February 06, 2020 @10:34AM (#22256742)
Outside of Java, jetbrains doesn't have much or anything to offer against vscode, hence the GP's comment.

Jetbrains is even lagging behind, look at vscode remote capabilities which is way ahead jetbrains remote features.

Re:Kotlin becomes second most popular language on the JVM by gbersac on Thursday February 06, 2020 @10:46AM (#22256851)
For scala, Jetbrain IDE is far better than VsCode + langage server protocol
Re:Kotlin becomes second most popular language on the JVM by pjmlp on Friday February 07, 2020 @03:16AM (#22264099)
For the time being...
Re:Kotlin becomes second most popular language on the JVM by pjmlp on Thursday February 06, 2020 @01:12PM (#22258520)
Eclipse, Netbeans, Visual Studio, QtCreator look quite nice to me.

Best of all, I can use Java in any Java IDE.

Re:Kotlin becomes second most popular language on the JVM by dajohnson89 on Thursday February 06, 2020 @01:40PM (#22258853)
having used the first three extensively , i’d say intellij is miles beyond them.
Re:Kotlin becomes second most popular language on the JVM by pjmlp on Thursday February 06, 2020 @04:49PM (#22260744)
Indeed it wins hands down making my laptop sound like an aeroplane getting ready for takeoff with its continuous indexing, while making generous use of the existing memory.

Needs additional configuration for what the others do out of the box, like Javadoc tooltips.

Requires ten finger shortcuts.

It is also the only Java IDE unable to do mixed language debugging, Java/C/C++.

Re:Kotlin becomes second most popular language on the JVM by int_19h on Thursday February 06, 2020 @11:05PM (#22263132)
> JetBrains is just one company whose core set of products are rapidly being encroached upon by free alternatives

This has been true for almost two decades now - Eclipse first shipped in 2001, and it competes directly against IntelliJ, which was JetBrains' main product at the time.

And yet, they're still around.

Re:Kotlin becomes second most popular language on the JVM by Nullabillity on Thursday February 06, 2020 @09:16AM (#22256063)
> Another huge advantage Kotlin has over Scala is tooling, which is basically all thanks to an IDE company creating the language. Tooling will never fall behind because they are in the business of selling tools.

Not sure I'd agree with this. Kotlin's ties to JetBrains means that you're basically hosed if you don't use IntelliJ. Scala's tooling works pretty much everywhere (LSP/Metals, ENSIME, IntelliJ, Eclipse/Scala-IDE).

Re:Kotlin becomes second most popular language on the JVM by The_Colonel on Thursday February 06, 2020 @09:54AM (#22256381)
> Scala's tooling works pretty much everywhere (LSP/Metals, ENSIME, IntelliJ, Eclipse/Scala-IDE).

Scala's tooling also pretty much sucks everywhere (interestingly the least sucking IDE for Scala is guess what ... Intellij!)

Re:Kotlin becomes second most popular language on the JVM by lmm on Thursday February 06, 2020 @07:58PM (#22262186)
In my experience IntelliJ is a bad Scala IDE. While it has lots of cool advanced features, none of them make up for not being able to compile the basic language accurately: what good is an IDE where I can't 100% rely on getting a red underline for invalid code and no red underlines for valid code?

The parts where IntelliJ has always fallen down on Scala seem to be precisely the parts that are missing from Kotlin. I can't help feeling that the JetBrains team just "doesn't get" higher-kinded types at all. Which is a shame, because there is a lot of good stuff in Kotlin otherwise.

Re:Kotlin becomes second most popular language on the JVM by pjmlp on Friday February 07, 2020 @03:17AM (#22264107)
And naturally now they have a vested interest that Kotlin experience just feels better than Scala anyway.
Re:Kotlin becomes second most popular language on the JVM by mbo on Thursday February 06, 2020 @07:15PM (#22261893)
It's improved in the last year or so. It's not perfect by any stretch of the imagination but I find that it's one of the better supported languages out there, second to of course Java/Kotlin/TypeScript/C#.
Re:Kotlin becomes second most popular language on the JVM by Nullabillity on Thursday February 06, 2020 @12:25PM (#22258050)
> Scala's tooling also pretty much sucks everywhere (interestingly the least sucking IDE for Scala is guess what ... Intellij!)

In your opinion.

Personally I almost get depressed when I have to switch from Emacs+Metals to Android Studio for Kotlin stuff.

Re:Kotlin becomes second most popular language on the JVM by giggles_giggles on Thursday February 06, 2020 @09:24AM (#22256131)
ENSIME was abandoned several years ago because the maintainer felt bullied[1] and LSP/Metals has a ways to go.

[1] https://medium.com/@fommil/hide-your-real-name-in-open-sourc...

Re:Kotlin becomes second most popular language on the JVM by paulddraper on Thursday February 06, 2020 @09:10AM (#22256018)
As long as nothing bad ever happens to JetBrains.

(You could say the same thing about Sun/Oracle...risks all around.)

Re:Kotlin becomes second most popular language on the JVM by cies on Thursday February 06, 2020 @04:01AM (#22254608)
> Dead

It's being maintained. A new version (3 iirc) is about to come out. But it's not a hot bed of innovation.

I think Kotlin now already has a lot more mindshare and corporate interest behind it than Groovy ever did.

Re:Kotlin becomes second most popular language on the JVM by pjmlp on Thursday February 06, 2020 @07:04AM (#22255401)
Groovy had first class support on Spring and Sun was doing talks at JSFDays on how it would become the JEE scripting language.

Those of us that are part of the Java world since the early days, have been through this multiple times.

Re:Kotlin becomes second most popular language on the JVM by imtringued on Thursday February 06, 2020 @10:09AM (#22256488)
Grails is 13 years at this point and still the only way to take advantage of the JEE Java ecosystem while also leaving your sanity intact. Since Grails 4 it is slowly moving away from Spring to Micronaut so the JEE ecosystem may die before Grails does.
Re:Kotlin becomes second most popular language on the JVM by pjmlp on Thursday February 06, 2020 @11:44AM (#22257550)
That is irrelevant for Java as platform and programming language, just libraries that come and go, Java stays.

Just like C on UNIX, JavaScript on the browser, ....

Re:Kotlin becomes second most popular language on the JVM by zmmmmm on Friday February 07, 2020 @05:20PM (#22271732)
> Those of us that are part of the Java world since the early days, have been through this multiple times.

The hype curve is definitely in the past, but Groovy is living on quite well as a small but viable option in the plateau of productivity. In some ways that is more important because while in the hype phase it is really hard to judge the true value of a technology. The true value emerges when the hype is over.

The problem is, there isn't really a better scripting option for the JVM. While in theory lots of JVM languages (JRuby, Jython ... etc) could fill that gap, they all have ugly impedance mismatches which Groovy doesn't, so companies continue to deploy it as a scripting and DSL implementation still. I tried to substitute Kotlin for a bit and went back to Groovy because Kotlin still lacks standard scripting constructs such map and list literals etc.

Re:Kotlin becomes second most popular language on the JVM by The_Colonel on Thursday February 06, 2020 @09:59AM (#22256412)
> Those of us that are part of the Java world since the early days, have been through this multiple times.

Right, history repeats itself all the time ... until it doesn't. 10 years ago is not now, Kotlin is not Groovy ...

Re:Kotlin becomes second most popular language on the JVM by pjmlp on Thursday February 06, 2020 @11:42AM (#22257525)
Indeed, Groovy did not had an OS to sell it alongside.
Re:Kotlin becomes second most popular language on the JVM by dajohnson89 on Thursday February 06, 2020 @01:42PM (#22258881)
don’t forget gradle and jenkins
Re:Kotlin becomes second most popular language on the JVM by BossingAround on Thursday February 06, 2020 @03:50PM (#22260140)
Gradle is moving to Kotlin. I would be surprised if Jenkins wouldn't follow to move away from Groovy.
Re:Kotlin becomes second most popular language on the JVM by msclrhd on Thursday February 06, 2020 @02:49AM (#22254273)
Note that with Kotlin, JetBrains created it initially for working on their IntelliJ IDE and are porting their Java codebase to use Kotlin. So that is a good indicator of long-term sustainability.
Re:Kotlin becomes second most popular language on the JVM by pjmlp on Thursday February 06, 2020 @03:11AM (#22254369)
Nowadays there are trying to just get Kotlin anywhere and it remains to be seen how Valhalla and Panama will be usable from Kotlin.
Re:Kotlin becomes second most popular language on the JVM by thu2111 on Thursday February 06, 2020 @03:48AM (#22254531)
Panama would not seem to pose any problems as it's all code generation with MethodHandles/VarHandles. That should be directly callable from Kotlin.

As for Valhalla, it remains to be seen how it's usable from Java, let alone anything else. But Kotlin already has a form of value type (inline classes) so perhaps it'll be an extension of that.

Re:Kotlin becomes second most popular language on the JVM by pjmlp on Thursday February 06, 2020 @04:55AM (#22254816)
Kotlin inline classes are heap allocated, they are just syntax sugar for regular classes.

One cannot just change their semantics after the fact.

Re:Kotlin becomes second most popular language on the JVM by Nullabillity on Thursday February 06, 2020 @09:19AM (#22256090)
Kotlin's inline classes (and Scala's AnyVal classes) are syntax sugar for static methods. The object itself is erased completely whenever possible (just like primitive values).
Re:Kotlin becomes second most popular language on the JVM by pjmlp on Thursday February 06, 2020 @12:03PM (#22257797)
Which is not the same as the semantic meaning of doing stack allocations or being stored in registers.
Re:Kotlin becomes second most popular language on the JVM by Nullabillity on Thursday February 06, 2020 @12:51PM (#22258318)
The following:

    case class Foo(x: Int) extends AnyVal {
        def square: Int = x * x
    }
    val bar: Foo = Foo(5)
    println(bar.square) // => 25
Compiles down to (the moral equivalent of)

    object Foo {
        def square(x: Int): Int = x * x
    }
    val bar: Int = 5
    println(Foo.square(bar)) // => 25
If the inner value (x, in this case) can be stack-allocated or stored in registers then `Foo(x): Foo` will as well. `Foo(x): Bar` (where Bar is a supertype of Foo) will be autoboxed, but that also applies to primitive types (`5: Any` becomes a java.lang.Integer in memory).
Re:Kotlin becomes second most popular language on the JVM by pjmlp on Thursday February 06, 2020 @01:02PM (#22258421)
Neither of those represent the same semantics of:

    inline class { ... ]
Which is guaranteed to be always stack-allocated or stored in registers, again you cannot retrofit semantics, specially when passing those classes to binary libraries.
Re:Kotlin becomes second most popular language on the JVM by Nullabillity on Thursday February 06, 2020 @01:29PM (#22258722)
You're correct that the Scala version isn't ABI-compatible. But Scala doesn't care about ABI between minor releases anyway, so that probably wouldn't stop them from changing it to align with Java.

There is also precedence for this, Scala 2.12 changed the encoding of lambdas from anonymous classes to Java 8's invokedynamic.

Re:Kotlin becomes second most popular language on the JVM by zmmmmm on Friday February 07, 2020 @02:57PM (#22270189)
That cuts both ways though. If JetBrains goes away or something shifts their corporate interest away from that then Kotlin has zero support at all. Whereas other languages are built on grass roots foundations. It's certainly unlikely in the short term but it's hard to say long term about the future of any company.
Re:Kotlin becomes second most popular language on the JVM by moron4hire on Thursday February 06, 2020 @03:07AM (#22254352)
Yeah, it's not like it's a Google project. You can probably expect JetBrains to support Kotlin going long into the future.
Re:Kotlin becomes second most popular language on the JVM by bitL on Thursday February 06, 2020 @03:37AM (#22254492)
SUN was supposed to be here forever as well...
Re:Kotlin becomes second most popular language on the JVM by humbleMouse on Thursday February 06, 2020 @10:24AM (#22256632)
I still love groovy, it doesn’t need to evolve that much to be useful for the things it’s good at, like parsing unstructured data and making boilerplate free pojos.
Re:Kotlin becomes second most popular language on the JVM by The_rationalist on Thursday February 06, 2020 @02:49AM (#22254275)
This time this is the official android language and there is jetbrains behind it.