Why Video Games Need Their Own Programming Language

Shamus Young

New member
Jul 7, 2008
3,247
0
0
Why Video Games Need Their Own Programming Language

The majority of video games are programmed in C++, a language that has been around since 1983. Game development needs its own programming language, and Shamus explains why.

Read Full Article
 

Cid Silverwing

Paladin of The Light
Jul 27, 2008
3,134
0
0
C came out in 1983? Holy fuck are we overdue for an update., but it looks like we won't have any for a few decades yet. Not without some seriously daring pioneers like the phone phreakers of old.

Captcha: shoe shine <-- That's exactly what we don't need right now. We need a whole new pair of shoes.
 
Jan 12, 2012
2,114
0
0
I sometimes wonder if the next big thing will be a crossbreed between UnrealScript, Project Spark, Counter-Strike and Minecraft. PC gamers love to mod their stuff, and that idea has spread to the general gaming public; pretty much anyone can design a Halo map in Forge, or a LittleBigPlanet level.

It seems to me (someone who just about code, "Hello, world!" in Python) that we're going to reach a point pretty soon where we have a solid physics engine available to everyone (maybe the next Unreal), and a platform that lets you put whatever paint, basic mechanics, and objects you want on top of it with all the ease of using an Apple computer. Tie that to a decently flexible AI, and you've got a product that is both a game in itself, and the next tool for teaching a different programming language and attitude.
 

Tiamat666

Level 80 Legendary Postlord
Dec 4, 2007
1,012
0
0
Nice to see a tech-related article here.

I'm not convinced about the premise though. There are a couple of potential objections. You say that C is mainly a systems language, which may be true, but isn't a game a complex system of individual, interconnected subsystems?
I guess what you were referring to by "system" is "close to the hardware" - which however again fits the requirements of most AAA games.

Also, you only briefly mention game engines like Unreal Engine, and go on to claim that most developers still code in C. I don't have any hard numbers, but I would think that most AAA games today are not coded from the ground up in C, but are rather built on one of the mainstream game engines. I also believe that most games use a higher-level scripting language for the game-specific code rather than C.

I think a real programming language specifically for games would be an interesting possibility to consider. But any thoughts on the subject should perhaps be more focused on what exactly would differentiate it from traditional programming languages and contemporary game engines. I think you put too much emphasis on how "out of date" the C language is, which might actually be inconsequential to the premise, since I don't think that many game programmers have contact with it anymore. Just the "game system" programmers, perhaps. :)
 

Tiamat666

Level 80 Legendary Postlord
Dec 4, 2007
1,012
0
0
Cid Silverwing said:
C came out in 1983? Holy fuck are we overdue for an update., but it looks like we won't have any for a few decades yet. Not without some seriously daring pioneers like the phone phreakers of old.
We do have several updates. Java and C# being the most visible ones.
 

SharedProphet

New member
Oct 9, 2008
181
0
0
Shamus Young said:
Will Jon Blow invent that language? Statistically, I wouldn't bet on it.
Jon Blow is inventing that language. He's been working on the compiler in his off time and made some nice progress already, and has been streaming some of the programming work on the compiler (which has been awesome to watch). He's going to do a new talk tomorrow night at 7 PM PST at http://www.twitch.tv/naysayer88

I've been following it closely and it's really exciting. I'm a professional programmer, but not in the games industry, so I may not be able to contribute much. But I'm excited to see where it goes and use it when I can get my hands on it.
 

DrMcCoy

New member
Aug 9, 2010
17
0
0
EDIT: Sorry if I'm coming across too aggressive here; you kinda hit a nerve.

Words can't describe how off the mark you are there.

The game logic has been implemented using script languages since the days of freaking Maniac Mansion. You know what SCUMM is? Exactly this. Lua, NWScript, they all exist for exactly this reason. The game logic being hardcoded in C or C++ is actually really rare.

You even miss Jon Blow's point: he was actually talking about replacing the whole language doing the grunt work, not just the game logic. IMHO, this too is completely bonkers. He also has no background in formal language design, and it shows.

In fact, I think we should rather go the other way: we should start decreasing all this cruft of useless abstractions we build up and think about programing closer to the bare metal again, think about efficiency. If you look at what the demoscene does with 64k (or even 4k!) binaries on 20, 30 years old hardware, you'd be amazed. We have computers that have 16GB of RAM, bogomips to the waazoo, and we're struggling with high input latency.
 

SharedProphet

New member
Oct 9, 2008
181
0
0
Shamus Young said:
Will Jon Blow invent that language? Statistically, I wouldn't bet on it.
Jon Blow is inventing that language. He's been working on the compiler [https://www.youtube.com/user/jblow888/videos] in his off time and made some nice progress already, and has been streaming some of the programming work on the compiler (which has been awesome to watch). He's going to do a new talk tomorrow night at 7 PM PST at http://www.twitch.tv/naysayer88

