Kotlin M2 Candidate

Posted by: Andrey Breslav on 06/04/2012

It’s been seven weeks since Kotlin M1 release, and I’m happy to invite you to try out a candidate build of Kotlin M2! This post gives an overview of the upcoming milestone release along with come usage instructions.

Thank you, M1!

Our M1 build did a pretty good job: got about 800 downloads, and brought extensive feedback in our forum and issue tracker.

Seems like you have had some fun with it, and we are aiming at even more fun :)

What’s new

Little Things

As usual, it’s been a lot of bugs fixed. I’d like to point out that we are working on the IDE performance. It has been somewhat improved in M2, and will get to its real speed by the next milestone.

Language Features

Kotlin now respects visibility modifiers. We have four of them:

  • privateprotectedpublic — as usual,
  • internal — visible inside a module (that is more than a package).

You can now pass an array of values to a vararg-function:

fun printAll(vararg a : String) {
    for (item in a) println(item)
}

fun main(args: Array<String>) {
    printAll("one", "two")
    printAll(*args)
}

The spread operator “converts” an array into a vararg-list. Unlike Java, this does not present any ugly corner-cases.

There will a few more nice things shortly.

JavaScript Support in the IDE

While you can still play with Kotlin directly in your browser with Kotlin Web Demo, there’s now a real IDE for Kotlin compiled to JavaScript.

When you install the M2 Candidate build of the IntelliJ IDEA plugin, follow these instructions to try out some Kotlin-to-JS compilation:

  • Check out kotlin-js-hello project from github
  • Open it as an IntelliJ IDEA project
  • Set it up as a Kotlin-JS project
  • Select your favorite browser and run. The result will open in the browser.
  • Have fun editing the JavaScript file as you like and re-running…

Currently, the API documentation is only being prepared. Meanwhile, you can study Kotlin’s JS APIs here.

Android

After fixing some bugs and finding out a lot of interesting stuff (special thanks to Aleksandro Eterverda), we are ready to run Kotlin on Android!

Some other Kotlin programs running on Android:

How to Install the Candidate Build

As usual, your feedback is very welcome. Have a nice Kotlin!


 

Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

About Andrey Breslav

Andrey Breslav

Andrey is the lead language designer working on Project Kotlin at JetBrains (http://kotlin.jetbrains.org/). He also works on making the Java language better, serving as a Java Community Process expert in a group for JSR-335 ("Project Lambda"). In what spare time is left he tries to make sure that his traveling is not all about work and teaches programming to high-school children. Used to teach OOP/Software Design at a university, but currently switched to speaking at software conferences. Audiences of Devoxx, OSCON, StrangeLoop, Jfokus and other events gave warm reception to his talks on Kotlin, programming languages and foundations of software engineering.

More About Andrey »

NFJS, the Magazine

May Issue Now Available
  • On the road to learning

    by Raju Gandhi
  • Refactoring to Modularity

    by Kirk Knoernschild
  • RESTful Groovy

    by Kenneth Kousen
  • Getting Started with D3.js

    by Brian Sletten
Learn More »