Voldemort Types in D

Jonathan M Davis jmdavisProg at gmx.com
Wed May 9 15:35:46 PDT 2012


On Wednesday, May 09, 2012 14:06:10 Walter Bright wrote:
> On 5/9/2012 1:35 PM, Jonathan M Davis wrote:
> > Yeah. You _can_ strip them out (except for templates), but doing so
> > restricts what you can do (in this case, killing inlining and CTFE).
> > Personally, I think that it makes .di files essentially useless except in
> > specific cases where you can't use CTFE anyway and inlining isn't an
> > issue (e.g. much of std.file wouldn't need its implementation available,
> > but that would be fatal to a module like std.string).
> 
> Consider the garbage collector. There's no way you'd want to CTFE that. It
> makes perfect sense to only provide an interface to it (.di) rather than
> full source.
> 
> And for many other things.

Yes. There _are_ cases where not providing the whole source makes sense, but I 
really think that that's the exception rather than the rule given the need for 
the full source for CTFE and inlining. I also suspect that in a lot of cases, 
automatically generating .di files makes no sense, because you need control 
over what is and isn't available. Using automatic generation as the base and 
then editing it makes a lot of sense, but blindly doing it on an entire 
project like we do with druntime is probably a mistake. And Adam's Wilson's 
attempt to make the .di generation strip out as much as possible makes that 
even worse.

- Jonathan M Davis


More information about the Digitalmars-d-announce mailing list