3 ms·
> It's also not dogmatic. You can use mutable and immutable versions of the same data structure. However from their description and the complexity promises it
by masklinn 5y ago
> It's also not dogmatic. You can use mutable and immutable versions of the same data structure.
However from their description and the complexity promises it looks like the immutable collections are literally just the mutable ones without mutation ability (similar to Java's immutable* wrappers) which greatly limits their effective usefulness.
> Full API is here: https://janet-lang.org/api/index.html https://janet-lang.org/api/index.html
Sadly even worse than clojure's which is already not great.
- nuclearnice1 5y ago> which greatly limits their effective usefulness. Interesting Why? And what’s the alternative implementation?
- masklinn 5y agoPersistent collections with structural sharing (b-trees, HAMT, RRB-vectors, …). I can absolutely understand not using them if the implementation is intended to be simple or the systems it's running on is resource limited, but simply removing the mutation bits of mutable collections is quite limiting as it incurs large overhead when actually working with them (you have to copy the entire thing every time you want to update anything). Unless the collections are always kept quite small: modern architectures are very good at dense arrays, so modern immutable data structures are trees of small-ish arrays (usually a small number of dozens, IIRC Clojure uses 32-wide nodes).
- nuclearnice1 5y agoI learned a lot. Thank you
- creata 5y ago> Sadly even worse than clojure's which is already not great. I thought Clojure's immutable collections were generally considered good. What else would you consider "great"? Edit: or was that a complaint about the quality of the documentation, not the quality of the immutable collections?
- masklinn 5y ago> Edit: or was that a complaint about the quality of the documentation, not the quality of the immutable collections? Yes, sorry if that wasn't clear.
- bjoli 5y agoI think the HAMTs are pretty darn solid. I think, however, that scala raised the bar with RRB trees over the trie-based immutable vectors. And using java strings is pretty sad...