Live data from Hacker News

The Kotlin Language: 1.0 Beta Is Here

blog.jetbrains.com

51–60 of 102 posts

Re: The Kotlin Language: 1.0 Beta Is Here

#51
post #50
post #15

are non-exhaustive pattern matches in kotlin warnings, errors, or neither? looks like from the docs: "If `when` is used as an expression, the `else` branch is mandatory, unless the compiler can prove that all possible cases are covered with branch conditions." So it is an error, I assume?

It's an error only when the 'when'-expression is used as a value, like assigned to a property, passed as an argument or returned from a function. Otherwise it's not an error. There's also a warning for matching enum values over an incomplete set of enum entries, but otherwise non-exhaustive 'when'-expression is green code. You can basically consider 'when'-expressions to be syntax sugar over Java's if-else or ternary…

> non-exhaustive pattern matches

So there are no non-exhaustive pattern matches, is what you are saying? i.e. they all must be exhaustive. Except for your enum example

Re: The Kotlin Language: 1.0 Beta Is Here

#52
post #40

How is it better than Ceylon 1.2? Ceylon compiles to JVM bytecode, JavaScript, Dart, and will to LLVM in the future. As a language, it's a great superset of Java. I posted [0] about the great new Ceylon 1.2 (which is backed by Red Hat), and nobody seemed to care, but there's so much hype about Kotlin - I don't get it! [0] https://news.ycombinator.com/item?id=10474126

It's got a really solid IDE seeing as JetBrains are the one that built the language.

Re: The Kotlin Language: 1.0 Beta Is Here

#53
post #40

How is it better than Ceylon 1.2? Ceylon compiles to JVM bytecode, JavaScript, Dart, and will to LLVM in the future. As a language, it's a great superset of Java. I posted [0] about the great new Ceylon 1.2 (which is backed by Red Hat), and nobody seemed to care, but there's so much hype about Kotlin - I don't get it! [0] https://news.ycombinator.com/item?id=10474126

It's got a really solid IDE seeing as JetBrains are the one that built the language.

Also, you can have Kotlin and Java sitting side-by-side which makes for migrating codebases much easier.

Re: The Kotlin Language: 1.0 Beta Is Here

#54
post #30
post #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 c…

How does it affect built time and the feedback cycle?

Build times are supposed to be comparable to Java.

Re: The Kotlin Language: 1.0 Beta Is Here

#55
post #24

Earlier quoted context omitted.

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

Which is mostly what used to be, 10 years ago. Closures, map, fold, etc. Before Haskell and Clojure like immutability and extra trimmings became fashionable... In 1995 or even 2000 era LISP discussions you rarely if ever see those other concerns about FP that hipster functional programmers bring forward today. (I guess it's also something that was helped by Moore's Law style speed development slowing down and the adv…

Language evolves; "FP" today means something different from what it meant 10 years ago. There's no need for dismissiveness in either direction.

Re: The Kotlin Language: 1.0 Beta Is Here

#56
post #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.

Yeah, Kotlin looks largely like a simpler, stripped down version of Scala. It's a lot closer to Scala than it is to Java, but it's close enough to Java devs to not have to put in much effort to learn vs learning Scala. I prefer Scala, but not everyone wants to invest the time to learn it in order to gain maybe 25% more expressiveness. Kotlin also seems like a better fit for Android than Scala (and Java for that matter).

Re: The Kotlin Language: 1.0 Beta Is Here

#58
post #33
post #13

Earlier quoted context omitted.

There are many feature-level differences, but the biggest differences are in the approach, goals and philosophy[1]. When it comes to philosophy, Kotlin is a modern Java -- i.e. a "blue-collar" language[2], aiming to adopt only tried-and-true ideas and not to break new grounds. Scala is most certainly not blue-collar, serving as a basis for a few PhDs, and incorporates many ideas that haven't been tried in the industr…

You keep spreading your misinformed FUD about scala every time someone mentions it in a thread. Do you really continue to maintain the position that scala is not used successfully by large teams?

Pron tends to zealously defend Java and Kotlin and bash pretty much anything else, especially Scala, but his post here today seems perfectly reasonable.

Re: The Kotlin Language: 1.0 Beta Is Here

#59
post #40

How is it better than Ceylon 1.2? Ceylon compiles to JVM bytecode, JavaScript, Dart, and will to LLVM in the future. As a language, it's a great superset of Java. I posted [0] about the great new Ceylon 1.2 (which is backed by Red Hat), and nobody seemed to care, but there's so much hype about Kotlin - I don't get it! [0] https://news.ycombinator.com/item?id=10474126

Kotlin has a real potential to replace Java for Android, since Android is stuck with Java 1.6. I think a lot of this buzz and excitement comes from the Android side.

Ceylon has yet a solid Android support I think (I could be wrong)

I have not tried on Ceylon so I cannot comment whether it is better or worse than Kotlin.

Re: The Kotlin Language: 1.0 Beta Is Here

#60

Kotlin seems to fill a niche comparable to TypeScript: a language that doesn't try to break new ground, but picks a bunch of tried-and-true ideas to fix severe problems in the underlying platform. Like TypeScript, I hope that it ends up being the right language, with the right compromises, at the right time.

Yup. It helps that Kotlin is also a smallish language. You can pick it up in a day.
Post reply on HN