[Off-Topic] John Carmack's point of view on GC and languages like JavaScript

IGotD- nise at nise.com
Thu Aug 11 20:55:23 UTC 2022


On Thursday, 11 August 2022 at 13:20:13 UTC, wjoe wrote:
>
> I guess it's an ignorant point of view, but I don't see how 
> someone whose constraints for writing high-performance, and/or 
> real-time, and/or embedded/micro-architecture code, which 
> prohibits the use of a GC, would find D-Runtime/Phobos meeting 
> their requirements.
> There's at least one lightweight implementation of D-Runtime.
> And Phobos? Everything that allocates or is templated will 
> likely be too slow/bloated in that case, thus a specialized 
> solution that takes advantage of context seems to be necessary.

Yes, real time code today will avoid GC all together. Likely it 
will use custom everything, like specialized allocators, caches 
and container algorithms. All in order to avoid memory allocation 
from a heap as well as avoiding memory fragmentation.

Many times real time systems has a real time part but also a non 
real time part which often runs a rich OS like Linux. Services in 
the rich OS part can usually use GC without any problems.

In terms of computer games, correct me if I'm wrong but GC will 
become the norm there. The reason is that computer games are 
becoming more and more advanced and there is so much stuff going 
on that GC becomes a lesser problem compared to everything else 
in terms of performance. Probably if I came to a computer game 
technical manager in 20 years and said I wanted to use GC, he 
would probably kill me. Today if I said the same, he would say 
it's probably ok. I'm not that convinced by the Doom example as 
there seem to be a confusion between caches and GC. You are 
welcome to come with more examples of early computer games that 
used GC.



More information about the Digitalmars-d mailing list