Type safety could prevent nuclear war
tsbockman via Digitalmars-d
digitalmars-d at puremagic.com
Thu Feb 4 16:38:16 PST 2016
On Friday, 5 February 2016 at 00:03:56 UTC, Chris Wright wrote:
> Doing this sort of validation requires build system integration
> (track the command line arguments that went into producing this
> object file; find which object files are combined into which
> targets; run the analysis on that) and costs as much time as
> compiling the whole project from scratch.
There is no need to take "as much time as compiling the whole
project from scratch".
The necessary information is already gathered during the normal
course of compilation; all that is required is to actually save
it somewhere until link-time, instead of throwing it away.
The time required for the check should be at most O(N log(N)),
where N is the number of function and global variable
declarations in the project. The space required for the table is
O(N). In both cases the constant factors should be quite small.
> Developing such a system is nontrivial, so it's not a matter of
> conjuring excuses; rather, someone would have to put in
> considerable effort to make it work.
Adding any interesting feature to a build system is usually
nontrivial, but I still think you're overestimating the cost of
this one.
Again, the hard part (finding all the signatures and processing
them into a semantically meaningful form) is already being done
by the compiler. The results just need to be saved, sorted, and
scanned for conflicts.
More information about the Digitalmars-d
mailing list