Type safety could prevent nuclear war

tsbockman via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 4 23:42:11 PST 2016


On Friday, 5 February 2016 at 07:15:56 UTC, H. S. Teoh wrote:
> This would break shared library upgrades that do not change the 
> ABI.
>
> Plus, it doesn't fix wrong linkage at runtime, because the 
> dynamic linker is part of the OS and the D compiler has no 
> control over what it does beyond the standard symbol matching 
> and relocation mechanisms. If you compile against libfoo, but 
> at runtime the user happens to have a stale, ABI-incompatible 
> version of libfoo hanging around that gets picked up by the 
> dynamic linker, you'll have the same problem.

I should have clarified that I was considering static libraries, 
only. (I thought D's dynamic library support was kind of broken 
right at the moment, anyway?)

Dynamic libraries are definitely a harder problem. I think useful 
automated protection against bad .di files could be developed for 
dynamic libraries as well, but the scheme wouldn't be anywhere 
near as simple and it might require the maintainer to actually 
follow SemVer to be useful.


More information about the Digitalmars-d mailing list