by titzer · 1w ago · 0 comments
This is true of your basic moving collectors. It's generally not true of reference-counting collectors (including Bacon-style cycle detecting collectors). It's also not true of tracing collectors that have a step of sweeping all live and dead objects, such as mark-sweep or mark-compact.
GC is not memory efficient.
If a primary concern is optimizing memory usage, you will avoid GC languages.
You are right, though, that in a very memory-constrained environment, usually embedded devices, you may want to lower memory consumption regardless of anything else, and in such environments moving GCs are probably not what you want (although other kinds of GC could be).
More here: https://youtu.be/xr73mR7ii9M
Rust is not the silver bullet its community is trying to meme it into being. Its approach to memory allocation only works in some cases, the rest of the time you're back to refcounting and the potential for leaks.
For AI it's especially bad because they never memorize full codebase context in the way an experienced dev would, so it all becomes very dependent on how your codebase is structured and how you prompt it. GC just eliminates all those bugs and the associated token cost of trying to find and fix them.