3 ms·
How are modules related to type safety?
by jstimpfle 6y ago
How are modules related to type safety?
- AnimalMuppet 6y agoBecause, if you program in a type-safe language, if you call something that is compiled separately from you, you'd still like to maintain type safety across that call boundary.
- jstimpfle 6y agoYou absolutely get type safety across module boundaries with C in that if provider and user both compile against the same interface, this will be typesafe. You could even have this type safety on the linker level as far as C is concerned. You just need an object file format that exports C types for symbols. This is not done on any of the (few) systems I know, and probably for practical reasons. Some other languages give you this link time safety, but I assume at the cost of less interoperable object files.