"The original designer said that "video games are machines that fill memory". The majority of the time, game programmers are thinking about how to fill memory with huge reams of data in ways that allow the data to be efficiently accessed and processed. Hundreds of megabytes of memory must be moved from the hard disk into main memory, and from there into the video card or the processor cache to be processed and returned back to main memory. Because video game players don’t like to wait, all this must be done as fast as is allowable by laws of our universe. The primary purpose of a programming language is to allow the specification of algorithms to manage data. Language features like garbage collection and templated data streams and dynamic string classes may help the programmer write code faster, but they don’t help the programmer write faster code."
I admire the love and passion Jon has for his own work in the bananas.jai video mentioned in the article. He truly enjoys this project, and that's a great feeling that you can see on his face and hear in his description of the compiler.
One of the major reasons that would influence a language like Jai is that once you do that, even if your generated C/++ is fairly optimal, you still have to go through another slower compiler. Jai's compiler is fairly optimised for speed and I think that would be an unacceptable trade off.
On the target platform side, a video game tends to have a fairly well known set of platforms it will run on (new PC's, PS4, Xbox), so I think this is an acceptable trade off.
And just a final note, the generated C/++ would be very unreadable anyway, unless it was a direct transpiler, at which point you lose a lot of the benefits of having a new language.
by generating C++ code you automatically gain C++ baggage. By generating machine code you are tied directly to how the machine works. If you don't want to deal with something like RAII you'd have to find ways to generate code that doesn't do that, where as machine code you just tell it how to exactly move memory around etc.
It's been using LLVM or directly writing x86-64 directly (based on config) for over a year now. Maybe over 2, but for a long time they've been away from transpiling.
- https://github.com/BSVino/JaiPrimer/