Generality creep

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Mar 28 18:41:02 UTC 2019


On 3/28/19 2:30 PM, H. S. Teoh wrote:
> The only way I can see this happening is if we start a new iteration of
> Phobos, like std.v2.*

There'd be carefully carved subsets per capability, such as 
std.v2.betterc.*, std.v2.nogc.*, std.v2.noexcept.*, std.v2.safe.

The capability sets can be combined in alphabetic ordering. E.g. 
std.v2.noexcept.nogc.* has the subset that uses no gc and no exceptions, 
but std.v2.nogc.noexcept does not exist.

Through the magic of public imports and aliasing there would be no code 
duplication. Introspection could help, too, a la "define public aliases 
for all @safe definitions in that module". Some improvements to ddoc 
might be needed to "see" through aliases.


More information about the Digitalmars-d mailing list