Re:Rust Is a Scalable Language
by vlovich123 on Tuesday March 28, 2023 @08:07PM
(#35350014)
I think if Rust could integrate a GC pointer elegantly into the ecosystem and put some of the knobs for running the GC the responsibility of user-space libs (ala pluggable GC), add in more optional type inference in places, and make it easy to refactor code to remove the GC, then it could become quite interesting for higher level glue code. As is, it’s not quite as good as TypeScript I think
[ Parent
| on HN ]
Re:Rust Is a Scalable Language
by HervalFreire on Wednesday March 29, 2023 @01:24PM
(#35360353)
There is a reference counting GC in rust. It's just not default and you have to be explicit about invoking it. It's similar to shared pointers in C++. See Arc.
For something like python the heap allocation or stack allocation is handled behind the scenes so the entire concept is abstracted away from you.
Re:Rust Is a Scalable Language
by vlovich123 on Wednesday March 29, 2023 @10:19PM
(#35366983)
I meant a tracing GC like https://docs.rs/gc/latest/gc/.
Arc still requires you to reason about ownership as does this GC.
I think single threaded async w/ easy no copy message passing is more akin to what most people want when thinking about concurrency (eg Go channels) and actually happens to perform exceedingly well when it’s done up and down the stack (eg io_uring). In such a model you don’t even need to worry about ownership so much because you can’t Send anything except for things that need to be so there’s not a lot of value in many of the protections Rust tries to put in place.