7 ms·
> thanks to the cast. well, exactly: languages are able to do without the cast at all, just extracting type information from the runtime, which is much safer.
by jcelerier 9y ago
> thanks to the cast.
well, exactly: languages are able to do without the cast at all, just extracting type information from the runtime, which is much safer.
- colanderman 9y agoYou wrote the example, not me. I'm confused what your argument is. Are you saying that dynamic loaders should check the type of dynamically loaded code against the type expected by the code loading it? I agree that's a good idea, but it doesn't require language support for general RTTI, just a type-aware shared-object format and dynamic loader. (Heck, C++ symbol names already incorporate function argument type signatures, so this isn't a huge stretch.) Are you saying that a runtime shouldn't need to trust that dynamically-loaded code actually implements the interface it claims to? If so, that's an incredibly specific requirement that's really better served by sandboxing or an RPC-like interface (especially in C/C++).