core.traits?

Manu turkeyman at gmail.com
Mon Jan 7 22:37:10 UTC 2019


On Mon, Jan 7, 2019 at 1:42 PM H. S. Teoh via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> 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*

Well, I think you're kinda catastrophising here... I said very clearly
"The only way forward is to take each hurdle one at a time", and I
mean that as literally as possible.
One at a time...

The question is: core.meta... yeah?
No precedents are being set.. we're not opening flood gates, it's a
singular question.

> > ...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.

Are you saying we should put *everything* in core.traits? That is, put
AliasSeq in core.traits? It's objectively NOT a 'traits'...


More information about the Digitalmars-d mailing list