Since the introduction of ES modules, many have considered (maybe just me many times) marshalling their globals through modules for various purposes.
This comes out of the need to safely do things about globals without ever affecting, or becoming affected by the actual globals (ie subsequently where effects are not preferred).
The last remark, imho aligns nicely with our principles when we endow a container of some sort.
A thought that I’d like to propose here is to consider global endowments being just another one of the attenuated modules, ie of the one explicit specifier that cannot be remapped.
This would complicate the mutability of endowed primitives, ie if such mutability is an intended goal here, likely not.
Streamlining everything together:
- Minimizes the cognitive burden when reasoning about endowments.
- Minimizes the moving parts, hence points of potential failure.