Kotlin support


It would be nice if CodingGame support Kotlin language. It new and fun language winkIs there any plans to add this language to arsenal? smile

Languages update

It would be REALLY nice, Kotlin does increase productivity a lot. For us, Java developers, it would save us a lot of time.


On top of Kotlin being an awesome language, it should be quite easy to add support for it. With the existing integration of Java, it should only be a matter of a few hours to get Kotlin running. Kotlin is 100% Java interoperable and Intellij is able to convert java files to kotlin files. Hence getting all the boilerplate code for all existing tasks Kotlin ready is much easier than adding any other new language.


I absolutely agree. People will learn Kotlin by solving CodinGame problems.

I am sure that JetBrains will promote CodinGame as platform for learning Kotlin.

Add Kotlin!


Kotlin 1.0 released http://blog.jetbrains.com/kotlin/2016/02/kotlin-1-0-released-pragmatic-language-for-jvm-and-android/


I need this bad.


+1 for Kotlin support. Would love to see more modern languages here.


Kotlin is going to be a major language. It already have 4300 «stars» on github (https://github.com/JetBrains/kotlin) much more than groovy and not very far from clojure and scala.

The very clear syntax and the features will be invaluable for the kind of exercices to resolve on coding game.

As the integration of this language is so closed to java could you add it soon?


I'm not familiar with the language but how is it really different than java? I've been to their front page and I've seen 1-2 examples, but until now it seems very similar at first sight. Can you detail more what you think make Kotlin really different, or at least worth adding to the already large language pool?


There some really interesting features.

data class

data class Point (val x:Int, val y:Int)

This single line with no implementation creates a class with 2 properties, its getters (no setter in this one because I used vaL and not vaR), hashcode, equals, toString.

Very compact and interesting when you need data structure for your algorithms.

inference type

val A = Point(2,4)

operator overloading

These operators can be overloaded : + - * / % .. in += -= *= *= == != > >= < <=

It allows to write things like.
val path = A + B + C + D + E

val points = path.points.filter {it < height}

ie: very expressive code for gaming.

function extension

You can add function to any class. It can be very useful for some context.
Ex: converting from one class to another for example).

Or to create data for testing from a "readable" String:

Range type

Not a big features but easy to read.
(0..10).forEach{ x ->
(0..10). forEach {
println("x × y = ${x*y}")


var sum = 0
ints.filter { it > 0 }.forEach {
sum += it

Tailrec recursive function

This allows some algorithms that would normally be written using loops to instead be written using a recursive function, but without the risk of stack overflow.

tailrec fun findFixPoint(x: Double = 1.0): Double
= if (x == Math.cos(x)) x else findFixPoint(Math.cos(x))

syntactic sugar

There are a lot of syntactic sugar that make your code very compact AND easy to read and understand.

You should try http://try.kotlinlang.org/koans to have a better idea of the possibilities.


Thanks, I guess there are some interesting features. If I ask you that, it's because by explaining on the forum like that, other users and Codingame staff can have a quick sneak peak into this language to see if it's worth adding.


Kotlin is going to be a successful language. There is a big traction in the android community but there is a real gain for server development too.

The integration in codinGame should be quick.
Compiling the source: kotlinc hello.kt -include-runtime -d hello.jar
Running the program is the same as java: java -jar hello.jar


I'm going to bring this thread up again. I would love to see Kotlin on CodinGame, I've been spending quite some time with it lately and it's awesome and a joy to code in. Please add support! :smiley:


I'm waiting kotlin support to come back on CodingGame. Having completely switched on kotlin make it painful to code on another language :wink:.

It should come one day : https://twitter.com/f_fillette/status/724264027317116928

But I don't understand the time it takes as the integration should be so close to java.


That's great news! Although it seems like it's not on priority anymore: https://twitter.com/f_fillette/status/735501309583884290

Maybe we should reach out to the developers more and/or keep this thread active to speed up the process and make Kotlin on top of the list again :slight_smile:


It's too bad it's not on priority anymore because:

  1. It should be very easy to the support,
  2. It would provide a huge benefit for the java community,
  3. Kotlin is going to be a major language

Another interesting post today on how to use Kotlin for complex numbers: https://opencredo.com/complex-kotlin/


They changed priority so easily so I assume work to integrate KT wasn't even started :sob:


If they start it should be finished in few hours without the code formatting in IDE. I suppose everybody use its own IDE to code and then just copy paste the source. So the code formatting is not so important.

Even then, however, the code of http://try.kotlinlang.org/ is open source.


Do we have any recent news on this front? Or do we need to apply some more pressure?


I've recently been learning Kotlin, and I agree with this wholeheartedly. I hope this request gets traction, this will be a win-win for everyone!