turtle
turtle copied to clipboard
Make Turtle a Kotlin Multi-platform library
Describe the problem
I wonder how hard it would be to move turtle to become a Kotlin multiplatform library.
The JVM is fine but a Kotlin native executable is faster and a node js script is easier to distribute.
Describe your solution
If it depends only on File and ProcessBuilder it's probably doable to have an abstraction over those Java APIs to leverage equivalent on Node.js and Native
Checklist
- [x] I've read the guide for contributing.
- [x] I've checked there are no other open pull requests for the feature.
- [x] I've checked there are no other open issues for the same feature.
Additional context
I did something like that for https://github.com/jmfayard/kotlin-cli-starter
I would love to see Turtle become a Kotlin multi-platform library. The main constraint is just the time to make the changes, as personally I use Turtle exclusively in Gradle tasks, which use Kotlin/JVM so haven't needed it.
It is actually something I have wondered about doing for a while, but haven't committed the time to doing it yet.
I will leave the issue open, as it is something I would like to see.
It feels like it should work in Kotlin/Native, however, my gut feeling is it won't work or be necessary with Kotlin/JS.
It is actually something I have wondered about doing for a while, but haven't committed the time to doing it yet.
I think the most painful part would be the publishing and setting up GitHub Actions part. It probably would be best to ask someone who already did this.
my gut feeling is it won't work or be necessary with Kotlin/JS.
I got something similar to ProcessBuilder work for Node.js
https://github.com/jmfayard/kotlin-cli-starter/blob/5201ee91122b4572d40167e7fbfae2f341ce5dfb/src/jsMain/kotlin/io/JsActuals.kt
The pro for using Node is that distributing thing on http://npmjs.com is much easier than with Kotlin's package manager... which doesn't exist
Ah okay interesting. I guess I was thinking of JS running in the browser and wasn't thinking of JS for CLI tools, that makes perfect sense.
That's really good to know and your examples are really good. I am actually going to be looking more into Kotlin Multiplatform soon as want to start using it in the main mobile app project I work on, so will keep Turtle in mind when I come to start looking into that!