Comment by 9rx

9 hours ago

So does Rust. Rust is 'smarter' than Limbo, in that it can avoid using its GC in a lot of cases (but not all, hence why it still has GC to fall back on when necessary), but, I mean, that discovery was the reason for why Rust was created. Limbo was already there otherwise. Every new language needs to try to add something into the mix.

Still, the thoughts were in common, even though the final solution didn't end up being exactly the same.

Rust does not have a garbage collector in any way or form. It's just automatic memory like we're used to (e.g., stack in C++), with the compiler injecting free/drop when an object goes out of scope.

What Rust brings is ownership with very extensive lifecycle tracking, but that is a guard rail that gives compile-time failures, not something that powers memory management.

(If you consider the presence of Rc<T> to make Rust garbage collected, then so is C garbage collected as developers often add refcounting to their structs.)

  • > so is C garbage collected as developers often add refcounting to their structs.

    Absolutely, C also can use a garbage collector. Obviously you can make any programming language do whatever you want if you are willing to implement the necessary pieces. That isn't any kind of revelation. It is all just 1s and 0s in the end. C, however, does not come with an expectation of it being provided. For all practical purposes you are going to have to implement it yourself or use some kind of third-party solution.

    The difference with Limbo and Rust is that they include reference counting GCs out of the box. It is not just something you have the option of bolting onto the side if you are willing to put in the effort. It is something that is already there to use from day one.

Are you trying to say that Rc/Arc are GCs? I guess you're technically correct, but no one sees it that way.

  • I would say that RC is GC, yes, as it is most definitely technically true. But it was pjmlp who suggested it originally (Limbo also uses reference counting), so we have clear evidence that others also see reference counting as being GC. We wouldn't have a discussion here otherwise.