To announce first release of ropes4k - an addition...
# feed
j
To announce first release of ropes4k - an addition to the popular forkhandles foundational library. Ropes are high performance Strings, where mutation is extremely efficient. It has no dependencies except kotlin runtime. It's on maven central, and the docs and code are at: https://github.com/fork-handles/forkhandles/tree/trunk/ropes4k
👍 5
👍🏾 1
K 3
r
Why not multiplatform?
j
Nobody asked for it yet.
r
s
If a library only depends on the Kotlin standard library, the effort required to make it multiplatform is minimal. By default, I would recommend making any new library multiplatform unless there are compelling reasons not to.
👍 3
2
💯 1
m
@Robert Jaros why multiplatform?
r
@marlonlom for broader adoption and Kotlin ecosystem growth
👍 5
2
m
Let’s be honest. For a developer who has no personal interest in multiplatform, publishing a library as a multiplatform library is a lot of extra work. This would be a good use-case for a universal Kotlin library if such a thing would exist. If Rust can do it, why not Kotlin? https://youtrack.jetbrains.com/issue/KT-52666/Kotlin-Multiplatform-libraries-without-pla[…]fic-code-a.k.a.-Pure-Kotlin-libraries-Universal-libraries
👆 4
s
publishing a library as a multiplatform library is a lot of extra work
I disagree. If it only depends on the Kotlin standard library or other multiplatform libraries, the additional work required is minimal, if any.
r
In this case the library does depend on a number of
java.*
classes, so probably some effort would be required. But still, this is just a request with some arguments, no one forces the author to do it if he doesn't want 🙂
👍 1
s
Okay, you are right. I didn't check the code. In the description he wrote:
It has no dependencies except kotlin runtime
Why the
java.util.ArrayDeque
dependency? 🤔
Given that it's a fork of the Java framework "Ropes for Java", it's reasonable to expect that the Kotlin transformation would introduce multiplatform support. Simply rewriting an existing Java framework in Kotlin, if it still only runs on the JVM, offers limited benefits aside from modernizing the code. So it's legit to ask. The primary reason I rewrote Apache Commons Imaging in Kotlin (= Ashampoo Kim) was to make its functionality available on other platforms.
b
Never heard of ropes to manipulate strings. What’s a typical use case for ropes?
j
I encourage you to read the linked page, where this is explained!
b
For sure I did. “Much faster string manipulations” because it uses a Tree. In order and reverse order access are fast. Access by index is less optimal. 👌 Can’t think of use case for ropes though.
h
Possible in the future, java or any jetbrain programmer/engineer will invest do multiplatform this library. Perhaps.
m
Ropes are often used in text editors to ensure they can edit large files
💪 1