v5 Bytecode
Module as executable artifact
- module name, imports, exports, and init bytecode in one value
- compile each module into deterministic unit
Module init pattern
ENTER_SCOPE- import binding
- body lowering
- export collection
MAKE_MAP NDEFINE_CONST <moduleName>EXIT_SCOPE
Imports
import m=> alias defaults tomimport m as a=> aliasa- import bindings happen in module scope before dependent uses
Exports
- declaration order preserved
- zero-export modules still emit
MAKE_MAP 0
Member access
alias.name->LOAD alias,PUSH_STR "name",GET_INDEX- call on member becomes read +
CALL
Determinism checks
- stable map entry order
- stable module init shape
- stable bytecode diff behavior
1 / 1