2 ms·
If you're writing C, you'll be writing much worse than that on a regular basis. There's a reason I rarely use C any more. But of course if you're going to reim
by vidarh 4y ago
If you're writing C, you'll be writing much worse than that on a regular basis. There's a reason I rarely use C any more.
But of course if you're going to reimplement OO from scratch in C you will see the entire machinery laid bare. You're only doing it in the first place either because you're committed to using C for whatever reason, or to understand OO implementation strategies.
- vidarh 4y agoReplying to myself to leave this here, since it's vaguely related. If anyone really want to have nightmares about OO'ish concepts in C, here is a few different ways to implement closures in C, going from relatively straightforward, to (unportable) runtime generation of assembler thunks: https://hokstad.com/how-to-implement-closures https://hokstad.com/how-to-implement-closures
- deleted 4y ago[deleted]