Hi everyone, for those interested I wrote a small ...
# kotlin-native
f
Hi everyone, for those interested I wrote a small tutorial on Kotlin native. I would love to hear your opinion on it: https://superkotlin.com/kotlin-native/
👍 2
b
"reusing all native libraries" you can consume native code that follows the C ABI, but not easily consume C++, Rust, Swift, etc. without wrapping them in C
You out "konan.version" in the properties file but then explicitly specify the KN Gradle plugin version in the build dependencies. I guess that's ok, but I like having a single version truth.
Oh my, the macOS target is called macbook?
You state which OS KN supports, including Linux, but don't specify the target name for Linux.
Ugh, default extension for executables is kexe? KN folks, what were you thinking :p
Aha, you also found the def file mechanism lacking :) Guess I should send a PR for that.
setRGB demonstrates how painful bit fiddling is in Kotlin overall, which makes me very sad. Would be nice to get better bit fiddling support at least in KN.
@ftomassetti great article, a paragraph on native memory management would be nice, but other than that it's a very nice intro to KN.
f
Hi Mario, this is very helpful feedback. Thanks a million!
In the next day I will fix some of these issues and add your name in a note to thank you
n
Setup the project using the kotlin native gradle plugin
Instead of creating all the files, one could use
gradle init
👍 1
I feel like casually just mentioning the lack of editor support as a side note at the end of the article is not great
t
In setRGB, couldn't
rowBuffer.plus(3 * x + 1)!!.reinterpret()[0]
be written as
rowBuffer[3 * x + 1]
?
n
I did debugging in jvm version of kotlin and jvm version of cinterop
These are not the same as Kotlin native
b
Wait, cinterop works in Kotlin for the JVM? That'd be very surprising.
@ftomassetti no worries, happy to help. no need to mention me in a note 🙂
f
@nish right, editor support is a big deal but it should be clear that Kotlin native is something to be used in the future, not right now, in that sense I think editor support will not be a problem when the rest of the system will be more mature. Still, I should stress it more and sooner, thanks for pointing that out!