I’ve always been really frustrated of iOS develope...
# compose-desktop
u
I’ve always been really frustrated of iOS developers who had access to Kotlin Native. I’m working on desktop, and for every native API I have to step out of Kotlin and write those awful bindings. So I built this: it basically lets you use Kotlin Native inside the JVM in a transparent way. I don’t really see much use for it beyond Compose Desktop, so I’m sharing it here. Out of the box, it also generates metadata for adventurers like me who experiment with GraalVM compilation. Feel free to take a look : https://github.com/kdroidFilter/NucleusNativeAccess
K 7
👀 1
❤️ 1
d
Hey Elie! Again with a killer library! 😆 Quick question, I skimmed through the Readme, but I am having difficulties grasping how different it is from Knee (https://github.com/deepmedia/Knee).
u
Thanks, Well, to be perfectly honest, I didn't know it existed.
😛 1
K 1
But after checking, it's not the same use case; knee works with annotations, my library works transparently.
👍 1
@Didier Villevalois At first I thought of calling this library KotlinNativeExport, but in fact it's very modular and could be quite easily adapted to other languages ​​like Rust. My long-term goal is that you can import a Rust library and use it as if it were a Kotlin library in the JVM.
❤️ 1
I don't get the impression that Knee supports flows well, which could quickly make it less transparent, especially with compose; if you end up with callbacks everywhere, it quickly breaks the immersion.
👍 1
KN is very pleasant on macOS, as you can see in my System Info example; everything is very fluid and quickly understandable. However, on Linux, or even worse on Windows, it's not Kotlin, it's C written in Kotlin.
That's the primary goal of my library. I think desktop apps have much more value on macOS, which is why I'm rewriting the native macOS theme in Compose. I understand wanting to create an app specifically for macOS. Windows users are used to websites wrapped in resource-intensive and slow Electron apps, and I guess they like that. On macOS, the need for quality is more pronounced. I think that even for a 100% macOS app, it's very worthwhile to create it in Kotlin and Compose.
The JVM ecosystem remains unbeatable in my eyes. As soon as you try to build real applications, you quickly reach the limits of just Swift; the lack of access to native APIs is truly felt, and Kotlin Native handles this very well.
d
I understand wanting to create an app specifically for macOS.
Well, I'm a Linux/Gnome user through and through, and I feel the exact same need but for Gtk4! 😂
but you can create with kotlin and gtk, if you want kotlin native you can use https://gitlab.com/gtk-kn/gtk-kn but it's not compose, it's gtk in kotlin
https://github.com/compose4gtk/compose-4-gtk And if you want to stay within the JVM ecosystem, you can test this.