:wave: how complicated would it be to have the kot...
# plugins
n
👋 how complicated would it be to have the kotlin backend implement multiplatform? is this on the radar by any chance? 🙂
👀 1
h
Tom is on vacation through this next week, he would be the best person to answer (not pinging to respect him being out)
So that this does not get lost: probably the best thing would be to open a GitHub issue describing what you're hoping for 🙂
h
We welcome contributions! If you’re interested then Tom (when he’s back) can help you get going.
❤️ 1
n
thanks! this may or may not be dependent with the js efforts
happy to contribute but i’m just learning pants now so maybe i’d take a smaller thing just to get going 🙂
❤️ 2
i added this: https://github.com/pantsbuild/pants/issues/16497 i recognise it is not detailed enough as there would need to be some discovery to find alternatives, attempts and how much can be stolen from the existing kotlin/java machinery in pants. thanks!
i will try to tinker with it, get some bash scripts doing what i want maybe, and then maybe see how i can get it in pants. i have too many unknowns now so gotta start somewhere 😛
👍 1
h
Usually the way to go is to start by figuring out what binaries need to run with which combination of args, on which source files, and whether transitive dependencies need to be present or not.
Then we can help hammer that into the Pants rule API
👍 1
n
👋 I did a bit of research in my playground. Js: •
kotlinc-js
is distributed as a binary and is just as straight-forward to invoke as
kotlinc-jvm
• Got a small project building and running from the command line • Generated files are normal js files, so they could be consumed or leverage the js rules when they exist. • As we’d need to pull the
kotlin
package from npm and use other things in the js ecosystems it seems until those rules are there it wouldn’t make much sense to invest too much in this. • Just for reference. Bazel already supports js specifically. Multiplatform: • I haven’t looked at KMM yet, but until/if there is iOS and/or Android support in please I think it doesn’t make much sense. • Gradle has a multiplatform abstraction with source sets (per target) and stuff. we could replicate something like this for convenience, but in the end the compiler ends up receiving a bunch of
.kt
files, so not a big dial.
h
That’s a great base to work from! I’d have to defer on the details to Tom when he’s back though. He (on vacation) and Chris (currently traveling to Kiwi PyCon) are our Kotlin knowers…
🙌 1
b
Bringing @fast-nail-55400 into the loop...
h
Tom is out this week so I didn’t @ him purposely
1
b
Oops, I was looking at the wrong week in his calendar. Sorry Tom!
f
I'm back.
If the Kotlin/JS compiler is written in a JVM language, then that would make it easier to invoke than if Pants would have to invoke Javascript/Typescript code.
glancing at the Bazel support, looks like jars are still involved in some fashion. some research into how Kotlin is turned JS step-by-step would be useful (i.e., how is compiler invoked, what is the output, how does that output get transformed into a deployment format whether for iOS/Android or Web)
so a description on an issue with that research would be helpful for someone to develop. I'm not going to have time for this so some community effort there will be good if there is interest.