Kotlin: Decompiled – How its features are represented on the JVM
Have you ever wondered how the Kotlin compiler pulls off all those nice features when having the JVM as the target platform? Some of Kotlin’s features have no clear equivalent in Java/JVM bytecode which means that the compiler has to do a lot of heavy lifting to enable those nice features.
For this video, I analyzed almost 40 of Kotlin’s features and language constructs to see what they end up looking like once run through the Kotlin compiler. For this to work, I first compiled a small example for each, to then decompile the resulting byte-code to Java again for a readable but close representation of what happens behind the scenes.
You can find all the code snippets in this public repository:
Timestamps:
00:00:00 Introduction
00:02:35 Top-Level Function
00:03:39 Inline Keyword
00:04:34 Local Function
00:05:07 Operator Overloading
00:05:40 Named Argument
00:06:23 Iterating over Range
00:06:58 Sealed Interface
00:07:45 Reified Keyword
👋
6 views
2904
997
3 years ago 00:09:36 6
Kotlin: Decompiled – How its features are represented on the JVM
6 years ago 00:43:01 4
Kotlin decompiled. The closer look on comparisionjava with Java. (Ruslan Klymenko, Ukraine) [RU]