For a project I was evaluating starting in Kotlin/...
# kotlin-native
l
For a project I was evaluating starting in Kotlin/Native, I need to compile for targets outside of what K/N currently supports (currently freestanding with no OS). I can handle the LLVM args and cinterop myself, but I was wondering if there's a problem with setting the target to linuxX64 and overriding the clang-args. It looks like K/N needs a cxxabi binary, so I'll have to compile one freestanding and link that. Has anyone else tried this? If I expand to other architectures, such as RISC-V, can I keep the target linuxX64 and override the arch with clang-args?
It would be nice to have 'no target' as an option and just give pure LLVM args.
n
Are you after Bare Metal target support?
Kotlin Native targets are always tied to a CPU architecture/OS which cannot be changed.
Every time you want to have Kotlin Native support a new CPU architecture, or OS you would need to rely on the Kotlin team to provide a new target, which they may or may not do depending on the circumstances.
It is far too difficult to port Kotlin to additional platforms. Porting is not one of Kotlin's strong suits. Every attempt made by the Kotlin community to port Kotlin Native to an additional platform has resulted in failure.
l
That's disappointing. Do you know what causes this? I noticed that K/N now includes its a malloc implementation (mimalloc), and was hoping that signaled the runtime moving towards being more platform-agnostic. I can put the project on hold and see how K/N improves over time.
n
Here are some of the key factors that hinder porting Kotlin to additional platforms: 1. The Kotlin code base frequently has major changes that break porting 2. Kotlin has no standard porting system 3. Documentation for porting Kotlin to additional platforms is non existent 4. Very difficult to find up to date Kotlin porting examples 5. Backwards compatibility isn't guaranteed with porting 6. Porting Kotlin requires intimate knowledge/skills/experience that only certain Kotlin team members posses
l
That makes sense. Hopefully as K/N becomes more stable, porting becomes easier.
👍 2
n
Porting should be one of the Kotlin team's high priorities with Kotlin Native when the time comes to stabilise the technology.