Alternatives to the im crate?

Whenever I need a data structure which is cheap to share with copy-on-write semantics I'll normally reach for the im crate. However, it looks like the crate isn't being actively maintained.

Are there any similar crates you'd recommend for persistent data structures? The things I typically use are im::Vector, im::HashMap, and im::OrdMap.


Due to the backwards-compatibility guarantees of the Rust compiler, is there really a need for a data structure crate to be actively maintained? There’s no external protocol to change or anything like that, so it should continue to work as well as it has for years to come.

(That leaves open the question of whether its current state is good enough for your purposes, of course)

1 Like

You raise a good point.

Normally I wouldn't be too concerned because as long as I use a known version and write some tests, I can identify and work around any bugs I may encounter.

I guess the concern for me is that I'll be putting these types in my public API and it's generally not a good idea to have unmaintained dependencies in your public API. There was also a PR to the RustSec Advisory Database, but that was closed because they only mark crates as unmaintained with permission from the author or when the author is unresponsive.

EDIT: the im repo just updated stuff, so this is no longer relevant

In the case of the im crate, it is very much not! I'm personally a bit disappointed with such a big crate having gone unmaintained with no official mention of it whatsoever: whilst I perfectly understand somebody no longer having the time, will, etc. to keep maintaining a crate pro bono, I think that when a project reaches a certain critical mass, a decent courtesy is to be vocal about it going unmaintained, to let dependents be aware of that fact and try to switch to another one.

The following issue, for instance, which remains unsolved upstream, is a big killer for the crate as a whole, since it means the crate is semantically incorrect:

Incorrect behavior of `OrdMap::range()` for certain inputs · Issue #152 · bodil/im-rs · GitHub

  • (and good luck debugging that issue in the wild!)

despite the repo having received a PR to fix it almost two years ago:

Fix OrdMap removal/range logic by arthurprs · Pull Request #154 · bodil/im-rs · GitHub

The maintained replacement crate

that we thus use, at $work, is:


UPDATE: the aforementioned issue & PR just got fixed and merged, respectively, so it seems like im is back to life! :partying_face: :partying_face:

  • Since it's likely not to be a coincidence, it means this thread somehow reached their maintainer, Bodil. If that's the case I want to thank them for having kept the crate alive! :pray: