String.kt for example will use String.java on the ...
# getting-started
f
String.kt for example will use String.java on the JVM?
d
That depends on the type and the platform. For Strings you will get
String.java
on the JVM and a plain
string
in JS for example. But if the target platform does not have a native version of the type, it will be emulated (
Long
for example is emulated by a class containing two 32 bit numbers on JS, because JS only has a 64-bit floating point).
f
thanks
thats why these classes look so "imcomplete" (i.e. no method bodies, no actual value holder etc)
Yes, a big part of those classes is "compiler magic"
f
ah thanks I remember that
d
(I am sure there is something for native, too, but I am not experienced with that)
The only thing that (currently) is a bit strange is
Float
on JS, because it behaves identical to
Double
. But this will change in a future version.
Here is the closest I could find for native: https://kotlinlang.org/docs/reference/native/c_interop.html
f
thanks for the link