Member-only story
If Kotlin Runs on the JVM Just Like Java, Then How Does It Provide So Many Great Features?
A look at Kotlin’s generated bytecode and how it runs on the JVM

Looking at the very fundamentals; what exactly do we mean when we refer to a “JVM language” and how does the Kotlin language relate to that? Wasn’t only Java meant to run on the JVM? In this article, I want to talk about the basics of what the JVM is and how it all plays together. Especially, I will demonstrate how other languages than Java can be executed on the JVM. To do so, we will learn what the JVM bytecode is and how it makes JVM languages possible.
The Kotlin programming language provides many features that aren’t available in Java such as proper function types, extension functions, or the built-in singleton support via the object declaration. How can Kotlin provide more features than the language that is meant to run on the JVM in the first place? I’ve taken a deeper look at how Kotlin works under the hood and what JVM language actually means. We’ll be having a look at Kotlin’s bytecode generation. If you also thought about these things before, this article should bring some light into the darkness 🙂