I was under the impression that "A D interface file contains only what an import of the module needs, rather than the whole implementation of that module." To me, that translates to signatures - just return types, names and arguments, so that the compiler knows it's valid and the linker can do the dirty work later.
Running a file through dmd, though, strips almost nothing:
import std.stdio;
void SayHello(const string Name)
{
writeln("Hello, ", Name, "!");
}
dmd Interface.d -o- -H
// D import file generated from 'Interface.d'
import std.stdio;
void SayHello(const string Name)
{
writeln("Hello, ",Name,"!");
}
Hardly a paragon of optimization.
What, exactly, is stripped in interface files?
(header-files added because it's the closest thing I could find.)
.difiles aren't actually part of the standard, so there aren't any politics to get in the way of that idea. I wonder why they haven't done it!