AST files instead of DI interface files for faster compilation and easier distribution

Jonathan M Davis jmdavisProg at gmx.com
Fri Jun 15 00:11:27 PDT 2012


On Friday, June 15, 2012 08:58:55 Don Clugston wrote:
> I don't think Phobos should use .di files at all. I don't think there
> are any cases where we want to conceal code.
> 
> The performance benefit you would get is completely negligible. It
> doesn't even reduce the number of files that need to be loaded, just the
> length of each one.
> 
> I think that, for example, improving the way that array literals are
> dealt with would have at least as much impact on compilation time.
> For the DMD backend, fixing up the treatment of comma expressions would
> have a much bigger impact than getting lexing and parsing time to zero.
> 
> And we're well set up for parallel compilation. There's no shortage of
> things we can do to improve compilation time.
> 
> Using di files for speed seems a bit like jettisoning the cargo to keep
> the ship afloat. It works but you only do it when you've got no other
> options.

On several occasions, Walter has expressed the desire to make Phobos use .di 
files like druntime does, otherwise I probably would never have considered it. 
Personally, I don't want to bother with it unless there's a large benefit from 
it, so if we're sure that the gain is minimal, then I say that we should just 
leave it all as .d files. Most of of Phobos would have to have its 
implementation left in any .di files anyway so that inlining and CTFE could 
work.

- Jonathan M Davis


More information about the Digitalmars-d mailing list