in another thread we mentioned be more accepting of “progressive” c. so i thought i’d share this (sorry if self-links are not accepted - i checked the guidelines and it seemed ok), which was my attempt at pushing the limits of how c might be programmed.
the example code at https://bitbucket.org/isti/c-orm/wiki/FlowPhonebook shows the full flavour. error handling (return codes) is systematized with macros; functions are “namespaced” (in structs); the ORM itself include dynamically generated code (form a python script).
i’m not saying all c programs should be like this. it was an experiment…
Looks neat! If you’re interested in taking C to it’s absolute limits along those same lines you might want to check out libCello.
oh, that’s interesting. one thing i tried to avoid was anything that forced changes globally in the user’s program. so, for example, even though there’s a string type, the interfaces are mainly char*. i wonder how “invasive” or “polluting” cello is (especially exceptions). but i need to look in more detail. thanks.
[edit: it’s making me feel guilty that i needed code gen for so little…!]