On 05/17/2017 03:56 PM, bartc wrote: > It sounds more like CPython is written in assembly code rather than C. > Why don't the C language, C compilers and their optimisers take care of > these concerns?
No endianness definitely is something you as a programmer have to be aware of in any language that allows direct manipulation of memory. At least if you're going to do any bit twiddling. CPython is mostly C, but probably there's the odd bit of assembly to grab some specific feature they need. > (And what does the build system do with all this information, or is this > just routinely gathered anyway whether the application needs it or not?) Sometimes the information is routinely gathered, because as we said before configure is a compiled program, built from standardized macros. Whether Python does anything with all that information I don't know. But since configure can be built to specific needs, I suspect that CPython's internals do need to know about endianness, as well as some special CPU-specific instructions. There may well be the occasional drop down into inline assembly for some very few specific things. For example interpreters often rely on devices like trampolines and jump tables to get a bit of speedup. Might occasionally need a bit of ASM code (guarded by #ifdefs of course to make it platform independent). -- https://mail.python.org/mailman/listinfo/python-list