4 ms·
Maybe this type of program is better suited for a language like Rust. However, while not having a GC, you have to take care of all memory issues in a way that
by vog 11y ago
Maybe this type of program is better suited for a language like Rust.
However, while not having a GC, you have to take care of all memory issues in a way that you convince the compiler that your won't ever blow up.
It would be very interesting to have such a comparison, so we could see whether it's easier to work around the GC, or easier to write bullet-proof code with manual memory management.
I'd expect the Rust to be more robust with regard to performance, but the question is: Would it also pay off in term of code complexity?
- pcwalton 11y agoI don't want to argue specifically that Rust is the solution here, because I think using Go with offheap is a perfectly fine solution. But I do think that the code complexity for a trivial hash table with striped locking can't possibly be higher than the complexity of serializing everything into a giant byte array and maintaining offsets into that array into a map which you make sure doesn't have any pointers in it.
- merb 11y agoif you understand functional paradigms, rust is actual easier to understand in larger programs
- mhd 11y agoI'm not sure how the current implementation of Go handles it, but its spiritual relatives Modula-3/Oberon handled this quite well, with a GC for most occasions and ways to bypass this with "unsafe" modules that allowed for untracked allocations/deallocations and pointer arithmetic. It's not really an either/or situation by (language) definition...
- pjmlp 11y agoYes, it is quite sad that the massive industry adoption of Java and .NET forced those languages into extinction. Although from all mainstream languages, C# is probably the closest in spirit to Modula-3.
- stcredzero 11y agoI'm puzzled as to why all mature GC doesn't have "permspace."
- schmichael 11y agoGo's GC is non-moving and therefore cannot be generational. http://llvm.cc/t/go-1-4-garbage-collection-plan-and-roadmap-golang-org/33 http://llvm.cc/t/go-1-4-garbage-collection-plan-and-roadmap-...
- pcwalton 11y agoNitpick: you don't need moving GC for generational GC. But you lose most (but not all) of the benefit of generational GC without moving GC.