bartc wrote:
Compiling a C file should be nothing at all. Especially of a known, working program.
Writing reasonably portable C is feasible, as long as you don't use any platform-specific system calls or libraries, don't do any low-level bit twiddling that depends on data sizes and endianness, don't take advantage of compiler-specific features for speed, etc. Python does all of those things in spades. That's why it needs so many #ifdefs.
It's when you get a preponderance of #includes, #defined, #ifs, #ifdefs and #errors, especially in headers, that it becomes taxing to try and follow.
I fully agree that such code is hard to follow. But it's hard to see how to do any better, given that Python needs to work in such a diverse set of environments. I also happen to agree that the way the configuration system is implemented, based on a mishmash of shell scripting and m4 macros, is very difficult to follow for someone not deeply involved in its development. Anyone else more or less needs to treat it as a black box. Possibly the implementation could be improved. Something written in Python could probably be made clearer, although that would lead to a bootstrapping problem. But however it's done, the underlying complexity will remain, and dealing with that is never going to be a piece of cake. -- Greg -- https://mail.python.org/mailman/listinfo/python-list