gluon
gluon copied to clipboard
Add a persistent vector type
The existing Array
type is implemented as a plain array which is nice for Rust interop (Array Byte
can be transformed into a &[u8]
at not cost). This plain representation is on the other hand inefficient if one wants to append to or modify elements in the array since the entire array needs to be copied on each modification.
As an alternative we should have a persistent vector type in the standard library which can be used if modification is frequently required.
This series of posts (found from https://github.com/orium/rpds) explains how these vectors are implemented in Clojure and seem to be a good start towards an implementation (currently browsing through them). https://hypirion.com/musings/understanding-persistent-vector-pt-1
Depends on #474
Another option might be https://github.com/bodil/im-rs
Another option might be https://github.com/bodil/im-rs
Doesn't seem to have an immutable vector type? In any case I think this type ought to be implemented in pure gluon (so any Rust implementation will only be useful for inspiration :) ).
I'd love to take a stab at implementing this if noone is actively working on this!
No ones working on this. Looking forward to it!