Deutsch   English   Français   Italiano  
<v3hehi$39s59$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: C23 thoughts and opinions
Date: Sun, 2 Jun 2024 10:37:55 +0100
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <v3hehi$39s59$1@dont-email.me>
References: <v2l828$18v7f$1@dont-email.me>
 <00297443-2fee-48d4-81a0-9ff6ae6481e4@gmail.com>
 <v2lji1$1bbcp$1@dont-email.me> <87msoh5uh6.fsf@nosuchdomain.example.com>
 <f08d2c9f-5c2e-495d-b0bd-3f71bd301432@gmail.com>
 <v2nbp4$1o9h6$1@dont-email.me> <v2ng4n$1p3o2$1@dont-email.me>
 <87y18047jk.fsf@nosuchdomain.example.com>
 <87msoe1xxo.fsf@nosuchdomain.example.com> <v2sh19$2rle2$2@dont-email.me>
 <87ikz11osy.fsf@nosuchdomain.example.com> <v2v59g$3cr0f$1@dont-email.me>
 <v30l15$3mcj6$1@dont-email.me> <v30lls$3mepf$1@dont-email.me>
 <v30sai$3rilf$1@dont-email.me> <v320am$1km5$1@dont-email.me>
 <v33ggr$e0ph$1@dont-email.me> <v34bne$i85p$1@dont-email.me>
 <v3758s$14hfp$1@raubtier-asyl.eternal-september.org>
 <v38of2$1gsj2$1@dont-email.me> <v39v87$1n7bk$1@dont-email.me>
 <v3du4s$2febh$3@dont-email.me> <v3etlq$2o0sh$1@dont-email.me>
 <v3goqo$36n61$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 02 Jun 2024 11:37:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="67b8fee0090bd0bfbe16789769c90f58";
	logging-data="3469481"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/uYrWhi5cnE8i0WA1HCYmy"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:MwLq5o1KHZJMcGWPus2xVjLvUY8=
In-Reply-To: <v3goqo$36n61$1@dont-email.me>
Content-Language: en-GB
Bytes: 3596

On 02/06/2024 04:27, Lawrence D'Oliveiro wrote:
> On Sat, 1 Jun 2024 11:37:45 +0100, bart wrote:
> 
>> My compilers don't routinely generate object files, which would also
>> need an external dependency (a linker), but they can do if necessary
>> (eg. to statically link my code into another program with another
>> compiler).
> 
> Modular code design would indicate that there is no point the compiler
> duplicating functionality available in the linker.

Python uses modules and yet doesn't have a linker. How on earth does it 
manage?

Lots of languages get by without linkers. Or without having to 
pointlessly write out lots of discrete files, with a lot of useful info 
lost, then having to read them all in again. (Look at the mess that 
'objcopy' gets into.)

Quite a few compilers give the impression that they also do the job of 
linking:

   gcc x.c y.c z.c

produces an executable. Does it really matter here whether the 'linking' 
is done by a separate program on discrete files, or completely internally?

Having all modules in-memory gives you the opportunity for whole-program 
optimisation, will all useful info intact, without having to invent the 
far hairier and unwieldy concept of LTO.

Here is also my assembler in action given modules x.asm y.asm z.asm 
produced by my C compiler:

   aa x y z

It does the job of 'linking' but working from .asm files straight to 
..exe or .dll. What's the effing point of a separate linker here?

Personally I first designed out a traditional linker sometime around 
1983. The special Loader I write to combined my object files into a 
single binary took seconds, even on floppies. A traditional linker would 
have taken minutes. God knows what they were doing.