Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Turtle a Kotlin Multi-platform library #116

Open
3 tasks done
jmfayard opened this issue Aug 5, 2022 · 3 comments
Open
3 tasks done

Make Turtle a Kotlin Multi-platform library #116

jmfayard opened this issue Aug 5, 2022 · 3 comments
Labels
type:enhancement New feature or request

Comments

@jmfayard
Copy link
Contributor

jmfayard commented Aug 5, 2022

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

Additional context

I did something like that for https://github.com/jmfayard/kotlin-cli-starter

@jmfayard jmfayard added the type:enhancement New feature or request label Aug 5, 2022
@lordcodes
Copy link
Owner

lordcodes commented Aug 5, 2022

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.

@lordcodes lordcodes changed the title Turtle multiplatform? Make Turtle a Kotlin Multi-platform library Aug 5, 2022
@jmfayard
Copy link
Contributor Author

jmfayard commented Aug 5, 2022

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

@lordcodes
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants