Compiling multiple source files --- each file separately, or all together?

monkyyy crazymonkyyy at gmail.com
Sat Dec 27 23:51:47 UTC 2025


On Saturday, 27 December 2025 at 21:33:56 UTC, David Given wrote:
> On Friday, 26 December 2025 at 14:33:48 UTC, monkyyy wrote:
>> Its not the 1970's
>
> Gosh, is it? I did not know that!
>
>so having multiple
> `.o` files doesn't complicate anything; is there any benefit to 
> the compiler to using a single `.o` file? e.g. fewer copies of 
> shared code?
>

As I said, if you treat d like 1970's c youll break templates.

Templates *MUST* inverse the top down c preplanning to a bottom 
up process. If you have a foo!T ever part of bar.d; then where 
ever foo was defined *must* be part of the compilation; when you 
get my code where its nested template calls foo!(bar!(faz!(baz))) 
like types *only* the laziness, simplest call works.

Ever having managed .o files themselves suggest your thinking 
about a 1970 c thought process. When you call the historical c 
like flags; like `-o`; your only just adding exciting ways to 
learn how templates dont fit with the c abi.


More information about the Digitalmars-d mailing list