Hacker News new | past | comments | ask | show | jobs | submit login

Both Rust and Go have GCs. It is true that Rust has mostly per-thread GC, which should help to curb performance concerns quite a bit. And Rust aims to have more explicit control over where things are allocated. But it's still a GCed language.

Whether GC is acceptable in systems work depends on what you construe as "systems work" (kernels and GC don't mix nicely; browsers and GC is OK if you're careful).




I'm not an expert systems programmer by any means, but I think that Rust makes a distinction between garbage collection, reference counting, and its region system. There are ways to allocate structures in memory using any of those systems depending on your needs.

If you're willing to be unsafe, it should be possible to avoid most (any?) overhead from automatic memory management. Here's a quote from one of the Rust developers:

"So we basically use the runtime for three things: (a) the task system, which features lightweight threads like Go or Erlang; (b) stack checks and growth; (c) garbage collection. We used to use it for more, but lately more and more stuff has been moved out of the runtime to be written in Rust itself.

"I'd like to see a 'runtime-less Rust' myself, because it'd be great if we could implement the Rust runtime in Rust. This might be useful for other things too, such as drivers or libraries to be embedded into other software. (The latter is obviously of interest to us at Mozilla.) Rust programs compiled in this mode would disable the task system, would be vulnerable to stack overflow (although we might be able to mitigate that with guard pages), and would require extra work to avoid leaks, but would be able to run without a runtime.

"If anyone is interested in this project, I'd be happy to talk more about it -- we have a ton of stuff on our plate at the moment, so we aren't working on it right now, but I'd be thrilled if anyone was interested and could help."


Graydon has been adamant that Rust must provide the ability to avoid tracing GC if the programmer wants. I was at first skeptical, but now I'm fully on board. For things like browsers, control over memory management is crucial.


My understanding is it's GCed depending on types used meaning you can bypass GC if needed.


Rust allows unsafe code and pointer use in the absence of GC.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: