archives

Mod sys with external binding of mods to mod sigs, where all mod imports must be sigs only

A module system variation I've been exploring is modules that can ONLY import module signatures (or some other interface or module type).

A separate type of source or configuration file, outside normal module source code files, would then just devote itself to binding these signature imports to concrete module implementations - on a per-importing module basis. There are some simple (good enough?) constraints designed to ensure that a module satisfies the same interface within some scope (like a library or package, ect.) when this matters.

Plowing ahead, I've been a bit in the weeds thinking about how to implement this with a "stock" assembler/linker via compiler cooperation and some pre-link stage glue code generation.

But really, I've rushed ahead too far too fast without looking around for similar lines of thinking and development efforts, presuming they exist.

I welcome any papers or language implementations or implementation experience reports along these lines. If nothing else, maybe I can avoid pursuit of a bad idea :-)

Mucho thanks.

p.s. Again, the model is that modules ONLY EVER import module signatures, and then concrete module implementations are assigned to these signatures outside the "normal" set of modules source code files.