https://kotlinlang.org logo
#getting-started
Title
# getting-started
a

Advitiay Anand

01/28/2022, 9:18 AM
Hi, I'm new to Kotlin and am having a hard time understanding the various target platforms Kotlin has: • JVM • JS • Kotlin/Native How are these different, and what is common to all of them?
j

Jochen Guck

01/28/2022, 9:34 AM
You can tack a look at this simple mpp project https://github.com/benasher44/uuid. It is bringing UUID to the different targets. In short common holds the generic code. The targets the platform specific one.
a

Advitiay Anand

01/28/2022, 10:03 AM
@Jochen Guck Thank you for replying I was kinda hoping for a 2-3 line response. Just to get a very high level perspective on why we need separate target platforms.
j

Jochen Guck

01/28/2022, 10:09 AM
For cross platform programming. You can reuses al common code on all platforms (e.g. android, ios, jvm, ...). Or access platform specific topics in a generic way (e.g. Bluetooth, Sockets, ... )
1
💡 1
a

Advitiay Anand

01/28/2022, 10:29 AM
Thanks, that helps!
4 Views