4 ms·
They should have looked at the good module system of OBJECT PASCAL (derived from MODULA). It is easy and allows all kinds of protections. The main difference i
by zyxzevn 10y ago
They should have looked at the good module system of OBJECT PASCAL (derived from MODULA). It is easy and allows all kinds of protections.
The main difference is that in this language a module always is one file, which consists of 2 parts.
1. INTERFACE (public)
2. IMPLEMENTATION (private)
The way it is organized makes compilations also very fast.
USES only uses the public parts of the module.
A LIBRARY is like crate in rust.
Sadly, this module system does not use private classes/types in public functions. But that would not be hard to add.
I have no idea what Rust tried to accomplish. Being used to Object pascal many other module systems seem primitive.
- pjmlp 10y agoActually that model came originally from USCD Pascal and was adopted by Apple for Object Pascal, but Borland did improved it quite a bit. You forgot to mention, cyclic dependencies were allowed on implementation part. Also later on, Delphi introduced packages, which are a set of units, with just some of them being public. Similar to the upcoming Java 9 package model.
- pcwalton 10y agoHow does this solve any of the problems listed in the article?