2

I am new to Kotlin native and stumbled upon kotlinx-datetime. Before that i was using jodatime in my android application; More specifically i was using andoid.joda.

I am wondering why these libraries are so platform dependant. What makes impossible to use e.g. jodatime in kotlin native and compile it's content to other paltforms like e.g. swift?

I had found this graphic in a Introductory video2 of kotlinx-datetime, but it only lists more libraries on different platforms and no real explenation.

enter image description here

f.b.
  • 490
  • 1
  • 5
  • 17
  • 2
    Joda time is written in Java whereas kotlin native is a compiler which converts kotlin code to native code. It's the lack of a solid date-time library in the pure kotlin ecosystem which means kotlinx-datetime was made. – enyciaa Mar 07 '21 at 23:08
  • Kotlin/Native cannot work with java libraries. It can compile Kotlin code to a native binaries, and link them with native libraries(which are platform-dependent, just as in C/Objective-C world). Related question: https://stackoverflow.com/questions/53169064/how-to-add-java-library-to-kotlin-native – Artyom Degtyarev Mar 10 '21 at 09:46

0 Answers0