Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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?



Yes, a lot of C libraries reinvent dynamic dispatch with vtables or some other way. Sometimes they reinvent exceptions as well with longjmp.


> 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).


Exceptions 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.


Well then, I agree with jnwatson.


Other 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: