3 ms·
Worth mentioning that Quake 3 used C as a scripting language back in 1999. The engine used a modified LCC compiler [1] to generate byte code for execution in it
by hgs3 3y ago
Worth mentioning that Quake 3 used C as a scripting language back in 1999. The engine used a modified LCC compiler [1] to generate byte code for execution in its own virtual machine. The same could be achieved today by embedding a WASM VM and compiling your C/Zig/Rust whatever to web assembly.
As an aside, I find the idea of writing game code in unmanaged C++ perplexing. Even the original Quake, which targeted DOS-era hardware, relied on a scripting language running in a plain vanilla interpreter (no JIT here). In the [current year] I would think advances in computing power, parallelism, and JIT technology would be more than adequate to accommodate an interpreted scripting language.
[1] https://en.wikipedia.org/wiki/LCC_(compiler)#Projects_incorporating_LCC https://en.wikipedia.org/wiki/LCC_(compiler)#Projects_incorp...
- __s 3y agoUsing an interpreter on old hardware was often to save memory https://lwn.net/Articles/412024 https://lwn.net/Articles/412024
- ramesh31 3y ago>As an aside, I find the idea of writing game code in unmanaged C++ perplexing. https://github.com/id-Software/DOOM-3 https://github.com/id-Software/DOOM-3
- kevingadd 3y ago"advances in computing power, parallelism, and JIT technology would be more than adequate to accommodate an interpreted scripting language." While this is true, game consoles + iOS/iPadOS prohibit JIT and in some cases prohibit script interpreters, so people resort to stuff like 'we wrote a compiler for C# that turns it all into C++ source files' in order to pass review and collect Fortnite Money*. * I'm using Fortnite Money here to represent 'the kind of money you can make if you're willing to sell lootboxes to teens on the App Store'
- Tozen 3y agoAdd Vlang to that list, as another that can compile to web assembly. In addition to having a C2V translator (and some other languages have similar). A number of safer and easier/convenient options are out there for those that care to look.