3 ms·
> it looks to be some sensible guidelines/practices But more notably I think, a whole bunch of custom functions and data types to be used in place of more typ
by duneroadrunner 10y ago
> it looks to be some sensible guidelines/practices
But more notably I think, a whole bunch of custom functions and data types to be used in place of more typical C coding practices. The document references a number of (presumably custom) header files (lib/buffer.h, lib/str.h, lib/strfuncs.h, lib/array.h, lib/data-stack.h, lib/mempool.h), the Boehm GC, and use of "GCC Extensions".
Also, there seems to be one person contributing an overwhelming proportion of commits (just going by the "contributors" page). Hmm, this seems to be an example of largely a single person implementing a program in C with a priority on code safety. Impressively successfully. But with substantial effort and individual discipline employed to avoid the pitfalls of C.
I'm not sure how scalable/transferable this kind of approach is. Perhaps the takeaway here is
i) This is an impressive (mostly) individual achievement.
ii) Dovecot may have some useful libraries for improving code safety if you're forced to or are committed to using C.
iii) The effort and discipline required to achieve code safety in C in this case, might also be interpreted as a validation of the effort and time required to achieve code safety by adopting newer alternatives like Rust and SaferCPlusPlus[1] when those choices are available.
[1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus https://github.com/duneroadrunner/SaferCPlusPlus