| ▲ | jaen 5 hours ago | |
The paper does make this distinction under the "Concurrent Versions" property. Allowing concurrent versions though opens you up to either really insidious runtime bugs or impossible-to-solve static type errors. This happens eg. when you receive a package.SomeType@v1, and then try to call some other package with it that expects a package.SomeType@v2. At that point you get undefined runtime behavior (JavaScript), or a static type error that can only be solved by allowing you to import two versions of the same package at the same time (and this gets real hairy real fast). Also, global state (if there is any) will be duplicated for the same package, which generally also leads to very hard-to-discover bugs and undefined behavior. | ||
| ▲ | Onavo 5 hours ago | parent [-] | |
Good points. Practically speaking though global state is rarely an issue unless it's the underlying framework (hence peer deps). Modern languages are mostly lexically scoped and using primarily global variables for state aside from Singletons has fallen out of favor outside of embedded unless it's a one off script. | ||