If my Kotlin library depends on JVM classes - is i...
# announcements
b
If my Kotlin library depends on JVM classes - is it best to just distribute it as a java library rather than a kotlin library?
r
What’s the difference?
b
Well, if my library was pure Kotlin and could be used by KotlinNative, or KotlinJS, etc. then i’d probably want it to be distributed differently.
but then again I guess that’s just a question of packaging anyway. But If i recall correctly with the latest version of kotlin there’s a way to distribute an all-kotlin library that isn’t quite JS, JVM, etc.
it’s in the IR format or something
r
I’d be surprised if you were intended to distribute the IR… wouldn’t it then require a runtime interpreter for each target, which would be pretty expensive I’d have thought? My uneducated assumption was that the IR was a compilation half way house to a common format that was then easy to compile into the target formats, allowing code sharing and efficiency gains when compiling for multiple targets, but that we would still distribute libraries in the different target formats. But I confess to that being pure assumption.
but I think it just builds libraries for every supported platform