6 ms·
> WebAssembly doesn't have a GC, and probably won't for some time. Yeah... because it's assembly. That's the whole point. You don't WANT a GC. It would be the
by overgard 11y ago
> WebAssembly doesn't have a GC, and probably won't for some time.
Yeah... because it's assembly. That's the whole point. You don't WANT a GC. It would be the wrong layer to place a GC in. Ask most professional game developers if they would consider using a platform with a GC. They won't, because you can't build a realtime system without stuttering if you're dealing with a GC.
- greggman 11y ago1000s of games have shipped with gc. Every Unreal and Unity game uses gc. Every XNA game used gc. Many of the largest most popular AAA games use gc. So yes we can ask professional game devs if they want a gc. Most will say "yes". Like any tool you know when to use them and when not to
- gruez 11y ago>Many of the largest most popular AAA games use gc Like, actual GC and not smart pointers? I would like a list.
- camgunz 11y agoThese days a great deal of game logic is scripted in a language with GC: C#, JS, and Lua mostly.
- cthalupa 11y agohttps://wiki.unrealengine.com/Garbage_Collection_Overview https://wiki.unrealengine.com/Garbage_Collection_Overview https://en.wikipedia.org/wiki/List_of_Unreal_Engine_games https://en.wikipedia.org/wiki/List_of_Unreal_Engine_games TSubobjectPtr are smart pointers, but regular pointers will still be garbage collected if they are UPROPERTY() and in a class derived from UObject Tim Sweeny talks about GC a bit in https://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced-fp/docs/sweeny.pdf https://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced... The presentation is a little dated, but they're still using GC, so...
- ndesaulniers 11y agoFurther, a lot of shared data structures in super high perf C++ end up with "Free Lists" to allow multiple threads to perform atomic delete operations on the data structure. Point being that memory is no longer freed deterministically. "If there's other threads working here, atomic compare and swap this pointer to the free list, otherwise last one out clean up." Take a look at some of the code from Chapter 7 from Anthony Williams "C++ Concurrency in Action" [0]. [0] https://manning-content.s3.amazonaws.com/download/0/78f6c43-a41b-4eb0-82f2-44c24eba51ad/CCiA_SourceCode.zip https://manning-content.s3.amazonaws.com/download/0/78f6c43-...
- sunfish 11y agoIn most of those cases, the performance-sensitive game engine itself does not use GC; GC is used in the scripting language that implements the high-level game logic.
- overgard 11y agoI wasn't saying game developers never use GC's, I was saying they don't want the platform to make that decision for them. I'm not against GC at a language level, but I am against it in something that's supposed to be "assembly". It's just the wrong layer to place a GC in. Anyway people are getting caught up in games, I'm just using that as one example of many where a GC may not be wanted.
- deleted 11y ago[deleted]