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
{{ message }}
Repository navigation
A Web module's JavaScript wrapper (-sMODULARIZE, the factory name) is stated only in ldflags #983
Status: a note for discussion; not scheduled. Recorded in the design record .agents/docs/2026-11-20-program-start-model.md §7, item 2.
Today. A modularised Web program states main = false on the Web row, and mcpp links it with --no-entry (#981). Its JavaScript wrapper is written as ordinary [target.'cfg(os = "emscripten")'.build] ldflags entries, which mcpp passes through without interpreting:
-sMODULARIZE
-sEXPORT_NAME
-sEXPORT_ES6
-sENVIRONMENT
Why it is not part of main. The wrapper decides how a page loads and names the module: a global Module, a factory function, or an ES module. It does not decide where the program begins, and it applies to a module with or without main.
To discuss:
Does the Web row's artifact need declarative keys for the wrapper's form and the factory name? They would describe how the module is loaded, as the row's naming keys and exe-suffix-fixed describe the launcher.
What would mcpp run, mcpp pack and a test runner read from them?
How would they combine with a project's own ldflags, so that each fact is stated once?
Closing as not planned for now; the note stays in the design record (.agents/docs/2026-11-20-program-start-model.md §7, item 2).
The wrapper's form (-sMODULARIZE, -sEXPORT_NAME, -sEXPORT_ES6, -sENVIRONMENT) is a fact of one toolchain, and nothing in the engine reads it today: mcpp run, mcpp pack and the test runner start a Web program through the row's runner and the launcher the link wrote. Passing the words through [target.'cfg(os = "emscripten")'.build] ldflags states each fact once, in the place that already means "words for this row's link".
Declarative keys would be justified when a command of mcpp has to know the form (a runner that loads a factory, a pack format that writes the page). They would then carry the platform's prefix, as a key whose effect exists on one platform does (SPEC-004 §5.3), and come with the platform's package rather than as keys of the engine. Reopen with that consumer.
Activity
The entry example selects the Android rows by env = "android"
speak-agent commentedon Nov 26, 2026
Closing as not planned for now; the note stays in the design record (
.agents/docs/2026-11-20-program-start-model.md§7, item 2).The wrapper's form (
-sMODULARIZE,-sEXPORT_NAME,-sEXPORT_ES6,-sENVIRONMENT) is a fact of one toolchain, and nothing in the engine reads it today:mcpp run,mcpp packand the test runner start a Web program through the row's runner and the launcher the link wrote. Passing the words through[target.'cfg(os = "emscripten")'.build] ldflagsstates each fact once, in the place that already means "words for this row's link".Declarative keys would be justified when a command of mcpp has to know the form (a runner that loads a factory, a pack format that writes the page). They would then carry the platform's prefix, as a key whose effect exists on one platform does (SPEC-004 §5.3), and come with the platform's package rather than as keys of the engine. Reopen with that consumer.