Compilation strategy

Walter Bright newshound2 at digitalmars.com
Tue Dec 18 08:12:51 PST 2012


On 12/18/2012 7:51 AM, H. S. Teoh wrote:
> An idea occurred to me while reading this. What if, when compiling a
> module, say, the compiler not only emits object code, but also
> information like which functions are implied to be strongly pure, weakly
> pure, @safe, etc., as well as some kind of symbol dependency
> information. Basically, any derived information that isn't immediately
> obvious from the code is saved.
>
> Then when importing the module, the compiler doesn't have to re-derive
> all of this information, but it is immediately available.
>
> One can also include information like whether a function actually throws
> an exception (regardless of whether it's marked nothrow), which
> exception(s) it throws, etc.. This may open up the possibility of doing
> some things with the language that are currently infeasible, regardless
> of the obfuscation issue.

This is a binary import. It offers negligible advantages over .di files.



More information about the Digitalmars-d mailing list