Live data from Hacker News

The Kotlin Language: 1.0 Beta Is Here

blog.jetbrains.com

1–10 of 102 posts

Re: The Kotlin Language: 1.0 Beta Is Here

#5

Looking at the syntax briefly it seems very similar to Scala. Is there any major differences between Scala and Kotlin?

I'd say the syntax is halfway in between Java and Scala. That makes it much more approachable for Java developers (you can learn the basics in an afternoon), but also less flexible than Scala sometimes.

Re: The Kotlin Language: 1.0 Beta Is Here

#6
I've used both Kotlin and Scala a bit and for some very specific message passing/protocol tricks, Scala was able to let me do what I wanted more than Kotlin. That was maybe 6-12 months ago, so I'm not sure if that has changed.

That said, there is something pretty cool about Kotlin that I like. Congrats on 1.0 Beta.

Re: The Kotlin Language: 1.0 Beta Is Here

#7

Looking at the syntax briefly it seems very similar to Scala. Is there any major differences between Scala and Kotlin?

Kotlin has a much simpler syntax, and much simpler semantics, than Scala. Specifically, it's largely a very, very good syntax, and small class library extension, for otherwise-vanilla alternative syntax to Java.

This is the whole reason for its existence: Kotlin code cleanly interoperates, in both directions, with existing Java code. From my own experience, this means that it's very easy compared to Scala to introduce into an existing code base: you can sanely go class by class, file by file, cleaning up code, relying on the existing unit tests, without breaking anyone's workflow. As a result, it has, in my experience, proved a lot cheaper than Scala to train new devs in it as well.

That's not to say that it's all just syntax, though. Kotlin also brings null safety, traits, builders, and some other key things over from the Scala, Groovy, other sources, which has proven to be a major productivity boost. Its collections library is a lot saner (IMHO) than Java 8's due to better generics support. It adds data types and value semantics for when you need them as well. But it does so in a way that (again, based on experience introducing Kotlin into a company after Scala had failed to gain any traction) is a lot easier to teach to most developers, and a lot easier to integrate into existing workflows.

Re: The Kotlin Language: 1.0 Beta Is Here

#9
I've been using Kotlin on Android for about six months, and can't recommend it highly enough. If you're stuck in the Java ecosystem, Kotlin will make your life much better.

I also recommend it for people coming from the world of dynamic typing (Ruby, Javascript, Python, etc.). If you can appreciate the guarantees of a static type system -- and I submit that anyone who has worked on a project of more than a few KLOC can -- give Kotlin a try. It's much less verbose than Java, and gives you the tools and constructs to program in much the same style as you would in a dynamic language, but with extremely good compile-time correctness checks. It may not be Haskell, but it's pragmatic, practical and productive.

The tooling is also world class, as you might expect from a language developed by JetBrains. I recommend using Kotlin with IntelliJ -- the intellisense is guaranteed to boost your productivity.

Seamless Java interop has been a huge priority for the developers, so the ecosystem is also quite good. Its biggest weakness (for my use case anyway) is the lack of a good, modern web framework. Hopefully now that Kotlin is more stable a native library ecosystem will emerge that plays to Kotlin's strengths more than Java's.

Re: The Kotlin Language: 1.0 Beta Is Here

#10

Looking at the syntax briefly it seems very similar to Scala. Is there any major differences between Scala and Kotlin?

Can't do much FP in Kotlin. Unless your definition of FP is programming with lambdas.

https://medium.com/@octskyward/kotlin-fp-3bf63a17d64a
Post reply on HN