Sujet : Re: else ladders practice
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 25. Nov 2024, 18:25:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vi2bul$2sl23$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Mozilla Thunderbird
On 25/11/2024 16:27, Keith Thompson wrote:
Bart <bc@freeuk.com> writes:
On 25/11/2024 11:21, Waldek Hebisch wrote:
Bart <bc@freeuk.com> wrote:
This seems to be a thing with Linux, where a big chunk of a C
implementation is provided by the OS.
>
That is, standard headers, libraries, possibly even 'as' and 'ld'
utilities. On Windows, C compilers tend to be self-contained (except for
Clang which appears to be parasitical: it used to piggy-back onto gcc,
then it switched to MSVC).
You know that at source level there are separate projects: gcc
proper, binutils and libc.
>
Actually, no I don't. I said more on this in my reply to Keith a short
while ago.
You don't know that after it's been explained to you dozens of times?
My experience of C compilers on Windows is that they provide a means
to turn .c files into executable files. Such a compiler on Windows
generally has to be self-contained, since very little is provided by
the OS.
Bart, can you explain the difference between a C compiler and a C
implementation? Or do you believe they're the same thing? (Hint:
They're not.)
Well, I write language implementations, and I consider them largely the same thing.
So who's right? Just becase a C compiler works in a certain peculiar way on one OS doesn't means that is the only way.
Have a look at the 'CC' product described here, about half way down:
https://github.com/sal55/langs/blob/master/CompilerSuite.mdIt is a single file that can turn into source into native code, or it can run it directly, or it can interpret it.
I call this 0.3MB program a 'compiler'. I also call it an C implementation (technically, a C subset). (What would /you/ call what this program does?)
All it lacks that you might quibble over is an implementation of the C standard library. I use a library that is part of Windows, and also use that same library from two other languages, neither of which is C.
Technically, a 'C' compiler only needs to turn C source into some next-level representation. Beyond that it's pretty much a compiler like any other, not specific to C. A compiler may consider its job done when it gets to IR, or ASM source, or it may continue all the way to a running binary, like mine do.
As to what gcc does and how it's classified, I'm past caring. Does it eventually produce a binary? Then that's all that matters.