2 ms·
> I assumed that the module system mostly didn't interact with other language features, so I could kick it down the road for now. The main other language featu
by Joker_vD 1y ago
> I assumed that the module system mostly didn't interact with other language features, so I could kick it down the road for now.
The main other language feature it interacts with is types. And with compile-time type checking. Especially in the "separate compilation" scenario. Especially in the "incremental compilation" scenario. It was a hot research topic back in the 90s, culminating with SML's idea of translucent modules. It's still a research topic today.
Exporting/importing values and variables, on the other hand, is entirely straightforward in comparison. The only thing you really have to think about is whether "const" means "constant during one program execution" (i.e. whether doing "x := 3" is legal or not) or "constant during the whole development cycle" (i.e. whether you can inline it's current declared value into the places where it's used or not).