Skip to content

Managing Many Modules (M3) #263

@x87

Description

@x87

M3 is a hypothetical situation where we have hundreds of CLEO5 modules available for use. This triggers some problems, such as:

  • inevitable name clashes
  • breaking changes
  • discoverability

Name Clashing

Example: two authors develop their scripts and modules. They call their modules utils.s. It is now impossible to install both scripts because you can only have one module.

Breaking Changes

Example: large and popular module used by many scripts. Author finds a bug and changes the function definition (e.g. adds an extra param).

Discoverability

How to find a module that is useful for me? What should I know before using it? Modules may or may not come with source code supplied.

Potential Solutions

  • Name Clashing. Introduce a new config file called modules.ini where the user can map modules to different filenames. E.g. for scripts a.cs and b.cs each using utils.s this may look as follows:
[a.cs]
utils.s=utils_a.s

[b.cs]
utils.s=utils_b.s

the CLEO will use this mapping to correctly resolve module calls.

  • Breaking Changes. Semver, with MAJOR.MINOR versioning. Modules may have an optional version part in their name, e.g. utils@2.0.s. Then you may also have utils@1.0.s, utils@2.1.s.
    Now, lets see what happens, when CLEO encounters a module call:

    • "f@utils.s" - resolves to utils@1.0.s (or any 1.X version) or utils.s in that order
    • "f@utils@1.s" - resolves to utils@1.0.s (most recent 1.X version)
    • "f@utils@2.s" - resolves to utils@2.1.s (most recent 2.X version)
    • "f@utils.s@2.0" - resolves to utils@2.0.s (exact match)
    • "f@utils.s@2.1" - resolves to utils@2.1.s (exact match)
    • "f@utils.s@2.3" - runtime error
    • "f@utils.s@3" - runtime error
  • Discoverability. Document modules and their exported functions in SBL. Similar to Native code section for SA.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionFurther discussion is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions