Home Quick Update: Kotlin

Quick Update: Kotlin

For most of my career I’ve been turned off by the entire JVM environment. I’m sure it’s rooted in the number of hours that I spent wrestling with the earlier versions of eclipse while at university. The language’s reputation for verbosity, and the ‘look’ of early android releases didn’t help my outlook. Slowly however thats been changing. Android looks much better than it used to (and in some ways is better than iOS). I’ve been very interested in the features that Java 8 introduced. Add interesting alternatives like Scala and Clojure, and the JVM is a much more attractive environment to be in.

Just today actually, I came across this interesting language being developed by JetBrains called Kotlin. This language has some particularly noteworthy aspects: conciseness, javascript build target, familiarity, Gradle Compatability, a slick IDE, and REPL.

The familiarity is an artifact of my history as a programmer. Much of my programming career has been spent with Java, JavaScript, C#, and AS3. The feel of Kotlin isn’t too different from those. The conciseness I attribute to type inferencing. In c++ it’s auto, in python it’s … everything. Kotlin sheds a little weight, but keeps enough to keep type safety.

A slick IDE and REPL are huge wins when approaching a new language. The IDE helps (especially with compiled languages) to bootstrap projects and manage dependencies and the build pipeline. Luckily the IDE is Intellij by Jetbrains, who make the only IDE’s I’m using at all right now. The REPL help prototype and check ideas before pulling in to the larger program. These two combined with Gradle (which is a great build tool), and the experience for getting up and running has been pretty good.

There were some issues when working the javascript build target, and I had some issues when serializing and deserializing with Jackson, but I figured those out and was able to both write to the DOM and serialize/deserialize via reflection (always nice). Next I’ll be trying to get the gradle build to work with JS output and try to work in some Java functionality.

A basic Gradle project that serializes and deserializes JSON can be seen here.

Until Next time!