4 ms·
And in Rust you can always drop down to reference counted heap allocated stuff as well.
by pitaj 5y ago
And in Rust you can always drop down to reference counted heap allocated stuff as well.
- db48x 5y agoThat’s true; the prototype uses Rc/Arc for things where I don’t yet know for sure how the ownership should really work out, and doubtless a fair amount of that will stay.
- tsimionescu 5y agoReference 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.
- db48x 5y agoOn 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/pathmap/index.html 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.