core.traits?

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Jan 7 21:41:58 UTC 2019


On Mon, Jan 07, 2019 at 01:25:17PM -0800, Manu via Digitalmars-d wrote:
[...]
> Okay, so this is a challenging effort, since phobos is such a tangled
> rats nets of chaos...

It's already gotten better over the years in some ways (though not
others -- unfortunately I'm afraid std.traits might be one of the places
where things have probably gotten more tangled).  It certainly hasn't
lived up to the promise of that old Phobos Philosophy page that once
existed but has since been removed, of Phobos being a collection of
lightweight, self-contained, mostly-orthogonal, reusable components.  It
has become quite the opposite, where the dependency graph of Phobos
modules is approaching pretty close to being a complete graph.  (And
yes, there are some pretty deep-seated cyclic dependencies that thus far
nobody has been able to truly unravel in any satisfactory way.)


> But attempting to move some traits immediately calls into question
> std.meta.  I think we can all agree that Alias and AliasSeq should be
> in druntime along with core traits... but where should it live?
> Should there be core.meta as well? It's kinda like core.traits, in
> that it doesn't include runtime code, it doesn't increase the payload
> of druntime.lib for end-users..

Shouldn't all of core.traits be like that?  I'd hardly expect any
runtime component to be associated with something called 'traits'.


> Perhaps AliasSeq should live somewhere different?
> I'm feeling like a lean/trimmed-down core.meta might want to exist
> next to core.traits though; it seems reasonable.

I'm afraid this would set the wrong precedent -- since there's
core.traits for std.traits and core.meta for std.meta, why not also have
core.typecons, core.range, and then it's all gonna go downhill from
there, and before you know it there's gonna be core.stdio and
core.format... *shudder*


> ...yes, this process will go on and on. The only way forward is to
> take each hurdle one at a time... and ideally, in attempting this
> effort, we can de-tangle a lot of cruft during the process.

I'm tempted to say we should put everything in core.traits for now. And
just the absolute bare minimum it takes to meet whatever druntime needs,
and nothing more.


T

-- 
I think Debian's doing something wrong, `apt-get install pesticide', doesn't seem to remove the bugs on my system! -- Mike Dresser


More information about the Digitalmars-d mailing list