Hacker News new | ask | show | jobs
by pron 4642 days ago
I, too, have high hopes for Kotlin. It seems to achieve what I'd hoped Scala would but ended up failing miserably.

There's a lot of merit to the "Java philosophy": a gradual progression of what most programmers expect in a language. Google, for one, seems to have adopted the Java philosophy wholeheartedly in its new languages Go and Dart.

Kotlin is certainly in that camp: a gradual progression that will make programmers happier yet won't turn their world upside down. It's simply a better Java. So while Scala unfortunately evolved from being a better Java into the mother of all kitchen sink languages (assuming, of course, that your kitchen feeds a whole military base and has sinks the size of hot tubs), trying to cram Java, Haskell, Lisp and Javascript into a single compiler (I find it hard calling Scala "a language"; it's more like a compiler that compiles code written in any of several languages), Kotlin takes a few steps back and comes up with a coherent philosophy.

I think 99% of Scala users will find Kotlin to provide 100% of their requirements, and at a much reduced complexity and mental load. So Kotlin, I think, is not only a better Java, but a better Scala.

Yet, I think Java 8 will be the game to beat, for Kotlin as well as Scala. Java is hugely popular, and those that haven't migrated to other JVM languages so far, might be less likely to do so when Java 8 comes out. With lambda expressions and traits – the two killer features that attract many to Scala when it first came out – it gives Java a nice boost. Sure, Kotlin feels more like a fresh start, and has some other necessary features (properties), but will those be enough to switch people away from Java?

I think that one of the great achievements of Kotlin's design, though, is that the transition could be very gradual. Kotlin places a very strong emphasis on Java interoperability (leaps and bounds better than Scala's) and unlike Scala, Kotlin code is easily read by Java programmers. So teams would be able to easily replace individual Java classes with Kotlin code.

1 comments

I think Kotlin and Java8 are in different category. For example Kotlin also compiles to JS and it has reasonable chance to become killer web language.
You know what language I wish could compile to Javascript? Visage (https://code.google.com/p/visage/), AKA JavaFX Script, AKA F3. Now that would be a killer client-side web language.
I'd never heard of Visage. Seems it's a declarative UI language. That raises two questions: what UIs have been built with it, and how does it accommodate the arbitrary code (i.e. imperative rather than declarative) that one inevitably needs as applications become complex?

Ok, three questions: why do you say it would be a killer client-side web language?

The declarative part of Visage/JavaFX Script is simply a clever object instantiation syntax, with its killer feature being the "bind" form. Other than that, Visage is basically statically-typed typed javascript.

It would be great because it's:

1) Looks very familiar to javascript developers

2) Accommodates both the declarative (HTML) and imperative (js) parts of the applications consistently, beautifully and in one place, and ties them together very naturally.

3) Incorporates CSS

There was copious amounts of docs and examples online, but unfortunately they all seem to have been taken down. I found one example, though: http://langexplr.blogspot.co.il/2008/07/javafx-script-overvi...