Jonathan Blow: "C++ is a weird mess"
The Witness developer on his new programming language that could increase productivity by 50 to 80 per cent
Sometime around 2014, while still developing The Witness, Jonathan Blow sat down to work and realised what a miserable experience programming could be.
Why was that? Well, as Blow says, it's because C++ is a "really terrible, terrible language." During his talk at Gamelab Barcelona last week, Blow laid out what he believes are the issues with the commonly used language, and what he hopes to achieve with the development of Jai, his self-made alternative.
The main flaw with C++, in Blow's opinion, is that it's a fiendishly complex and layered ecosystem that has becoming increasingly convoluted in its effort to solve different problems; the more layers, the higher the stack, the more wobbly it becomes, and the harder it is to understand.
"People think a programming language should be a complicated ecosystem," Blow said to the audience. "I don't want to learn an ecosystem for a year, I just want to put 3D graphics on there."
With Jai, Blow hopes to achieve three things: improve the quality of life for the programmer because "we shouldn't be miserable like many of us are"; simplify the systems; and increase expressive power by allowing programmers to build a large amount of functionality with a small amount of code.
Currently, Jai boasts an improved productivity of around 15 per cent, but Blow believes that, given time, it could be anywhere between 50 and 80 per cent.
GamesIndustry.biz caught up with Blow following his talk to learn more about Jai which, if his predictions for the language are accurate, could reshape game development at both the indie and AAA level.
According to Blow, "C++ is a weird mess". It began life as C in the 1970s and changed substantially over the next decade or so, layering on "historical cruft and weirdness" that holds back development with the need to remain compatible with historic decisions.
"There is a very large status quo bias around things like this. We make games a certain way; people make all these other programming languages and yet we don't use them"
"Then C++ is a language where they said: 'We're going to be C with a bunch of stuff added' and that was an okay idea. But they made a lot of really bad decisions in the beginning and then they had to repair a lot of those decisions later on, and it's kind of a mess," says Blow.
"If you come to it and you're trying to learn it, a lot of what you're learning is just this rubble... when really you shouldn't have to deal with that at all. C++ is a powerful language in some ways, because it's what we make games in so obviously it's doing something right. But it makes it a lot harder than it should be."
As a project gets bigger the longer it takes to make changes, Blow explains, and the nature of programming means that significant amounts of time get dedicated to "what is essentially busywork."
"I just started thinking: 'Somebody should do something about this because it's ridiculous'. And I realised that nobody was going to do anything," he says. "There is a very large status quo bias around things like this. We make games a certain way; people make all these other programming languages and yet we don't use them.
"Companies have very large game engines that would be very costly to replace. So a game like Assassin's Creed, last I heard a couple of years ago, was like ten million lines of source code... It's probably bigger now."
This "status quo bias" creates inertia within the industry, Blow argues, and big developers aren't going to jump at the chance of rewriting all of their systems when they already have one that gets the job done, irrespective of how cumbersome that process may be.
"I just started thinking: 'Somebody should do something about this because it's ridiculous'. And I realised that nobody was going to do anything"
"So are they going to just turn around tomorrow and just rewrite all that?" says Blow. "No they're not because it would be almost impossible. So a lot of people have this defeatist attitude of 'this can't ever be different than it is today'. I actually had that attitude also. That little realism voice was in my ear telling me I couldn't change this. But then for some reason I decided to question this: how true is that really?
"The more I questioned it, the more I said 'actually this is quite changeable. I think I see a specific thing we do here'. And as soon as I had the idea that there was a way to change it, I was suddenly a lot happier about my day-to-day work because suddenly there was a way out."
By this point, Blow and his team were deep into developing The Witness, so Jai remained a side project. Several years later, however, it's the primary focus of Blow and his team at Thekla Inc. His currently unannounced game project, which he teased during Gamelab, is built using Jai in an effort to "test the ideas against reality."
In many ways, Blow is uniquely positioned to develop a new programming language. He's independent of large studios and publishers, has worked on extremely long projects (The Witness took around seven years all told), and is an experienced programmer.
His history as a designer is also crucial, he says, to making a language that works for building games in the hopes of avoiding the many pitfalls of C++. Even so, Blow is aware that Jai faces the same danger of becoming a "pile of rubble".
"It is a danger, yes," he says. "You could spend all this time trying to design something that you think is better and end up with something that is same or even worse. That could happen. But that's where my experience as a designer comes in. I've designed games that are big and complicated, and you can design a programming language the same, with an eye to the aesthetics.
"I don't think it's too controversial to say that most of the time, when programming languages are designed they are not designed by what we think of as designers"
"First of all trying to keep it simple, but secondly when you do add complexity -- because you always need to in order to make things happen -- how much benefit is coming from that complexity? How easy something is to understand [for the player] is what we think about in game design all the time. If somebody walks into this room... are they going to understand what is going on? How do we help them understand?
"Those same skills can translate to programming language design. I don't think it's too controversial to say that, most of the time, when programming languages are designed they are not designed by what we think of as designers. They are designed by technical people who are trying to solve a technical problem. So the hope is that bringing some design experience in there helps us get to a better result. And it seems to be working. I'm pretty happy with where we are. It's just a lot of work to get it done."
Ultimately, Blow hopes that Jai will be powerful enough to program the biggest AAA games, but right now he is working on an "intermediate step" with his new game.
"It's a real game in all respects, we just picked a design that was a little easier to do. Once that is done and it works and we ship it, then we can scale up that graphics engine and so forth."
While there is no end in sight for Jai, Blow hopes to have a closed-beta out by the end of the year. Whether it will live up to its potential, or his personal hopes, is a long way from being decided.
GamesIndustry.biz is a media partner of the Gamelab conference. We have attended the show with the assistance of the organiser.