CTFE and DI: The Crossroads of D

Jonathan M Davis jmdavisProg at gmx.com
Wed May 9 15:43:51 PDT 2012


On Thursday, May 10, 2012 00:29:23 Adam D. Ruppe wrote:
> On Wednesday, 9 May 2012 at 22:15:02 UTC, Adam Wilson wrote:
> > Sure, but a lot of software developers, particularly those with
> > money, don't want their source getting out, and in a lot of
> > cases, there is no good reason to distribute the source.
> 
> Yeah, you're preaching to the choir... which is why I'm
> against changing anything for druntime's sake.
> 
> Your path for the .di files does the right thing. Don't
> change that just because it breaks druntime.
> 
> druntime is open source, so there's no need for it to
> be using .di generation in the first place, whether it
> is a shared library or not

What we probably should do is change druntime's makefile so that it generates 
.di files for certain files and just uses the .d files for others. And in some 
cases, we may want to do what we do with object.di and hand edit the .di file 
rather than generate it every time.

Some stuff should definitely use .di files (e.g. the rt stuff), but other stuff 
clearly shouldn't (e.g core.time). thread.d actually seems to already have a 
hand-crafted .di file. And for much of druntime, generating .di files is utterly 
pointless anyway, because it's just a bunch of extern(C) declarations.

Regardless of the state of automatic .di generation, I think that the blind 
generation of .di files for pretty much all of druntime like we do now is a 
mistake. If it were fixed so that only specific portions used automatic .di 
generation or so that all of its .di files were maintained by hand, then it 
wouldn't matter if the automatic .di generation was overly enthusiastic in 
stripping out code.

- Jonathan M Davis


More information about the Digitalmars-d mailing list