Thread
#feed
    Jakob Löhnertz

    Jakob Löhnertz

    8 months ago
    Since I was intrigued by this for quite some time already, I analyzed almost 40 of Kotlin's features and language constructs (which are probably almost all there are) to see how each ends up looking when compiled to run on the JVM as the target platform (which of course is the most common target still)! Since byte-code is pretty tedious to read, I created an example for each, compiled that into JVM byte-code and then decompiled it again into Java to have a more or less close look at what the results are. This is of course not 100% accurate but for most features the output is pretty clear. I produced a video looking at the most interesting ones and discussing them:

    https://youtu.be/6pWXre4gDyM

    :kotlin-intensifies-purple: Additionally, I published all of the examples in a repository: https://github.com/The-Self-Taught-Software-Engineer/kotlin-decompiled
    e

    ephemient

    8 months ago
    default arguments have some different handling for constructors vs other function calls, and IMO it's useful to call out that many features rely on Kotlin metadata to be available to other Kotlin consumers at compile-time
    s

    sorianog

    8 months ago
    Great work! Thanks for sharing!
    Jakob Löhnertz

    Jakob Löhnertz

    8 months ago
    @ephemient Good point! I should have mentioned that difference with the
    DefaultConstructorMarker
    . I will look into producing a follow-up video regarding the metadata, I think it would be an equally interesting topic!
    e

    ephemient

    8 months ago
    it is interesting 😃 the JVM ABI is relatively easy to see, but the metadata contains a lot of powerful information like package-level functions/variables, Kotlin names (which may be distinct from JVM names), which functions are operators (as opposed to simply being named the same as an operator), etc.
    Jakob Löhnertz

    Jakob Löhnertz

    8 months ago
    @ephemient Nice, sounds good! I have to first dive deeper into this myself, only got basic knowledge about the usage of the metadata annotations after researching for this video. But I'll look into it 🙌
    @sorianog Thanks so much 😊 Take a look at the other videos on the channel, if you'd like. I got quite a lot of Kotlin-themed content.
    s

    sorianog

    8 months ago
    Your narrator voice is amazing! Definitely fitting of these types of videos! Must have been consistent practice to get to that point too! 👏
    Jakob Löhnertz

    Jakob Löhnertz

    8 months ago
    @sorianog That is so kind of you, very happy to hear! It did take practice and I also notice myself how much worse it is on older videos. Cool that you noticed. You made my day today already 🤗