Hacker News new | ask | show | jobs
by karmadog 3268 days ago
Game developers used Assembly to write games when it was the best tool for the job. They then moved to C when it was feasible and then to C++ when that was feasible. For their engines, they never moved on to anything else, because there still is no better tool for the job, all things (tooling, SDKs, platform support) considered.

Unity, Unreal Engine and CryEngine are all written in C/C++. They have sometimes elaborate script bindings, but the engine remains in C/C++.

There's a lot of people leaving college that have never learned how to use C/C++ and immediately they want something they're comfortable with, which is Java/C# or Javascript or maybe even Python. These languages are not good choices for a game engine, for the reasons I mentioned. Will there never be a better language? I did not say that, but it would be an uphill battle.

1 comments

Usually game developers changed language when the OS or game console's SDK release forced them to do so.

> These languages are not good choices for a game engine

I have seen these words written against C, Turbo Pascal, Modula-2, C++.

Some of the games I saw "written" in C for MS-DOS were like this all over the place:

    void my_func(void)
    {
       asm {
         /* 100% of my_func actual code */
       }
    }

Just as if C was a macro assembler.
SDKs never forced anybody to move to C or C++, but the opposite is true: C/C++ compilers were either unavailable or limited.

"I have seen these words written against C, Turbo Pascal, Modula-2, C++."

So what? Those words probably had a good argument behind them, at the time.

In the MS-DOS days, compilers weren't as good as today, so handwritten ASM paid off.

> So what? Those words probably had a good argument behind them, at the time.

> In the MS-DOS days, compilers weren't as good as today, so handwritten ASM paid off.

Just like C compilers had enough money spent into their optimizers, that eventually made them competitive against Assembly, so can C#,Go,D, <whatever language> have enough work placed into them, that eventually they will become competitive against C.

People believed they could make C competitive against Assembly, just like they believe they could make C++ competitive against C.

So it is a matter if one wants to believe and lead, or don't and follow.

If <whatever language> makes certain assumptions and guarantees on behavior, then no, belief is not enough. It has to be plausible. GC alone really is a big issue and all the research (of which there is a lot) has not solved fundamental issues.

There are of course languages (like Rust) that have the fundamentals to match C/C++, but then it's still a matter of adoption. C++ also still develops.

The fundamental issues is that science only advances one memorial at a time, as there is no amount of technical proofs that will change the mind of luddites.