Skip to content

Install math.margins to work instead of making a new prioritised root "pre" #16

Open
@Kacarott

Description

@Kacarott

Currently math.margins is installed in a new vocabulary root "pre", which is specifically given priority loading during imaging. There are a couple problems with this, listed below. math.margins should be installed following regular factor practice, in the "work" root (same place as testest is installed).

The problems:

  • math.margins does not need to prioritised loading, doing so adds unnecessary complexity
  • math.margins being in a prioritised root violates the factor principle of earlier loaded roots not relying on vocabs from later loaded roots. vocabs in core do not rely on vocabs in basis do not rely on vocabs in extra. math.margins however imports vocabs from core and basis, but is loaded before them.
  • math.margins being prioritised means that if a math.margins vocabulary is added to the standard library in the future, then any vocabs in the standard library which rely on it will break, since they will load the external math.margins instead. Causing the standard lib to break internally, is not a good thing.
  • Additionally, if a standard library math.margins vocabulary is added but no other vocabulary relies on it, then no error will be caused during docker image creation, but it will be silently shadowed. This means that any users that try to use it in solutions will instead import the external math.margins instead of the expected standard library version.
  • Working around the standard factor library structure and load order is a hack and bad practice, precisely because of the bugs it could introduce

In summary, the current behaviour is bad practice, and is actively creating potential future compatibility issues. On top of that, it is unnecessary - math.margins will work exactly the same from "work" as it does from "pre".

If the intent in this design is to provide an "early warning system" for future versions to inform that there is a name conflict, then adding an explicit test for that is a clearly better option, rather than relying on the standard lib potentially breaking during compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions