Kotlin / kotlinx.collections.immutable

Immutable persistent collections for Kotlin
Apache License 2.0
1.12k stars 56 forks source link

Add to the stdlib #130

Open JavierSegoviaCordoba opened 1 year ago

JavierSegoviaCordoba commented 1 year ago

After some investigation looks like Compose is going to use multiple approach to have stable elements (the current stdlib List, Set and so on aren’t).

There are two libraries androidx collections and this one.

Why this library doesn’t fit in the stdlib so we can have an standard solution which all frameworks can use?

qurbonzoda commented 1 year ago

Hi @JavierSegoviaCordoba, We currently don't see the collections from this library as part of Kotlin Standard Library. However, we have plans to promote this library to the "stable" status.

lyrjie commented 1 year ago

@qurbonzoda hello! What's the status on promoting it to stable and where can we track the progress? There seem to be no active work on the project for around 2 years and it still being marked "alpha" makes it hard to justify using it

Nailik commented 1 year ago

Any news on this? It's really an issue that there is no further development and linuxArm64 is still missing https://github.com/Kotlin/kotlinx.collections.immutable/issues/145

carstenhag commented 11 months ago

Replying to the "Compose is going to use multiple approach to have stable elemen" part, because I was also unsure what is recommended nowadays by Google:

The Compose documentation refers to kotlinx.collections.immutable:

Collections: Compose always considers collection classes unstable, such as List, Set and Map. This is because it cannot be guaranteed that they are immutable. You can use Kotlinx immutable collections instead or annotate your classes as @Immutable or @Stable. https://developer.android.com/jetpack/compose/performance/stability#summary

qurbonzoda commented 3 weeks ago

Hi everyone, Sorry for the late response. We are committed to advancing this library to a stable release. However, we currently lack the resources to develop the library rapidly. Before promoting the library to stable, there are some foundational API design issues that need resolution. I've outlined these issues here: https://github.com/Kotlin/kotlinx.collections.immutable/issues/185. Once we address these issues, we plan to promote the library to Beta. Promoting to stable will require us to process feedback from these design changes and make necessary adjustments.

I would like to emphasize that the implementations are already quite good in terms of both performance and quality. We do not anticipate any significant changes in these areas. Our main task now is to review and finalize the public API. Only then can we guarantee backwards compatibility.