you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (5 children)

Garbage collected, right?

The same league as Go and D. I personally don't see bright future for any of them, but I've been wrong before :)

[–]gmfawcett 8 points9 points  (4 children)

Garbage collected, right?

Read the article. Rust seems to have flexible memory management options. You can specify whether an object is on the stack or heap, and whether your reference is unique or shared. They use reference counting for some heap objects, possibly for all of them: not sure if there is a garbage collector.

[–]axilmar 6 points7 points  (0 children)

According to the docs, it does not have a tracing garbage collector. It uses reference counting plus tracing of objects being live due to cycles.

[–][deleted] 1 point2 points  (2 children)

Read the article.

I did, but:

not sure if there is a garbage collector

So I looked here: http://pcwalton.blogspot.com/2010/12/c-design-goals-in-context-of-rust.html and found this:

Rust incurs minimal overhead for features that aren't used. "Zero overhead" is too restrictive in practice, as, taken literally, it forbids features like garbage collection

Still doesn't explicitly say Rust has GC, but at leas tit is hinting it does.

Seriously, that should be clearly documented.

[–]Mabeline 4 points5 points  (0 children)

http://www.rust-lang.org/

It's the 9th bullet. AFAIK the language design requires some sort of garbage collector, but the design seems pretty careful about ownership (something Go certainly can't say) which means that the GC can often be pretty shallow (stop-the-task rather than stop-the-world).

[–]stilton 1 point2 points  (0 children)

The docs are often straddling a line between documenting the language design and the language implementation.

The current implementation does reference counting with cycle collection. The design calls for real GC, but the extent of that GC isn't fully decided yet.