Re:Immutable.rs: immutable data structures for Rust
by bjoli on Friday April 06, 2018 @04:29PM
(#16777101)
I you are into immutable and c++ you should really have a look at Immer by Arximboldi (who is a user here on HN). Really amazing stuff: https://github.com/arximboldi/immer
[ Parent
| on HN ]
Re:Immutable.rs: immutable data structures for Rust
by m0meni on Friday April 06, 2018 @04:42PM
(#16777217)
The other immer[0] of note is a JS library that gives you immutability with a mutable API i.e. you mutate your code as normal, but all changes are proxied to a copy, which is then returned as a result of your mutations.
Re:Immutable.rs: immutable data structures for Rust
by cryptonector on Friday April 06, 2018 @06:06PM
(#16777899)
Sounds a lot like jq's jv API: https://github.com/stedolan/jq/wiki/C-API:-jv
Re:Immutable.rs: immutable data structures for Rust
by arximboldi on Monday April 16, 2018 @10:17AM
(#16849135)
Thanks for mentioning Immer! I am studying Immutable-RS right now and it seems interesting. The code is much more straight-forward than Immer's thanks to Rust expresivity when it comes to sum types, etc. Sadly, on the other hand, some of the tricks that Immer implemented, in particular the ones that flattens leaf nodes, can not be implemented in safe Rust, and I my guess is that Immer is at the moment more efficient both in run time and space usage. I would love to see some benchmarks comparing both though!
Re:Immutable.rs: immutable data structures for Rust
by widdershins on Friday April 06, 2018 @06:06PM
(#16777895)
Yeah I've been using this to make a interpreted Clojure-style lisp with immutable data structures. Great library.