Compilation strategy

Jonathan M Davis jmdavisProg at gmx.com
Sun Dec 16 22:27:31 PST 2012


On Sunday, December 16, 2012 19:18:45 Walter Bright wrote:
> On 12/16/2012 5:10 PM, Jonathan M Davis wrote:
> > On Sunday, December 16, 2012 16:57:31 Walter Bright wrote:
> >> I've done such (precompiled headers for C++), I've done .di files, and
> >> I've
> >> done Java bytecode. .di files are superior in nearly every way.
> > 
> > Given that .di don't work with inlining or CTFE,
> 
> The other schemes outlined will not work any better, because they are
> fundamentally no different.
> 
>  > in favor of a binary solution
> 
> Whether the file format is text or binary does not make any fundamental
> difference.

If the entire .d file is there in binary form, then I don't see why it wouldn't 
work. .di files fail because they strip out the implementation. If a binary 
format were used, then we should be able to get away with keeping the 
implementation there, because then it's obfuscated rather than for sitting 
there for all to see, which is why corporations and the like insist on 
distributing only headers. Even with an object file, the best that you get is 
obfuscation, because it can always be reverse engineered, so it seems to me 
that what needs to be avoided is providing text. As long as we use text, we're 
forced to cut out the implementation and end up crippling any code that uses 
that module, since it can't inline it or use it in CTFE. In binary format, 
it's obfuscated, so the entire implementation can be there, allowing inlining 
and CTFE to work.

- Jonathan M Davis


More information about the Digitalmars-d mailing list