I've been following it closely and it's really exciting. I'm a professional programmer, but not in the games industry, so I may not be able to contribute much. But I'm excited to see where it goes and use it when I can get my hands on it.

(Sorry, this was supposed to be an edit.)
 

oldtaku

New member
Jan 7, 2011
639
0
0
How big is AAA? Civ IV is Python with C++ for the heavy lifting. They moved to Lua for V. As noted, most of the game doesn't need the speed of C++.

As someone who regularly uses several languages (C, C++, Python, Perl (not by choice), C#, Java, JavaScript, bash, DOS bat (aieee)) I can confidently say that the idea of 'a' language for games will fail, because each language is designed for different things and people who do games are very opinionated. It's not really performance that holds Java back (there have been impressive performance demos), it's that Java is so damn verbose and restrictive because it's designed to keep business logic monkeys at huge corporations from doing too much damage to each other. Perhaps Ubisoft could use a bit more of that, you say, but it's not fun, so they won't do it voluntarily. It's like doing paperwork. Python and Ruby are effectively equivalent in capability, so instead people bicker about petty syntax things.

But routinely partitioning things into engine and game logic so you could use a less brittle language than C++ for the game logic would be a good start. As long as middleware components provide bindings this is not too hard, just requires some design up front so things aren't just reaching into where they shouldn't. Indies use this approach a lot. If I wrote something right now it'd probably be C# (Mono) on Unreal 4.
 

Lemmibl

New member
Jan 27, 2009
58
0
0
Fun to see some more technical articles here. I agree with you, it's really getting to the point where the bottlenecks are everywhere but on the actual CPU and GPU.

Just to be that guy, I want to nitpick and point out that modern C++ is fundamentally different from the C++ in the 80's. This might not be general knowledge, but programming languages actually also get content patches and updates, in their own way, albeit at a much slower pace than your programs and video games.

Here's a little roadmap from the C++ committee's webpage, for those who are interested: https://isocpp.org/std/status
 

PrinceOfShapeir

New member
Mar 27, 2011
1,849
0
0
SharedProphet said:
Shamus Young said:
Will Jon Blow invent that language? Statistically, I wouldn't bet on it.
Jon Blow is inventing that language. He's been working on the compiler [https://www.youtube.com/user/jblow888/videos] in his off time and made some nice progress already, and has been streaming some of the programming work on the compiler (which has been awesome to watch). He's going to do a new talk tomorrow night at 7 PM PST at http://www.twitch.tv/naysayer88

I've been following it closely and it's really exciting. I'm a professional programmer, but not in the games industry, so I may not be able to contribute much. But I'm excited to see where it goes and use it when I can get my hands on it.

(Sorry, this was supposed to be an edit.)
Creating the language is one thing, disseminating the language is another thing entirely.
 

Kenjitsuka

New member
Sep 10, 2009
3,051
0
0
We are not seeing a big trend to get much closer to the bare metal (DirectX 12, MANTLE) for no reason, Shamus.
Like many people pointed out almost everything is done with scripting languages and/or with middleware doing all the C/C++ grunt work...
 

hermes

New member
Mar 2, 2009
3,865
0
0
So far, the "problem" with C++ is that it is not a language specifically built around making games, so it doesn't have any native paradigm to support everyday structures of games. For a new language to be more useful, it has to be more than simply a new language, it has to be a new paradigm.

And isn't that the point of most game development engines out there? To provide an abstraction level with their own scripting language than is later compiled into whatever platform would be considered as its "final console".

At this point, it would seem like the easiest solution would be to make the engine developers to agree on an interpretation paradigm and language, and each console manufacturer can work on a compiler to that language. That would alleviate developers, while leaving the engine developers to fight on the realm of tools and development environments.
 

Covarr

PS Thanks
May 29, 2009
1,559
0
0
The John Carmack quote got me thinking... what if he were to make a new language? He's one of the most talented programmers on the planet, and if anyone could pull it off and do a good job, it's him. That isn't to say I don't think Blow can do it, but if Carmack were to try his hand at it, he'd almost certainly do better. Just like he pretty much always does with everything he touches.

P.S. Thanks
 

SharedProphet

New member
Oct 9, 2008
181
0
0
PrinceOfShapeir said:
Creating the language is one thing, disseminating the language is another thing entirely.
There are a lot of game devs interested in what he's doing. It will happen. Widespread adoption may be a hurdle, but maybe not if it is just obviously much better to work with.

Lemmibl said:
Just to be that guy, I want to nitpick and point out that modern C++ is fundamentally different from the C++ in the 80's. This might not be general knowledge, but programming languages actually also get content patches and updates, in their own way, albeit at a much slower pace than your programs and video games.

Here's a little roadmap from the C++ committee's webpage, for those who are interested: https://isocpp.org/std/status
Game devs know [https://www.youtube.com/watch?v=rX0ItVEVjHc]. That's a tech-intensive talk, but in short, many pro game programmers don't use a lot of the newer C++ features in their engines not because they don't know about them, but because they do.

oldtaku said:
How big is AAA? Civ IV is Python with C++ for the heavy lifting. They moved to Lua for V. As noted, most of the game doesn't need the speed of C++.

...

But routinely partitioning things into engine and game logic so you could use a less brittle language than C++ for the game logic would be a good start.
Most games already do this. As you mentioned, Civ, like many other games, uses Lua (and it bogs down horribly when you get to the later stages of the game), the Unity game engine houses Mono to run game logic using .net (so you can write it in JavaScript, Boo, or C#), etc.
DrMcCoy said:
You even miss Jon Blow's point: he was actually talking about replacing the whole language doing the grunt work, not just the game logic...

In fact, I think we should rather go the other way: we should start decreasing all this cruft of useless abstractions we build up and think about programing closer to the bare metal again, think about efficiency.
I think you're the one missing the point. It is this: the whole reason developers end up feeling they have to use different, slower languages for game logic is because it's such a pain to write C++, when if a language were made that didn't have to be as general purpose as C++ it could be just as nice to use as a scripting language without sacrificing the ability to write closer to the metal (as game engine programmers, including Jon Blow, already have to do constantly) for high performance.
 

Tiamat666

Level 80 Legendary Postlord
Dec 4, 2007
1,012
0
0
OK, now I see where you're coming from. Having watched the first few minutes of the Jonathan Blow video, I see that the "C fixation" in this article is part of the source.

So my critique is somewhat shifted from you (Shamus) to John Blow.

I'm not up to date on his other games, but I've played Braid, fantastic game, yet completely overkill to code it in C++. There is no reason not to shift from C/C++ to something like Java, C# or Python for an indie-game like Braid. I wonder why he doesn't just take the leap instead of talking 2 hours about how we need a new programming language.

But maybe I'll be enlightened when I finish watching the whole thing.
 

Pyrian

Hat Man
Legacy
Jul 8, 2011
1,399
8
13
San Diego, CA
Country
US
Gender
Male
I think there's too many programming languages as it is. It would be nice if the premise were true; know C++, make games. But in practice you'll be called on to work in one or more other languages, as well, and aren't likely to have much choice in the matter (unless you're indie).

To me, the real nightmare is web programming. This is the end result of everybody and their kid sister thinking (correctly) that the web needs a better language, and then writing (yet another) one. So now, I still need to know basics like HTML, JavaScript/JScript, CSS, and SQL, so I can debug when necessary. And in addition I need to know one or more of JQuery (not strictly a language but still), Ruby, Php, Python, etc., then there's the various Content Management Systems, and it just goes on and on and on and on.

C++ is kind of awful (and when you're coding for speed you're not going to use a lot of its features over C), but not having a standard at all, and instead having a flood of different languages and systems, is IMO worse.
 

Nuxxy

New member
Feb 3, 2011
160
0
0
This seems relevant to the discussion at hand.



In my limited game coding experience, C++ is a mixed bag. It still gets used because some of it is exactly what you want to code in. But then a lot of other things aren't.
 

Tiamat666

Level 80 Legendary Postlord
Dec 4, 2007
1,012
0
0
I have some respect for Jon Blow. Braid was a very unique game. But in my eyes his whole talk loses credibility six minutes into the video when he claims that "there are three reasonable languages... that we could even *think* of switching to... Go, D and Rust".

I'm not very opinionated about programming languages, but, seriously? It sounds like a joke. These are basically niche languages without any history in games. What about the obvious candidates people have actually heard about and that have a considerable array of game-libraries and frameworks, such as, Java, C#, JavaScript, Lua?

Even the best known language "Go" barely makes the top 20 most used programming languages at spot 19. I wonder if he is deliberately trying to be edgy or if these are simply the languages he happened to have contact with.

To me, using these languages as a "thought benchmark" makes no sense at all.
 

wizzy555

New member
Oct 14, 2010
637
0
0
I really have to question why we need another programming language. Game control logic lends itself very well to object orientated paradigms and there are plenty of viable competing object orientated languages already.

Shaders already have their own languages and low-level engines are fine with their C and C++ language updates.