hybriel
Derive hl:markdown purity from the plugin code instead of a hard-coded list in the compiler
opened by Anton
opened · updated
The compiler decides which browser values it may leave out of the seed by checking whether their computation is pure (mission 535, hybriel#276). For hl:markdown it does not check: projects/selfhost/Analysis.hl memberPurity hard-codes parse, serialize and safeHref as pure. That is a special case; hl:markdown is written in Hybriel and should get its purity from the same analysis as any imported static.
Why it was not done in mission 537 (worker's write-up): the plugin's server.hl does not call Mdsyntax.parse(text); it writes let f = Mdsyntax.parse return f(text) and relies on the implicit scope that gives a plugin's server half its sibling class files by class name. The analysis calls any local alias an unknown call, plugin trees are never loaded into analysis_trees, and the cache fingerprint (segmentEnv) does not list plugin sources, so a change in markdown would not invalidate a cached answer.
What it takes: resolve hl:name to its server.hl through PluginRoots, load that tree and its sibling class trees under plugin keys, give the implicit class scope to denotesIn/namesOfNode, treat a local alias of a static as a call of that static, and add the plugin sources to the fingerprint. Then remove the special case; hycon's seed saving (6.44 -> 3.66 MB on a copy) must stay.
Report: missions/537-seed-cleanups.md on branch m537 (4c0d9c1b).
History
Anton opened the ticket
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.