Deutsch   English   Français   Italiano  
<vilbak$3j4dg$2@dont-email.me>

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

Path: ...!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: question about linker
Date: Mon, 2 Dec 2024 22:11:32 +0000
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <vilbak$3j4dg$2@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <viaqh0$nm7q$1@dont-email.me>
 <877c8nt255.fsf@nosuchdomain.example.com> <viasv4$nm7q$2@dont-email.me>
 <vibr1l$vvjf$1@dont-email.me> <vic73f$1205f$1@dont-email.me>
 <20241129142810.00007920@yahoo.com> <vicfra$13nl4$1@dont-email.me>
 <20241129161517.000010b8@yahoo.com> <vicque$15ium$2@dont-email.me>
 <vid110$16hte$1@dont-email.me> <87mshhsrr0.fsf@nosuchdomain.example.com>
 <vidd2a$18k9j$1@dont-email.me> <8734j9sj0f.fsf@nosuchdomain.example.com>
 <vidnp3$1ovvm$2@paganini.bofh.team> <vihpjh$2hgg1$1@dont-email.me>
 <vihrh1$2hk5l$1@dont-email.me> <vii0jp$2jkd9$1@dont-email.me>
 <viifv8$2opi7$1@dont-email.me> <vik28b$390eg$1@dont-email.me>
 <vik8tc$3ang9$1@dont-email.me> <vikjff$3dgvc$1@dont-email.me>
 <viku6a$3fqqa$1@dont-email.me> <vil7gb$3ie9o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 02 Dec 2024 23:11:32 +0100 (CET)
Injection-Info: dont-email.me; posting-host="8d706a207c8aaed216e2647004c96849";
	logging-data="3772848"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19BG7MFXQZyFo9RlLRNjLd7"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vg7LQsnqXv036jehoO6Q+hecVe0=
Content-Language: en-GB
In-Reply-To: <vil7gb$3ie9o$1@dont-email.me>
Bytes: 4394

On 02/12/2024 21:06, David Brown wrote:
> On 02/12/2024 19:27, Bart wrote:
>> On 02/12/2024 15:24, David Brown wrote:
>>> On 02/12/2024 13:24, Bart wrote:
>>
>>> I would consider any kind of automatic import system to be a bad idea.
>>
>> It's not automatic; you have to list the modules. If you don't want 
>> data shared, then don't export it!
>>
> 
> As I understood it, or perhaps failed to understand it (after all, it's 
> not as if there are published specifications, references,

https://github.com/sal55/langs/blob/master/Modules24.md

(A summary, mainly for my benefit, about a year old.)

> tutorials or 
> examples for your language)

I gave an example in my post, of the lead module for my C compiler. 
Older examples are in that link.

In all (counting the 'pcl' backend library) it comprises 36 source files 
in two folders; plus about 40 C headers in two folders, which are 
embedded into the executable.

This information is enough for the compiler, and nothing else, to locate 
all the necessary files and to build an EXE file.


> you would list your modules for a program 
> in one place, and then other modules in the program automatically import 
> them all.

The logic used in the name resolution pass of the compiler allows 
visibiliy without needing full name-qualifying.

That is incredibly convenient. It means clean source code with no xxx. 
or xxx:: littering everywhere. I don't even need different sets of 
'import xxx' in each module.

I can rename any module, and I only need to change the one file. I can 
move an exported function from one module to another, without making any 
other changes (eg. change all xxx.F() to yyy.F()).

I just wonder what sort of dog's breakfast C++'s new module scheme is, 
or will be.

>>    from math import sqrt
>>
>> (which also has the effect of making 'sqrt' part of this module's 
>> namespace).
>>
> 
> This is sometimes convenient for functions that you are going to use a 
> lot.  At other times, you use "import math" and then refer to "math.sqrt".

You can achieve the same thing with 'sqrt = math.sqrt'. Meanwhile my 
module scheme gives you that for free. With 20 minutes spare I could add 
an option for to turn it off.

> Perhaps you simply don't know how teams might work.

Perhaps not. So? Not everyone works in a team.

However one scripting language I created allowed anybody to create 
'horizontal' addons for my application with my involvement. They didn't 
need to modify or rebuild my app (or even restart it). Multiple people 
could create scripts even for the same instance of a running application.