You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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 aModule
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
The text was updated successfully, but these errors were encountered: