News for hackers. Stuff that matters.
Re:Using D to Create the World’s Fastest File System by kllrnohj on Wednesday December 05, 2018 @03:47PM (#18612367)
There is no such thing as a "good GC" in this context. Game engines go to great lengths to do things:

1) Have bounded memory usage 2) Have consistent frame times

These goals are critical to maintain a consistent framerate on fixed-memory devices (aka, consoles). GCs, by their very nature, are not compatible with either of those goals. They need lots of spare memory to go fast, and they cause hiccups when collection happens. They are a non-predictable, non-consistent load.

If you're not working on a problem that is a sustained, consistent workload that needs sustained, consistent result generation then no, you probably won't see the same GC problems. GCs work great when the work is bursty or when the work has no latency associated with it. There's an awful lot of programs that fit in that model. Games just aren't one of them.

Re:Using D to Create the World’s Fastest File System by DblPlusUngood on Wednesday December 05, 2018 @04:40PM (#18612870)
How are GCs not compatible with bounded memory use? Though many GCs size allocation arenas proportionally to the live data, there is no fundamental reason why the allocation arenas couldn't be fixed-size (of course, they must be large enough for good performance, etc.).
Re:Using D to Create the World’s Fastest File System by p0nce on Wednesday December 05, 2018 @04:51PM (#18612980)
And yet there are GCs in Unity and Unreal Engine, the most popular game engines of today.
Re:Using D to Create the World’s Fastest File System by monocasa on Wednesday December 05, 2018 @05:07PM (#18613130)
Only the scripting code is GCed. The core engine in both cases is C++ with manual memory management for the reasons stated above.
Re:Using D to Create the World’s Fastest File System by pjmlp on Thursday December 06, 2018 @04:38AM (#18616587)
On Unity's case with some subsystems in the process of being replaced by HPC#.

And in Unreal you can use GC in whatever components you feel like, it is a matter of weighting where it makes sense.

Re:Using D to Create the World’s Fastest File System by kllrnohj on Thursday December 06, 2018 @09:20AM (#18618210)
> On Unity's case with some subsystems in the process of being replaced by HPC#.

They are converting their C# code to HPC# which specifically does not do GC allocations.

https://youtu.be/NF6kcNS6U80?t=886

  HPC#:
   * no class types
   * no boxing
   * no GC allocation
   * not exceptions for control flow
They are building a compiler to eliminate the GC from the GC'd language they were using.
Re:Using D to Create the World’s Fastest File System by pjmlp on Thursday December 06, 2018 @09:51AM (#18618433)
Once upon a time, C code for games engines looked like this.

    void do_stuff(void) {
        asm {
        }
    }
Hardly any C code in sight, and most of the stuff could equally have been coded in MASM/TASM with their higher level macros.

Eventually game devs migrated to proper C.

A couple of years later, C++ code in game engines, was not even "C with Classes", rather C compiled with C++ compiler.

Eventually game devs migrated to proper C++.

Looking at the past, which I was partially part of, I see HPC# as a stepping stone into regular C#, in a similar vein that C code of yore was full of inline Assembly.

It is of course a matter of opinion, however I like to look at the past to see where the future leads to.

So lets see who's is right in about 10 years, regarding how game engines get implemented.

Re:Using D to Create the World’s Fastest File System by kllrnohj on Thursday December 06, 2018 @01:54PM (#18620912)
Except they are stepping AWAY from C# here, not towards it.

And the game-industry as a whole is moving to data-oriented design, which tends to be hard to do at best (if not downright impossible) in most GC'd languages.

Regardless the transition from C to C++ has no performance cost (often a performance advatnage), so I'm not sure why you're bringing that up as some significant migration in this case? It doesn't support any argument for a transition from C++ to C# or similar, as that comes with a huge performance cost. Particularly in an era where CPU performance hasn't improved for almost a decade now.

Re:Using D to Create the World’s Fastest File System by pjmlp on Thursday December 06, 2018 @03:46PM (#18622044)
Modern CPU performance gets explored by taking advantage of multi-core, and GC is a very helpful tool for writing lock-free data structures.

Additionally dataflow languages are better suited for GPGPU programming than plain old C and C++, as Google is exploring with XLA on Tensorflow, and game engines with graphical tooling for shader generation.

Again, lets come back in 10 years and see who was actually right.

Re:Using D to Create the World’s Fastest File System by swsieber on Wednesday December 05, 2018 @04:59PM (#18613060)
Electron is a very popular application framework today.