News for hackers. Stuff that matters.
Re:Kotlin 1.2.20 released by pdpi on Wednesday January 17, 2018 @09:41AM (#16168198)
It's important to note that Kotlin defines itself as a blue-collar language, and if the feel you get from it is "this is as if Java had been designed today", then they accomplished their goal.

There's exactly one unusual/novel feature in the language (AIUI), and it's a feature that I personally find inspired: anonymous receiver functions, as it makes EDSLs trivial to write.

Re:Kotlin 1.2.20 released by lmm on Wednesday January 17, 2018 @11:25AM (#16169180)
Delegation as implemented in Kotlin is very novel; AFAIK it's the first remotely mainstream language with that feature (not counting Go since it doesn't have traditional inheritance at all).

(I think it's a very good idea, but it's as innovative as anything you'll see in e.g. Scala, so it makes a mockery of the "blue collar" narrative)

Non-representable types are also decidedly "novel" (in the sense of "wtf?"), as are some of the details of their preferred way of doing await/async (assuming they haven't radically changed again in a minor version as they did in the past).

The only sense in which Kotlin is blue-collar is that it prioritizes immediate use cases over consistency and theoretical coherence. That's not "Java as if it had been designed today", that's "Perl as if it had been designed today".

Re:Kotlin 1.2.20 released by pdpi on Wednesday January 17, 2018 @01:06PM (#16170188)
Several features have a clear "this is annoying in Java" background: Type inference is table stakes for a modern language, data classes make beans painless, receiver methods are explicitly designed to ease the pain of FooUtils classes, inline+reified open up generics to a tonne more use cases, and variance annotations helps with several others.
Re:Kotlin 1.2.20 released by lmm on Wednesday January 17, 2018 @05:45PM (#16172801)
Sure, it does fix some of the annoying things in Java, as do most languages from the last ten years. But it does also make radical moves away from it - the narrative that you could easily port any Kotlin codebase to vanilla Java becomes a complete myth once you start using delegation or async/await. From my perspective Kotlin tries to have it both ways and ends up achieving neither: it's different enough from Java that you have to treat it as a whole new language, but the lack of usable result types or structured/safe ways to do things like JSON serialization makes it looks painfully limited next to Scala. Indeed by lacking any practical way to safely report errors with information (it's missing checked exceptions but doesn't have practical result types either, because there's no "do notation"-like syntax - the "elvis operator" and friends only work with null, not with errors that carry information), in an important respect it's a regression from Java.
Re:Kotlin 1.2.20 released by roflc0ptic on Wednesday January 17, 2018 @10:39AM (#16168746)
Are you familiar with Scala's implicits? Reading about them here (https://kotlinlang.org/docs/reference/lambdas.html), they seem very similar. If you happen to know, what affordances do anonymous receiver functions provide that implicits don't? It looks like they make it marginally easier to add functions to some existing type, but at the cost of making the typeclass pattern less palatable.