Thanks for the patience on this one, here's my review. Overall the spec text is clear and comprehensive. The semantics and design mostly seem correct, down to basic questions around naming and structure and then just two main questions - the one you are already bringing up at plenary around defer being needed on reexports, and then also a new question I have about the interaction between deferred namespace imports and these optional reexports, which I've posted separately in #11.
I do still have concerns about (a) implementation complexity and (b) ecosystem effects here. In particular, how much burden this will put on implementations to extend the module system, and if we truly want to encourage community convergence on these barrel file patterns as outstanding questions respectively. I would like to see further engagement / feedback on both of these questions before progressing to Stage 3.
Spec Review
Abstract Module Records
Cyclic Module Records
GraphLoading State Record
Link
BuildLinkingList
InnerModuleEvaluation
Static Semantics: Module Requests
Static Semantics: Imported Names
Thanks for the patience on this one, here's my review. Overall the spec text is clear and comprehensive. The semantics and design mostly seem correct, down to basic questions around naming and structure and then just two main questions - the one you are already bringing up at plenary around
deferbeing needed on reexports, and then also a new question I have about the interaction between deferred namespace imports and these optional reexports, which I've posted separately in #11.I do still have concerns about (a) implementation complexity and (b) ecosystem effects here. In particular, how much burden this will put on implementations to extend the module system, and if we truly want to encourage community convergence on these barrel file patterns as outstanding questions respectively. I would like to see further engagement / feedback on both of these questions before progressing to Stage 3.
Spec Review
Abstract Module Records
[[DeferredModules]]with"s"inResolveExportmethod onAbstract MethodstableimportedNamesas a Link() arg needs to be marked as an additionCyclic Module Records
OptionalIndirectExportsonCyclicModuleRecordoverSource Text Module Record? It seems a little strange to have only this one separate, also not in the "Additional Module Fields" section. I would be interested to hear more about the justification here. If for synthetic module records, not clear how they would utilize this property? Wasm wouldn't use it either. I think I would prefer if we kept this to STMR only.GraphLoading State Record
[[Visited]]as containing “records with fields”[[Module]]and[[ImportedNames]]. I think we should rather explicitly state the top-level type list that this is rather, and formally define theOptionalImport Recordas the other type with just those fields or whatever we want to call that.Link
importedNamesis in the context of link and how it is used, the description doesn't say much about this. Partial linking is an important concept to describe, a short note could be useful.BuildLinkingList
remainingImportedNamesnewImportedNamesfor clarity? Took me a moment to follow this.InnerModuleEvaluation
Static Semantics: Module Requests
ModuleRequestsEqualis now very muchModuleRequestsKeysEqual, could be worth a rename hereImportedNames- would be nice to have an assert when phase checking that it is empty for defer phaseStatic Semantics: Imported Names
Could be much shorter to just inline ImportedDefaultBinding names as(EDIT @nicolo-ribaudo: not doing this, see Stage 2.7 Spec Review - Guy Bedford #12 (comment))<<default>>?