3 ms·
Yes, it would. What languages have materially different GC semantics, other than Python on the cpython vm? (PyPy loses the fast collection at the end of scope
by ori_b 8y ago
Yes, it would.
What languages have materially different GC semantics, other than Python on the cpython vm? (PyPy loses the fast collection at the end of scope for efficiency reasons)
- chrisseaton 8y agoPython is the key one you already mentioned - it has deterministic semantics and most other language do not. Ruby also exposes parts of its GC, and allows it to be hooked by C extensions, so when I implemented it on top of the JVM I had to basically reimplement half of it in Java in order to implement those parts of the language.
- masklinn 8y agoErlang's allocation pattern is markedly different than e.g. Java's, in no small part because it's completely impossible for an object to refer to a more recent allocation than itself. More generally, immutability-heavy language would have quite different needs than mutation-heavy ones.
- ridiculous_fish 8y agoFinalizers and resurrection is a big way that GCs can differ. There's also exotic reference types: Java has WeakReference, SoftReference, PhantomReference...
- naasking 8y ago> What languages have materially different GC semantics Others have mentioned a few, and I'll mention another: GC support for concurrency. Try writing a performant Go interpreter in OCaml, for instance.
- __s 8y agoLua's got an annoying case of metatables directing whether a table's key/values are weak references or not (__mode & __gc)
- lpghatguy 8y agoLua also has the nasty case that __gc can throw!