Am 21.05.17 um 12:23 schrieb bartc:
On 20/05/2017 19:37, Chris Angelico wrote:
rosuav@sikorsky:~/linux$ find -name \*.c -or -name \*.h | wc -l
44546
These repositories, by the way, correspond to git URLs
https://github.com/python/cpython,
git://pike-git.lysator.liu.se/pike.git,
git://source.winehq.org/git/wine, and
https://github.com/torvalds/linux respectively, if you want to check
my numbers. Two language interpreters, a popular execution subsystem,
and an OS kernel.
I'd like to see you create a single-file version of the Linux kernel
that compiles flawlessly on any modern compiler and has no configure
script.
I've had a look at the Linux stuff. (BTW, when copying to Windows, the
file "aux" occurs several times, which causes problems as it's a
reserved filename I think. Also there were a dozen conflicts where
different versions of the same file wanted to be stored at the same
location.)
So, it /is/ big: 24000 .c files, 19000 .h files, out of 59000 total.
(And 12000 directories, but I think that includes multiple "." and ".."
instances, so probably 'only' about 4000.)
However, I assume then when it is at some point compiled to binary, that
a single image file results.
No, it doesn't, at least not necessarily. The Linux kernel includes all
of the device drivers that are supported by Linux. This is the main
reason that it is such a big project. These device drivers can either be
linked statically into the kernel, which makes sense for all stuff which
is needed during the boot process, or on embedded systems, or compiled
into kernel modules, kind of "dynamic libraries" of the kernel, which it
loads/unloads at runtime.
An attempt to create a single source file would result in a
representation somewhere between those two points. But it sounds like it
wouldn't be possible, or practical, to have a single source that works
for every possible target;
It is most definitely not. Linux runs on a large diversity of platforms.
It has an elaborate build process, wicth a GUI to configure all the
compile options. Probably no human would be able to set them to a
reasonable value without the help of thsi software.
Christian
--
https://mail.python.org/mailman/listinfo/python-list