phobos dependencies

Dmitry Olshansky dmitry.olsh at gmail.com
Sun Dec 22 01:16:18 PST 2013


22-Dec-2013 08:23, Andrei Alexandrescu пишет:
> On 12/21/13 1:38 PM, Dmitry Olshansky wrote:
>> As it stands the only thing lazy buys us is "pay as you touch" contrary
>> to "pay as you name the intent to touch". The problem is that the
>> payment is for the whole stock of the said "shop". I see second problem
>> (granularity of imports) as far more critical then the first (condition
>> under which the pieces are imported). The second problem seems solvable
>> within the current implementation, the first seems like it would need
>> arbitrary amount of time to fix and gains are marginal.
>
> The way I see it is we can improve the compilation speed for everyone
> without having them change the code in any way, as opposed to toiling
> over phobos to the benefit of nothing else but phobos.

Because of poor organization of Phobos we have to. Anyhow work on std 
library is a major benefit to everyone who uses it (including 
compilation speed). And nobody have to change code to get the benefits 
e.g. the proverbial size of hello world is going to be smaller (you 
surely recall that recent problem).

Unlike Phobos many projects already have sane package structure but the 
moment they use this tiny primitive (e.g. writeln) in Phobos compile 
times drop.

> Which is the
> better win?

I'd take both :o)

I'm not against lazy imports per see. The problem is that the "instant" 
benefit is going to be smaller then you seem to imply. I'd like to be 
proven otherwise but there is no experimental compiler to see yet.

If Phobos stays pretty much as is lazy imports is just a new 
(potentially slow and bogus) feature. And we know how new stuff works - 
see -allinst switch. On the other hand restructuring Phobos is a bonus 
that users don't have to suffer for.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list