is there a summary how Kotlin/VM differs from /JS ...
# getting-started
f
is there a summary how Kotlin/VM differs from /JS and /Native?
r
You can ask in #multiplatform, but I'd recommend being a little more clear on what you mean by "differs".
f
I am not sure myself what that means
that's the problem
r
Then you'll probably have a hard time finding a useful answer.
c
Kotlin/JVM compiles to Java classfiles, and to the JVM look just like a normal Java class. Kotlin/JS transpiles the Kotlin code to the equivalent Javascript source, and is typically then bundled with other JS modules using Webpack. Unlike JVM and Native, Kotlin/JS also includes dynamic typing for interop with existing libraries. Kotlin/Native has its own custom runtime embedded within the compiled binaries, and is generally suited to be imported as a C-like library in other natively-compiled languages or run as its own standalone executable.
👍 5
f
Thank you
but the language basics and the syntax are the same?
So someone learning Kotlin from a Kotlin/JVM tutorial would be able to apply much of it to Kotlin/JS?
"dynamic typing" sounds like something that breaks this assumption
r
For the most part, yes, but there are things that are specific to the platforms as well. The JS
dynamic
type is one. Working with concurrent code can be quite different on each platform. Native has some interesting stuff with immutability ("freezing").
The online reference has information about all that: https://kotlinlang.org/docs/reference/ Look under the sections "JavaScript" and "Native".
f
thanks, I will take a look at it
wow, that link is really helpful
r
Indeed. If you haven't read through all the online reference, I would highly recommend it. It's one of the absolute best documentation sources I have ever seen.