Library standardization

Walter Bright newshound1 at digitalmars.com
Sun Apr 20 22:18:42 PDT 2008


e-t172 wrote:
> - Like you said, indentation is stripped. This make .di files quite 
> ugly. Considering that .di files will often be directly read by the user 
> of the API, this is a problem.

The .di files are meant for the compiler to read, not the user. They're 
supposed to strip out all the extra whitespace and comments. Think of 
them as "precompiled headers."


> - There should be some kind of feature to automatically copy the 
> "documentation comments" (ddoc, doxygen, etc) from the .d files to the 
> .di files when they are generated. A solution would be to automatically 
> include all comments which are not in implementation code.

The human-readable form is the ddoc output.


> - If I understand your statement correctly, it means the D compiler 
> decides on its own whether to inline a function or not.

That's right.


> I don't think 
> it's a good idea, because it will lead to very strange problems and 
> unexpected behaviour when dealing with shared libraries. (actually this 
> is not a .di issue, but a more general one).

It shouldn't lead to any observable behavior difference (other than 
runtime speed and code size). Inlining should be the purvey of the 
compiler much like which variables are to be enregistered.

The only reason there's a switch on the command line for it is because 
it's easier to debug code if it hasn't been inlined.



More information about the Digitalmars-d mailing list