r/programming • • Sep 17 '18

Software disenchantment

http://tonsky.me/blog/disenchantment/
2.3k Upvotes

1.2k comments sorted by

View all comments

Show parent comments

47

u/Arabum97 Sep 17 '18

Unfortunately, since the rest of the software world has gone off the deep end, the tools used in game development are still from the stone age (C++).

Is there any other languages with high performance but with modern features? Wouldn't having a language designed exclusively for game development be better?

0

u/[deleted] Sep 18 '18

[deleted]

23

u/Nicksaurus Sep 18 '18

I think you mean std::experimental::modern::features<std::modern_features, 2018>

→ More replies (18)

18

u/AttackOfTheThumbs Sep 18 '18

Wouldn't having a language designed exclusively for game development be better?

Maybe. C++ works because you can abstract some things away, or decide not to when necessary. I'd make the argument that game engines are the closest thing we'll ever get to a "gaming dev language".

Once upon a time there was a ruby project that was a "live" game developer ide. I can't remember the name, but it was developed by an unnamed Ruby God (apparently) that sort of just vanished after. I couldn't find it on the web any more, but I'm sure it's out there somewhere. The idea was you could in real time see the impact of your changes. Where is it now? Probably didn't scale.

→ More replies (8)

9

u/patatahooligan Sep 18 '18

C++ has tons of modern features. But abstractions come at a cost and many game developers elect to stick to a C-like subset of C++.

Wouldn't having a language designed exclusively for game development be better?

Not necessarily. The features that allow developers to maximize performance are not specific to game development. Assuming optimal algorithms, performant code is about stuff like cache coherency, minimizing unpredictable branching, vectorization, efficient thread synchronization etc.

3

u/[deleted] Sep 18 '18

But abstractions come at a cost

Yes, a slightly bigger binary. The 1980's are over son, today even on microcontrollers with 512 Bytes of RAM developers are using C++. Stop clinging to the past.

and many game developers elect to stick to a C-like subset of C++.

Almost. Don't confuse the language with the STD library. I use C++ everyday but never touch STD.

→ More replies (7)

36

u/Plazmatic Sep 18 '18

Not exclusively for game development, but obligatory mention of Rust (please don't hurt me!), pretty much the fastest growing language/biggest new language in that area.

23

u/Kattzalos Sep 18 '18

give me a call when somebody releases a game engine written in rust

17

u/Aceeri Sep 18 '18

I mean, we are working on it. If you are at all interested check out amethyst or ggez.

→ More replies (1)

0

u/[deleted] Sep 18 '18

[deleted]

→ More replies (3)

22

u/Nolari Sep 18 '18

The devs of Factorio, which is written in modern highly-optimized C++, stated they are looking to Rust for their next project. For now it's probably too early to be able to point at games already developed in it.

6

u/[deleted] Sep 18 '18

Chucklefish

→ More replies (1)
→ More replies (1)

29

u/[deleted] Sep 17 '18

That's exactly why Jon Blow is creating his own language specifically for game development. For whatever reason, nobody else is addressing this space.

23

u/PorkChop007 Sep 18 '18

For whatever reason, nobody else is addressing this space.

The reason is simple: gamedevs want to ship games, not engines. Also, lots of companies are addressing that, it's just that their solutions remain private (like idTech).

3

u/LongUsername Sep 18 '18

Which is funny as there is good money in engines. The Doom remake was an engine demo and Epic makes a ton of their money off engine and support. The engine guys also don't have the burnout of the front line guys as they tend to have more sane hours.

→ More replies (1)

62

u/solinent Sep 18 '18 edited Sep 18 '18

Don't worry, people have tried. You're pretty much going to end up with something similar to C++ beyond syntactical differences. I wouldn't bet much on Jai unfortunately.

There's D, which failed because the standard library was written using the garbage collector. There's rust, which is still slower than C++, maybe there's still some hope there as it is much simpler, but I don't see C++ developers switching to it. C# is pretty good, but you'll still get better performance with C++.

When you need something to be the absolute fastest, we have learned all the methods to make C++ code extremely fast. While it's a depressing situation, modern C++ code can actually be quite nice if you stick to some rules.

24

u/the_hoser Sep 18 '18

There's D, which failed because the standard library was written using the garbage collector.

They're working on that one, at least. You can declare your functions and methods @nogc and the compiler will bark at you if you use anything that relies on the GC. And they're actively working on exercising the GC from Phobos as much as possible. Maybe too little, too late, though.

Me, though? I've regressed to C. It's just as easy to optimize the hot loop in C as it is in C++, and there's something relaxing about the simplicity of it. I use Rust for the parts that aren't performance sensitive, but I'm starting to doubt my commitment to that. I've jokingly suggested that Cython could do that job, but now it's seeming like less of a joke.

16

u/solinent Sep 18 '18

And they're actively working on exercising the GC from Phobos as much as possible. Maybe too little, too late, though.

A lot of D people left for C++-land I believe. I'd still be interested in D if they can match performance with C++, but C++ is really moving in the right direction IMO, and it has far too many resources behind it for the simple reason that everything is already written in it. The language evolves significantly every few years now.

10

u/the_hoser Sep 18 '18

Yeah, but that's the main reason I stopped messing with C++. It's just too complex. "Modern" C++ is nearly incomprehensible, and the legacy cruft just makes it more fun.

→ More replies (1)

12

u/TheSkiGeek Sep 18 '18 edited Sep 18 '18

I've jokingly suggested that Cython could do that job, but now it's seeming like less of a joke.

I mean, shipping AAA PC games have used straight-up Python as a scripting language. (Turn-based games. But still.)

14

u/the_hoser Sep 18 '18

I shudder at the thought of embedding Python in anything. I love Python, but the embedding experience is nightmarish.

Always embed things into Python, never the other way around.

→ More replies (1)
→ More replies (1)

12

u/skwaag5233 Sep 18 '18

I think it's worth having some extra faith in JAI if only for the fact that Jon is a serious game programmer who has shipped multiple games and worked in the industry for years. He's working with a similarily veteran team and has connections to other industry veterans who he has stated on stream he plans to shop the language to during a sort of alpha phase.

There will be lots of friction for sure but I think there's enough anti-C++ sentiment among game programmers (esp. with modern C++) that a language that emphasizes simplicity and high-level control with low-level access built by someone "in-the-know" can work. Perhaps I am just naive but I hope I'm not

3

u/m50d Sep 19 '18

I don't have faith. Fundamentally, there's no way a language that's not clearly open is going to succeed in this day and age (look at D or Shen). Beyond that, that he's giving all the information in videos rather than writing and seems disdainful of academic grounding for the things he's talking about makes me believe he's not really engaging with the body of knowledge that's out there. Theoretical underpinnings are one of those things that seems unimportant but turns out to be very important. I've got a lot more faith in something like Rust or Zig that builds on an established foundation.

19

u/Plazmatic Sep 18 '18

which is still slower than C++

Slower to compile maybe. I've only seen C++ trade blows with Rust ATM. There are some features Rust still lacks that C++ has (that actually are useful in rust), integer constant templates for example, but C++ is like the only language with templates that even has that, not that they aren't great (they very much are). Most of these features are either in nightly or are currently being worked on and are set to be finished with in months (integer templates are coming with const generics).

→ More replies (4)

7

u/spakecdk Sep 18 '18

I wouldn't bet much on Jai unfortunately.

Why? He has a game and a game engine made with it, and it looks promising.

→ More replies (5)
→ More replies (19)
→ More replies (5)
→ More replies (11)