Kotlin


(Corda.net) #1

Originally published at: https://www.corda.net/2017/01/10/kotlin/

When people start looking at Corda’s code the things they notice immediately is that it’s written in Kotlin, a new programming language from JetBrains that targets the JVM and Javascript. This was an unusual choice, so in this post I’ll give some background on why we did it and discuss experiences from our “year of enterprise Kotlin”. Why…


(Arun Rao) #2

You guys are lucky/the exception - most companies/management would have NOT risked a new, unproven language as Kotlin


(richard) #3

Tell me about it… I agonised about whether we should take this risk. I concluded that we’d hired Mike for a reason and that I trust his judgement. AND the risk/reward tradeoff was really favourable. On the upside, we get all the advantages that Kotlin brings and on the downside we get risks that were actually very manageable (essentially: the 100% java interop allowed for a containment strategy should it not have worked out).

Happily, Mike was 100% right and it has worked excellently: the language is massively more productive, our development team (none of whom knew it before joining) learned it in no time and we’re now reaping the rewards.

And, as Mike stresses in his post, just because Corda itself is written in Kotlin, it imposes no such obligation on users. You can write CorDapps just fine in Java (even if most people end up finding they prefer Kotlin :slight_smile: )


(Arun Rao) #4

Glad that it worked out…
I tried the same with Groovy/Grails many years ago - promoting it to my clients - but without much success


(Charles) #5

I’m guessing you all were looking for a “productive” yet static, safe, environment on a solid foundation i.e. JVM, if static is required then type inference is a must, there’s Scala but then again its Scala, I used it for a while, was not thrilled overall, so far I can see why Kotlin is more appealing although I have much to learn. I would be curios to know if Scala was considered and if so what were the features of Kotlin that pushed past Scala. Kotlin is backed by a very successful company that knows the JVM well, over all I’m comfortable with it and certainly more comfortable with using Kotlin or a suitable JVM language as opposed to Solidity for contract creation.