D is dead (was: Dicebot on leaving D: It is anarchy driven development in all its glory.)
Eugene Wissner
belka at caraus.de
Thu Aug 23 07:47:59 UTC 2018
On Thursday, 23 August 2018 at 07:37:07 UTC, Iain Buclaw wrote:
> Symptom: The compiler can't discard unused symbols at compile
> time, and so it will spend a lot of time pointlessly optimising
> code.
>
> Problem: D has no notion of symbol visibility.
>
> Possible Solution: Make all globals hidden by default unless
> 'export'.
>
> Side effects: Everyone will be spending weeks to months fixing
> their libraries in order to only mark what should be visible
> outside the current compilation unit as 'export'.
>
> Benefits: Faster compile times, as in, in the most extreme
> example I've built one project on github with gdc -O2 and build
> time went from 120 seconds to just 3!
>
> Iain.
You can probably solve it like haskell does: Export all symbols
by default.
So this module exports everything:
-----------
module MyModule where
-- My code goes here
-----------
this one not:
-----------
module MyModule (symbol1, symbol2) where
-- My code goes here
-----------
More information about the Digitalmars-d
mailing list