News for hackers. Stuff that matters.
Re:Removing garbage collection from the Rust language by pron on Monday June 03, 2013 @09:51AM (#5813228)
I know nothing of the GHC GC (though the JVM has had a parallel, generational GC for many years, and is probably considered the least advanced of the JVM GCs), but BEAM's GC, as you mentioned, is per-process, and thus does not help with shared data structures (which do exist in Erlang, namely ETS).
Re:Removing garbage collection from the Rust language by mietek on Monday June 03, 2013 @10:23AM (#5813417)
It's not valid to say BEAM VM's per-process GC doesn't help with shared data structures, as there are no shared data structures in Erlang.

ETS acts like shared memory, but is not, in fact, shared memory. ETS tables are kept in a separate memory region from process heaps, and aren't automatically garbage collected. They are destroyed when their parent process terminates, or manually.

Per-process GC is a natural consequence of the way systems are built in Erlang, which often involves using hundreds of thousands of short-lived processes. This decreases a system's GC load, as entire process heaps can simply be destroyed when their process terminates, without needing to be traversed. There's also no need for a stop-the-world GC pause.

Re:Removing garbage collection from the Rust language by pron on Monday June 03, 2013 @10:39AM (#5813510)
Sure, but the fact that ETS tables exist shows that even Erlang recognizes the need in shared data. The fact that ETS tables aren't garbage collected is a limitation (and ETS tables have other limitations, too, like not supporting multi-object transactions).

The Erlang GC cannot be compared with Java's GC. It is not "better" or "worse". Erlang's GC wasn't designed for better throughput but to ensure complete isolation. Erlang values isolation over everything else because it is at the core of Erlang's fault tolerance philosophy. In Java, a task could trigger a collection that could potentially block all other threads. This can't (I think) happen in Erlang. But the JVM's GC has many other advantages.

Re:Removing garbage collection from the Rust language by mietek on Monday June 03, 2013 @12:00PM (#5813992)
> multi-object concurrency

I'm not familiar with this term, and it doesn't seem googleable. Can you give a definition?

> The Erlang GC cannot be compared with Java's GC.

And yet, by saying "the only really-good GCs are found in the JVM", you compare all GCs.

Re:Removing garbage collection from the Rust language by pron on Monday June 03, 2013 @12:09PM (#5814037)
multi-object concurrency

Sorry. I meant multi-object transactions. Slip of the finger.

And let me qualify: good GCs that are relevant to solving that problem GCs are essential for, namely concurrent data structures. Erlang doesn't have a GC that's relevant (I really like Erlang, BTW).

Re:Removing garbage collection from the Rust language by mietek on Monday June 03, 2013 @12:57PM (#5814333)
Then surely you know support for transactions is built as a layer on top of ETS?

I actually don't like Erlang as a whole, because it lacks a static type system, but that's besides the point.

I reject characterising the BEAM VM's GC as not-really-good, especially in concurrency context. I believe the immutable, shared-nothing, message-passing model is a superior solution to the data problem than the threads-and-locks model. Actual memory sharing is an optimization which can be applied by the runtime system, as it's done for binaries in Erlang.