-
Notifications
You must be signed in to change notification settings - Fork 39
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
Publish as a Multiplatform Library #8
Comments
Do you mean KClass in
If the problem is reflection, then it is just necessary to remove the dependency. Could you tell me in more detail, maybe I misunderstood. Could you tell us what operations you use in your application? Multik lacks a lot of matrix operations, we are working on adding and supporting new operations. Therefore, understanding the priority will help us. |
I was able to copy multik-api/src and multik-jvm/src into my project under src/commonMain. It compiled with a 1-line change, removing multik/multik-api/src/main/kotlin/org/jetbrains/kotlinx/multik/ndarray/data/DataType.kt Line 75 in 50f3a3b
With that removed, multik-api and multik-jvm are effectively compatible to be published as Kotlin Multiplatform libraries. After removing that one line, the remaining step would be changing the gradle build scripts to apply the multiplatform plugin and moving the code to The specific multik APIs I use aren't super relevant, as my feature request is just to publish as multiplatform which is 99.9% of the way there. Although I can still get back to you on those for general feedback purposes. |
@occultus73 #20 just converted multik-api, multik-jvm, multik-default to use the multiplatform plugin and added native targets for multik-jvm! |
Nice man. I will try it out next week when I'm back from holiday. To implement in my codebase I will also need support for JavaScript targets. I had a little trouble with number types getting js to work. The problem is if you ask JavaScript whether a number is a byte, or an int or a float or whatever, it will just say "yes" indiscriminately. As you know, there's when statements in multik that do this, and byte is the first in the list. So all numbers where being truncated to Byte values. Not good! My project only used double matrices, so I just pushed "is Double" to the top of the when clauses, and fixed the problem. |
@occultus73 haven't done much with targeting js so didn't try that out. Are there existing test cases that would fail when multik targets js? |
I never actually ported the unit tests in anticipation that I wouldn't have to maintain the code long term like I would with Apache math. Relying on you man! But yes more than a few would almost certainly fail for the reason I described. |
Js with fixes for this issue is now included in my multiplatform pr #20 now btw |
Awesome man. Look forward to this being merged and released. If JetBrains wants to make multiplatform a success they need their incubated libraries to jump on the train 🚂. |
This is a feature request to publish Multik as a Kotlin Multiplatform library.
My use case is that I've developed a multiplatform application for processing a lot sensor data, and we're currently using some non-optimal home grown matrix operations. Being able to leverage Multik would be a great improvement, however I need to be able to consume it as a mutiplatform library.
Multik's "JVM" implementation is effectively multiplatform compatible already, with only one method touching the JVM class library (
DataType.kt
has one line using reflection which could be quickly removed).This feature request mostly involves changes to how the library is published, as opposed to changes to the library code itself.
The text was updated successfully, but these errors were encountered: