ModuleInfo, factories, and unittesting

Mike via Digitalmars-d digitalmars-d at puremagic.com
Sun Dec 18 16:26:46 PST 2016


On Sunday, 18 December 2016 at 16:53:24 UTC, Andrei Alexandrescu 
wrote:
> What other issues/opportunities do you see related to 
> ModuleInfo?

I think it would be better to take a more holistic look at the 
relationship between the compiler and druntime.  It's my 
understanding that many of the contracts between the compiler and 
druntime were written at at time when D didn't have things like 
templates and rich compile-time features.

I think there is an opportunity to refactor the ModuleInfo, 
TypeInfo, and probably many other features, moving them out of 
the compiler into druntime (See 
http://forum.dlang.org/post/eiwalbqlbkipdrmsrfoh@forum.dlang.org 
for a precise explanation).  Then, with druntime's source code 
containing templates, conditional compilation, static-if, and the 
like, when the user compiles their code it only generates code 
that is actually being used.

It could even be taken further with something like this 
(http://forum.dlang.org/post/psssnzurlzeqeneagora@forum.dlang.org) where druntime's implementation is distributed as .di header files for compile-time verification and advantages beyond your original stated goal.

Mike




More information about the Digitalmars-d mailing list