-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Kotlin/Native Support #15
Comments
Are there any bottlenecks preventing you from also targeting native? |
No, there's no bottleneck. |
Got it, I was able to parse a csv with okio's new multiplatform file system feature so I'm all good now. You might find it interesting. |
@doyaaaaaken my team is interested in multiplatform version of kotlin-csv. We are developing a client-facing SDK that cross-compiles to JVM/Android/iOS/JS (both browser and NodeJS). I understand that some features would be unimplementable, specifically those working with files from browser, so some analysis would have to done in that respect. We can probably even spare some manpower to work on enabling such support in kotlin-csv if you agree on the general direction. |
@itegulov As you can see from the following code, the common code is in the form of receiving String type as an argument, and the rest is defining methods to receive each platform's own type (java.io.File type for Java) as an argument. The first thing we would like to do is to make the minimal code defined in [the multiplatform code](https://github.com/doyaaaaaken/kotlin-csv/blob/master/src/commonMain/kotlin/com/github/doyaaaaaken/kotlincsv/client/ |
@doyaaaaaken I see. Let me take this discussion internally and I will get back to you on our plans. |
The Kotlin/JS feature is implemented by #30. (released at version 1.0.0.) |
I don't know why this library is listed as "A pure kotlin simple csv reader/writer." when it only supports Kotlin JS or Kotlin JVM (and not actual Kotlin native). What would be needed to take it completely Kotlin native actually? |
Desperately hope to be able to support kotlin/common. I wanna phrase the csv in my shared module of KMM project, but I don't have a good way. |
@onekinn1023 Multik isn't needed if you are okay with lists of lists.
|
I'm currently parsing line by line with pure kotlin code in my common module of KMM, but the resulting problem is that the format requirements of the source data need to be very standardized, and the maintenance of the code is also very troublesome. So I'm looking for a way that can be directly parsed from csv into a model or something... All in all, thanks for your @luca992 reply. |
I guess the easiest solution would be to split the current library into two modules.
The first part could be truly multiplatform. The 2nd part could support the targets we have in place already and use the 1st part as a dependency. In my personal preference, I'd even use okio for the second bit since you can't beat their APIs and I'm already leveraging it anyways. |
Yeah so I quickly copied the sources into my project and was able to get encoding / decoding support on Kotlin Native. My implementation for |
Splitting the common logic from the i/o is a good approach. It's been a couple of years since I looked under the hood of this library when I submitted #87. It may not be desirable to tie this library to Okio however since users may not want that dependency. Another approach would be to use Flows to communicate between the common logic and the platform-specific io, which could then be pluggable, with Okio as one implementation option. |
kotlinx-io could be another option, which may be more acceptable to have as a direct dependency. |
https://kotlinlang.org/docs/reference/multiplatform.html
The text was updated successfully, but these errors were encountered: