I dont know if this is the right place to ask the ...
# kotlin-native
i
I dont know if this is the right place to ask the questions I've got or not... before I unload I'll briefly describe what I'm working on and if I'm in the right place I can respond to this with more. Otherwise, please let me know, and if possible point me in the right direction! Thanks 😄 I am making a program for personal use and personal educational purposes that interacts with my Windows 10 and helps me automate and manage my desktop windows and applications. I am using a lot of stuff from
com.sun.jna
which is why I'm not sure if it even counts as native in this regard. I have questions about the interactions between my code and the native code, and in particular about cleanup, especially with debugging. Also if I could approach this with the actual Kotlin native features in a better way, I'd love any tips!
m
If You are only targetting windows I would go with kotlin-native. It should be faster than JNA. But it depends on what You do, bc right now kotlin-native offers only some basic types and POSIX out of the box. The rest you would need to generate yourself with
cinterop
tool : https://kotlinlang.org/docs/native-c-interop.html
https://github.com/Kotlin/kmp-native-wizard -> This sould be a good starting point
❤️ 1
i
Thank you for the reply 🙂 I started to play around with kotlin-native yesterday to see where it took me.. a lot of my stuff is running on the jvm and i think probably has to, I would just be using native for the interactions with the desktop... I'm not sure if there's a good way to do both?
m
Unfortunately there is no interop between kotlin for JVM and kotlin native yet 😕 So at the end of the day you would still need to do JNA/JNI from your java part to the native part There is this library that claims to make it easier but I have not tried it https://github.com/deepmedia/Knee
1
❤️ 1
i
my only idea would have been some kind of socket communication between two separate programs... but I will check that out as well and see 😄
💡 1
m
That's an interesting idea. Let me know if you will succeed with this, I would love to migrate away from JNI in my project 😆
😎 1
1