WatersWorks

Blog archive

JVM Language Kotlin Hits Milestone 4

Kotlin, the JVM-targeted programming language developed by software development toolmaker JetBrains, passed its fourth milestone this week. The big upgrades in Kotlin M4 (besides the 128 "closed issues") are its improved compatibility with JDK 7 and the introduction of KAnnotator, a tool for automatically annotating developer libraries.

Kotlin project lead Andrey Breslav announced the latest milestone release on the Project Kotlin blog post. Breslav, who is also serves in a Java Community Process expert group for JSR-335 (Project Lambda), said the milestone was released from "under snow," with a link to photos of the Prague street where the company is headquartered buried under the white stuff.

This milestone release improves on the type argument inference (its faster), tweaks the code completion feature, and makes it possible to copy and instance of a data class (data classes were introduced in Kotlin M3) and selectively change some of its properties while keeping the object immutable.

Breslav waxed poetic about the addition of the KAnnotator tool in this release: "A programmer is a lazy creature, and by virtue of our laziness, we want to automate as much as we can," he wrote. "And today, along with Kotlin M4, we roll out KAnnotator: a tool that annotates your libraries automatically (the tool is written in Kotlin, of course)."

Developers simply tell KAnnotator to infer annotations from their jar files, and it then writes them to XML. Breslav shows an example of annotations for methods and fields that can be added to projects and are visible to both the Java IDE and the Kotlin compiler. He adds that this new tool "will grow much smarter" in future versions.

The Czech maker of the code-centric Java IDE, IntelliJ IDEA, began developing Kotlin in 2010 and released it in July 2011 for distribution under Apache 2 Open Source License. Kotlin is a statically typed language similar to Scala, Gosu, Ceylon, and Fantom. It compiles to both JVM byte code and JavaScript. The company has claimed that the language will be more stable at runtime than Java, because it can statically check weak points and it supports things like variable type interface, closures, extension functions, and mix-ins.

"We know that Java is going to stand long, but we believe that the community can benefit from a new statically typed JVM-targeted language free of the legacy trouble and having the features so desperately wanted by the developers," Breslav said at the time.

The company released the first Kotlin milestone (M1) in April 2012 with a plugin for the JetBrains IntelliJ IDEA dev tool suite. The second milestone release, Kotlin M2, was released in June with the added ability to compile Kotlin code to JavaScript within the IDE. The Kotlin plug-in requires the IntelliJ IDEA. Running Kotlin on Android requires the Android SDK.

According to Wikipedia, Kotlin is the name of a Russian island located near the head of the Gulf of Finland, 20 miles west of Saint Petersburg in the Baltic Sea. One of JetBrains’ development offices is located in Saint Petersburg.

Kotlin is currently under active development, More information is available on the Kotlin Web site, and the Kotlin issue tracker. The source code is also available on GitHub.

Posted by John K. Waters on December 12, 2012