Nice, they are saying exactly the same as those pesky game developers.
Nice, they are saying exactly the same as those pesky game developers.
"It's interesting that many games can afford a constant 10x interpretation overhead for scripts, but not a spikey 1% for garbage collection."
https://twitter.com/timsweeneyepic/status/880607734588211200
https://wiki.unrealengine.com/Garbage_Collection_Overview
Which was it again, the engine chosen by Nintendo, Microsoft and Google as first party to their 3D APIs?
https://developer.nintendo.com/tools
https://docs.microsoft.com/en-us/windows/mixed-reality/unity...
https://stadia.dev/blog/unity-production-ready-support-for-s...
https://developer.android.com/games/develop/build-in-unity
The anti-GC crowd on the games industry, is no different than the ones that fought adoption of C/Modula-2/Pascal over Assembly, and then fought adoption of C++ and Objective-C over C.
Eventually they will suck it up when the major platform owners tell them it is time to move on.
Why is that surprising?
Games are basically about humans predicting things and random spikes prevent that from happening in time sensitive games. Beyond game play implications, I suspect there's also something about jerkiness in movement that bugs human senses.
It's not a very satisfactory answer (and there are likely much better tradeoffs to be made), but given the 10x and 1% comparison (not entirely apples to apples though) the comment sounds a bit more interesting.
Performance-oriented code implies everything is on the stack and/or packed into large arrays, at which point you don't need a GC after all.
As the truism goes, if you require your software to be performant, you must first make Performance a Requirement.
In my mind performance is alway a requirement (and a feature). We just stopped caring a long time ago, because it is easier to think about performance as a hardware or capacity problem, memory as GC problem and so on.
1. https://blog.discordapp.com/why-discord-is-switching-from-go...
That's how I've been thinking about it with Haskell at least (lots of GC knobs, manual performGC hook, compact regions for having long-lived data, good FFI, as high-level as any scripting language you could hope for)
The point was, they said "do manaual memory management" if you want speed.
It seems to me that this is where the GC “set and forget” model really shines, since otherwise you just have to do all that work manually using an allocation and a free, or a constructor and a destructor, or some similar pattern. Perhaps Rust has some clever answer for this?
The issue is not really the scope, the issue is how many owners the data needs to have. A variable that needs to live longer than a scope, but only has a single owner, can be directly returned from that scope. Once you have the need for multiple owners, the most straightforward answer is "reference count them," but it depends on your exact requirements.
> A typical example here would be a UI framework, where memory has to be managed for the window and its widgets, and then the entire application is suspended until the next event.
GTK heavily uses reference counting. People are also investigating what a "rust-native" UI toolkit would look like; taking strong influences from ECSes. It's an open question if those architectures end up better than refcounts.
Similar to C++'s std::shared_ptr