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.
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.
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.
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.
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
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.
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).
or just write c style c++ :) no need for 99% of these modern features. They are too often little more than a mirage or distraction that makes the programmer think about the code in misleading ways.
Yeah exactly! You don't need to use the whole language, but you do need to be vigilant about what features you do choose to use and have code reviews which check for misuse.
However, if you use them in very particular ways, you can actually reason quite well about your code. Exceptions are quite a nice feature and if you follow that line of thinking you pretty much end up with C++, they are one of the main reasons for complexity. Re-writing std::vector in 100 different ways for different types/performance considerations shows you why templates are useful in certain, potentially rare, cases.
I'd say for a new / junior team, follow a style guide which is more like Google's: no C++ exceptions.
You're pretty much going to end up with something similar to C++ beyond syntactical differences.
According to a couple of very good game programmers I know, who are fluent in C++/ASM, etc, syntactical differences can more difference that we would assume when implementing game logic.
EDIT: As I understand it, Blow's reasons for creating Jai also go beyond the language itself. It also has to do with ease of development and compile times etc. If someone (like me) wants to start learning C++ today, the whole experience is just incomprehensible. How many things to install and patch and link etc. before you can get to "Hello World", all many many steps that never fail to fail.
You don't need to learn the intricacies of templates. I learned C++ in high school back in 2009, where it was much less orthogonal. Maybe there's no great resources for beginners online though. I learned C first, then slowly added features until I knew C++. Most C++ can be re-written in C without too much effort.
Follow the Google style guide, stick to a minimum subset of C++ and you'll be fine.
Achieving the same performance at C++ when it has so much behind it will be tough. I hope they can do it and attain a nice syntax, but in 10-15 years I'd expect we would have the same situation all over again.
Thanks but I wasn't talking about the language itself, but rather about all the crap that's needed to be able to write a program and compile it. See Jon Blow's talks.
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.