feel dumb... but ive mostly always been a java/kot...
# random
c
feel dumb... but ive mostly always been a java/kotlin dev. im dipping my toes into some js libraries (in an attempt to port some of it to kotlin 😂 ) but how do i run a javascript file? i know i can type commands into a browser console, and i know i can run
node myfile.js
to execute it. but is there no like...
javascript myfile.js
cmd or something? do i need to use node to execute a js file?
p
If all you want is execute some js code, You can use the browser, call your JavaScript code from an index.html page and open it in Chrome
But I guess is better to setup a proper js development environment. There are a few IDEs with good support including webstorm from JB
a
@Colton Idle i run my js files with node. i think u can use any other js runtime instead such as bun, but no there is no such thing as 'javascript' command.
c
interesting. so i guess since its not a compiled language. i just need a runtime (i.e. node). okay. makes sense. @Pablichjenkov i thought about that, but creating an html file just to execute some js felt "wrong" to me lol
💯 1
e
there's lots of javascript runtimes, many of which are available on the command line (v8's is d8, JavaScriptCore jsc, spidermonkey js, Rhino rhino, Nashorn jjs, etc.) predating nodejs
2
lately I've found https://deno.com/ to be the nicest to use though - it supports dynamic importing in the command-line shell and top-level suspend
c
very interesting! the world of js is still so foreign to me. thanks all for teaching
m
It would be great if someone could write a set of tutorials to teach you the basics of each KMP platform for people with a different background. I feel the same for iOS which is sometimes kind of a mystery for me because I have never programmed for it before and do not even have an iOS device.
s
In the case of iOS you can see in the Multiplatform template how it’s called. There is still native code. Swift is very similar to Kotlin - like a bad carbon copy attempt. 😄
m
I did not only mean this specific topic of running a piece of code. I’d like to have something like an annotated platform FAQ which points you to the things you have to know as a KMP programmer if you are new to this platform.
👍 2
a
agree on having some tutorials per platform. would have been a great help when i started. Started changing composables.com to be compose multiplatform focused and started adding how to get started on each platform, but doing that on the side
btw @Colton Idle i recommend not to get too adventurous on the runtimes. it can be overwhelming and you can get easily off-tracked. node is dead simple and well documented plus chatgpt is good at it. as always, newer tech is less documented, less stable etc
c
so in this case... im not even doing kmp stuff. im trying to port some js code from a github library into kotlin. lol. so i just wanted to get their code running and quickly learned that idk wth im doing. lol
but i do agree that itd be nice to have a little crash course on each platform for kmp lol
e
node is well known at this point but I would definitely not call it dead simple, there's tons of details and traps that have come from how it's grown historically
a
weird. i dont feel like i've hit any of that, but that might have been me