Skip to content

Intersection semantics with ModuleSource #8

@caridy

Description

@caridy

As part of the modules harmony effort, we are planning to introduce a new constructor, ModuleSource, than when instantiated, parses the code, and store a Module Source Record, which can be use a later time to construct a qualifying Module Record that can participate on the module graph. This poses some challenges with respect to this proposed brand check.

Instances of SourceModule are powerless, they can only be used for a) inspecting certain aspect of the source (e.g., its exported names, etc.) and b) used to create a Module instance.

The real question is whether the host check is intended to prevent parsing, or just evaluation? At the moment, both options are analogous because they both happen one after the other. But once we have a separation between parsing and evaluation, for the Modules, this question has to be answered. IMO, parsing does not have to be prohibit, but evaluation.

How can we accommodate such feature with this proposal?

cc @kriskowal @Jack-Works @nicolo-ribaudo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions