Switch Theme

The Implications for Kotlin Native C Interoperability

dev

12/12/2024

2 min. read

I recently did some digging and found out that Kotlin/Native C Interoperability is now in Alpha/Beta, meaning that according to the Kotlin stability rules, they plan to productize this feature in the near future. I believe this fact, combined with the existence of Kotlin/JS, creates huge implications on the programming world for what could come next.

Use Case #1: Godot & Unreal Engine

Because of its ability to interop with C (and by proxy C++), Kotlin/Native could be used in the Unreal Engine and Godot bindings. This means that Kotlin could be introduced to an entirely new world of video game compatibility. Since Kotlin already has multiplatform support intact, portability between operating systems could be maintained, without having to learn the native language in its entirety.

With the introduction of Kotlin to the game development sphere, it could become one of, if not, the most influential programming language of all time. Kotlin has already had major advances from overtaking Java for Android Development (according to Google), which opens up the door to both iOS and Android mobile gaming for developers to use.

Use Case #2: Kernels

Imagine an operating system written in a “Java Clone.” That sounds highly unrealistic and a performance nightmare. However, Kotlin/Native performance has been discussed to be comparable to Go, albeit a little slow. That was back in 2021, this was written toward the end of 2024. Kotlin/Native wasn’t stable back then. Imagine the kinds of performance advancements we could have if Kotlin/Native becomes comparable to Rust or even C. With that, we could have future operating systems, along with applications that could potentially interop with more programming languages, advancing development.

Use Case 3: Artificial Intelligence

Most AI bindings are written in Python (even though the underlying implementation is in C++). While we most likely won’t see a Kotlin/Python interop soon, we could see Kotlin/Native bindings continue to be linked to AI bindings in native languages instead. Given the current “AI boom” of 2023, 2024, and potentially 2025, Kotlin could see its entrance into the AI sphere.

Use Case 4: Native Applications

I’ve used Compose Multiplatform before. It’s pretty good, but nowhere near as good as native applications and native UI usage on Windows and macOS. Kotlin/Native could bring more advancements to utilizing X11 or Wayland, along with other native UI utilities available on the operating system.

Conclusion

Kotlin has potentially one of the brightest futures of a programming language I have ever seen. JVM, JS, and Native cover nearly every kind of application we currently use and implement. As the team advances more into the stabilization and productization of Kotlin/Native C-Interop, we should expect to see Kotlin in more unexpected places as time goes on.