4 ms·
> This is extraordinarily normal C code. I’ve worked with several large code bases that look like CPython code. Heck, a lot of Linux looks like that. Manually-
by gjvc 6y ago
> This is extraordinarily normal C code. I’ve worked with several large code bases that look like CPython code. Heck, a lot of Linux looks like that.
Manually-implemented dispatch / vtbls you mean?
- steerablesafe 6y agoYes, a lot of C libraries reinvent dynamic dispatch with vtables or some other way. Sometimes they reinvent exceptions as well with longjmp.
- gjvc 6y agoWell then, I agree with jnwatson.
- enriquto 6y ago> reinvent exceptions as well with longjmp. What a bizarre way to phrase it. Shouldn't it be the other way round? Exceptions are just a "reinvention" of longjmp under a different name (yet identically noxious to program readability).
- richardwhiuk 6y agoExceptions are a programming flow control concept. longjump is a specific family of processor op codes. This is the same idea that while loops are implemented using goto.
- miohtama 6y agoOther C vtable implementations - GTK (Gnome / GIMP) - COM (Windows - though it is more intervined with C++) - Quake / Doom and other old game engines though nobody uses C anymore today