Re:Hell Is Other REPLs
by pitaj on Sunday August 29, 2021 @11:28AM
(#28347484)
And in Rust you can always drop down to reference counted heap allocated stuff as well.
[ Parent
| on HN ]
Re:Hell Is Other REPLs
by tsimionescu on Sunday August 29, 2021 @12:19PM
(#28347995)
Reference counting has completely different properties than other forms of automatic garbage collection. In particular, reference counting still requires some amount of ownership tracking, whereas this concept just doesn't exist (for memory resources) with tracing garbage collection.
This is particularly relevant for certain algorithm, such as atomic initialization, that get significantly more complex with in-line ownership tracking.
On the other hand, Rc turned out to be just what I needed for a particularly complicated data structure that we use.
http://db48x.net/reposurgeon/rust-port-docs/reposurgeon/path...
Also, because of Rust’s wonderful type system it will be fairly straight forward to replace the string keys in this code with interned strings instead. (The amount of strings we use for paths in a large repository is pretty astounding.) That might now be almost possible in Go, if I learn the new generics.