Comment by benreesman
2 days ago
Carmack did very much almost exactly the same with the Trinity / Quake3 Engine: IIRC it was LCC, maybe tcc, one of the C compilers you can actually understand totally as an individual.
He compiled C with some builtins for syscalls, and then translated that to his own stack machine. But, he also had a target for native DLLs, so same safe syscall interface, but they can segv so you have to trust them.
Crazy to think that in one computer program (that still reads better than high-concept FAANG C++ from elite lehends, truly unique) this wasn't even the most dramatic innovation. It was the third* most dramatic revolution in one program.
If you're into this stuff, call in sick and read the plan files all day. Gives me googebumps.
Carmack actually deserves the moniker of 10x engineer. Truly his work in his domain has reached far outside it because id the quality of his ideas and methodologies
I have a bit I do where I do Carmack's voice in a fictional interview that goes something like this:
Lex Fridman: So of all the code you've written, is there any that you particularly like?
Carmack: I think the vertex groodlizer from Quake is probably the code I'm most proud of. See, it turns out that the Pentium takes a few cycles too long to render each frame and fails to hit its timing window unless the vertices are packed in canonically groodlized format. So I took a weekend, 16-hour days, and just read the relevant papers and implemented it in code over that weekend, and it basically saved the whole game.
The point being that not only is he a genius, but he also has an insane grindset that allows him to talk about doing something incredibly arcane and complex over a weekend -- devoting all his time to it -- the way you and I talk about breakfast.
Another weird thing about Carmack, now that you mention it -- and Romero, coincidentally -- is their remarkable ability to remember technical challenges they've solved over time.
For whatever reason the second I've solved a problem or fixed a bug, it basically autopurges from my memory when I start on the next thing.
I couldn't tell you the bugs I fixed this morning, let along the "groodilizer" I optimized 20 years ago.
Oh btw Jank is awesome and Jaeye is great guy, and also a game industry dev!
4 replies →
I like this word, 'grindset'
Linking directly to C++ is truly hell just considering symbol mangling. The syntax <-> semantics relationship is ghastly. I haven't seen a single project tackle the C++ interface in its entirety (outside of clang). It nearly seems impossible.
There's a reason Carmack tackled the C abi and not whatever the C++ equivalent is.
There is no C ABI (windows compilers do things quite differently from linux ones, etc) and there is no certainly no C++ equivalent.
C ABI is the system V abi for Unix, since C was literally created for it. And that is the abi followed by pretty much any Unix successor: Linux, Apple's OS, FreeBSD.
Windows has its own ABI.
The different abi is pretty much legacy and the fact that x86_64 ABI was built by AMD + Linux etc, while Microsoft worked with Intel for the Itanium abi.
2 replies →
The C ABI is basically per-platform (+ variations, like 32- vs 64-bit). But you can get by quite well pretending there is something like a C ABI if you use <stdint.h>.
[flagged]
[flagged]
Just parsing C++ is already a freaking hell.
It's no wonder that every other day a new mini C compiler drops in, while no one even attempts to parse C++.
There is one pretty serious C++ parser project: https://github.com/robertoraggi/cplusplus
1 reply →
Any particular year?
Quake III Arena was released in 1999. It was open-sourced in 2005.
https://github.com/id-Software/Quake-III-Arena
https://en.wikipedia.org/wiki/Id_Tech_3
(from the source release you can see benreesman remembered right: it was lcc)
Id Tech 3 was great, gave us a lot of forks.
2 replies →