BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News JetBrains introduces the new JVM language Kotlin

JetBrains introduces the new JVM language Kotlin

This item in japanese

So far, Kotlin has been primarily known as a Russian island thirty kilometers west of Saint Petersburg. More recently, the Czech company JetBrains introduced a new programming language named Kotlin running on the JVM (Java Virtual Machine). It is the intent of the language developers to get rid of some challenges in the Java language.

JetBrains’ product portfolio mainly consists of IDE for Java, PHP, Objective-C, Ruby and  MPS. With the Project Kotlin they are now entering unchartered space.

The language developers emphasize, that the main design goals behind their project are:

According to JetBrains, the new language is statically typed, object-oriented,  targets the JVM, is built for industrial use, and gets rid of problems and challenges in Java that are due to backward compatibility.

For instance, the type system takes control of Null references so that Kotlin does not need Null Pointer Exceptions. There are no raw types in Kotlin, arrays are invariant, and generics are type-safe even at runtime. In addition, the language supports clojures that can be optimized using inlining. And it doesn’t support checked exceptions, which many language designers consider a bad feature, anyway. An essential aspect is the interoperability between Kotlin and Java: Kotlin can call Java, and Java can call Kotlin.

The following code snippet illustrates a simple object-oriented “Hello World” implemented in Kotlin. Further examples are available by JetBrains.

class Greeter(name : String) { 
      fun greet() {
          println("Hello, ${name}"); 
      } 
} 

fun main(args : Array<String>) { 
     Greeter(args[0]).greet() 
}

 

There are a couple of other languages that consider themselves reasonable alternatives to Java. In particular, Scala, Fantom, Groovy, Gosu, and Ceylon are natural competitors with Scala and Groovy having achieved the most distribution.

At the moment, there is lot of - sometimes heated - debate in different discussion groups how Kotlin compares to other languages such as in the Fantom website or in the Scala user group.

It remains to be seen how many software developers will consider Kotlin as their language of choice. At least, the reactions of many developers prove that Kotlin has at least entered the race for the next new cool language.

A public Beta will be available at the end of 2011. Reportedly, there will be an open source compiler and IntelliJ IDEA plug-in under the Apache 2 license. While the compiler will initially emit Java byte-code, there might also be a Kotlin version emitting JavaScript.

 

Rate this Article

Adoption
Style

BT