Compile Imported Modules

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 24 09:52:48 PDT 2017


On Thu, Aug 24, 2017 at 04:49:08PM +0000, Seb via Digitalmars-d wrote:
[...]
> rdmd is really bad in terms of performance. If you call a single D
> file with rdmd, it will always compile it twice. There was an attempt
> to fix this (https://github.com/dlang/tools/pull/194), but this has
> been reverted as it introduced a regression and no one had time to
> look at the regression.  Moving rdmd into DMD has been on the TODO
> list for quite a while and there is a consensus that the performance
> overhead if rdmd isn't nice. However, IIRC there was no clear
> consensus on how the integration should happen. I recall that the plan
> was to do try this with "dmd as a library", but I'm not sure whether
> that's really feasible ATM.

Hmm. An interesting thought occurred to me: dmd already has a -run
option, so perhaps it wouldn't be too hard to add an auto-import option
like Jonathan proposes, then dmd would essentially have the
functionality of rdmd?  Well, other than caching the executable, that
is.  But once auto-import is in, redundant compilation will become a
thing of the past, as rdmd could just invoke dmd, and the only thing
extra it would do is the executable caching.


T

-- 
What doesn't kill me makes me stranger.


More information about the Digitalmars-d mailing list