4 ms·
Under list of (end-user) language features, the author says: > I also think garbage collectors add more complexity than manual management That's quite the con
by andsoitis 3y ago
Under list of (end-user) language features, the author says:
> I also think garbage collectors add more complexity than manual management
That's quite the controversial statement and flies in the face of what GC has enabled in software development generally over the last few decades.
I would be excited to understand some examples where this is the case and they outweigh the benefits that GC brings to developing software (incl. games).
In the author's list of similar languages (https://macoy.me/code/macoy/cakelisp/src/branch/master/doc/VsOtherLanguages.org https://macoy.me/code/macoy/cakelisp/src/branch/master/doc/V...) they mention two other lisp-like languages without GC: Liz (transpiles to Zig) and GameLisp (seamless Rust API).
- jarodwr 3y agoI think one could make the argument that when you're producing high performance real time applications, diagnosing why your GC pauses and trying to find workarounds/fixes can take a lot longer than just managing the memory yourself. There's a lot of techniques like object pooling that people use in unity because .NETs GC isn't really built to handle how dynamic some of these applications end up being.
- andsoitis 3y agoObject Pooling is pretty straightforward and is also effective for non-GC environments.
- mattnewport 3y agoIt's not a particularly controversial statement in the context of games. Many commercial games are still developed entirely or primarily in non garbage collected languages like C++. Even Unity which uses garbage collected C# for game code is still a C++ engine under the hood for much of the performance critical engine code. Having worked in games and VR development for many years I can say that memory management was not a major problem in C++ and for tricky areas of memory and resource management like GPU memory garbage collection doesn't generally help you. When it comes time to optimize memory usage and performance it's often easier when memory management is explicit, deterministic and visible as well as highly customizable than when you have to work with a garbage collector which is a bit of a black box and has a lot of non deterministic and unpredictable behaviour. Even after working for several years primarily in Unity with C# I still tend to prefer non garbage collected languages for games.