[OT] Previously: DMD - Windows -> C# in gamedev

Froglegs lugtug at gmail.com
Sat Jan 7 11:00:34 PST 2012


> The reason I am conviced is that C++ was the last systems 
> programming language with manual memory management. All the 
> languages people are
> developing as possible C++ replacement do have some form of 
> automatic
> memory management.
>
> Meanwhile smart pointers and a GC API became part of the C++ 
> language standard. In the future, if you want to target Windows 
> 8 Metro games, you will need to use WinRT which requires C++/CX 
> and makes use of reference counting in the language.
>
> Apple added GC to Objective-C, which has some problems with 
> existing frameworks, so their next step was to introduce ARC.
>
> This is why I think that eventually even games engines will be 
> developed
> in a language that supports some kind of automatic memory 
> management be
> it GC or reference counting.



  Well games often already integrate scripting languages, 
generally Lua or Mono, which are both GC based. But this is for 
the game logic, not for the high performance parts of the code.


   For a GC to be used at the C++/D layer it would need to be

1) optional always, D makes it optional but you loose a solid 
chunk of the language if you ditch GC, what remains is in some 
ways inferior to C++(no escaping lambda without GC, /cry)
2) no long pauses ever


  I think most game engine stuff will continue to be written 
without GC, as it doesn't really add much if what you are after 
is raw performance. And C++ does have smart pointers which 
perform much of what a GC does, but without the long pauses or 
non deterministic destruction.







More information about the Digitalmars-d mailing list