[Oberon] *****SPAM***** Re: Should hidden re-imports be able to coexist with identifiers

strohm at airmail.net strohm at airmail.net
Sun May 16 04:41:08 CEST 2021


> I have two problems in forcing the programmer to think about import ordering:
> 1. It does not scale. If you have big systems it is hard to hold in your head
>    all the import relationships. It is better to have the compiler figure it out
>    for you and do the proper checks.
> 2. It breaks encapsulation. If I (module B) import a module A, I should only care
>    about its public interface, not how it is implemented. So if the module A
>    re-imports types and indirectly could mess with the import order of my
>    module B, we have implementation details leaking through. So when the
>    implementation changes the import order of the client modules could break.

These are VERY important points.

The programmer absolutely should not care about import order.  That's what computers are for.

I'd say "make the TOOLSET figure it out", as opposed to "make the COMPILER figure it out", keeping Michael Franz's "slim binaries" work in mind, that deferred actual code generation to load time.  Load modules were  essentially just parse trees for the source code modules.  The actual code generator was in the loader.  It worked because file read time absolutely dominates compile time.

--John R. Strohm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20210515/4de9bc51/attachment.html>

More information about the Oberon mailing list