Kotlin for Gaming


#1

I’ve known about the development of Kotlin for a while now, but only recently took a new look at it as a mature programming language. At first I didn’t think much of it until I read that Kotlin could be run natively. This made me consider the viability of Kotlin (the bare language that is) for my favorite subset of programming: game development. So far the standard for writing video games has long been C/C++, and more broadly, languages designed for systems programming. However, I am under the impression that the only thing keeping a language like Java from breaking into game programming is the performance impact of running on a virtual machine. Could anyone with a working knowledge of native Kotlin give me some insight on the performance possible with Native Kotlin?


#2

Not really an answer to your question, but you can also use Kotlin with LibGDX – been working well for me so far. So I’d at least look into that before jumping all the way into Kotlin Native.


#3

Could anyone give me some insight on the Kotlin Native performance vs HotSpot ?


#4

Here’s a link to some recent performance figures for Kotlin Native compared to C and Kotlin JVM.

This suggests that, on this particular benchmark, Native is about 50% slower than JVM at the present time. However, it is of course still early days for Native and I’d certainly expect the difference to be narrowed or, hopefully eliminated, as performance is tuned for the eventual release of v1.0.

Having said all that I think it would be unrealistic to expect that Kotlin Native will eventually approach C performance on all relevant benchmarks. It is after all intended as an applications rather than a system programming language and, whilst performance is undeniably important for applications such as games, the primary focus is inevitably going to be on ease of use and compatibility with the other Kotlin editions.


#5

Kotlin/Native is currently approx 2/3 of C performaince in pure math functions.
On the other hand - in object manipulations it is much worse - 1…2 orders of magnitude slower compared to C and JVM.
But it is still alpha, and will improve before release.