Sujet : Re: C23 thoughts and opinions
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 03. Jun 2024, 11:13:32
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3k50b$3rdhi$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
User-Agent : Mozilla Thunderbird
On 03/06/2024 02:16, Lawrence D'Oliveiro wrote:
On Sun, 2 Jun 2024 10:37:55 +0100, bart wrote:
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.
What is importlib, then, if not something that links everything together?
It seems to provide an API to the mechanisms behind 'import'.
And guess what: it’s a module.
So, you use it like this:
import importlib
maybe? So how does importlib manage to import importlib before importlib itself is imported?
There is NO ahead-of-time linking of modules in Python as it is understood in traditional compiled languages.
Besides, all such statements are executed at runtime, and can be conditional.
There are of course mechanisms to collate symbols across different modules, which are executed at runtime and on demand. There are similarities to the methods used to maintain the global symbol table in my whole-program compilers, or in my assembler.