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
docs: tighten SPEC.md codegen-environment section, drop unmerged extern grammar
Review pass on the #89 spec changes against the current main:
- 1.2 / 2.1 / 2.10: remove `extern`, `extern_type_decl`, and `extern_fn_decl`.
`extern` is not yet a reserved keyword on main and is not parsed by the
current lib/parser.mly; the AST has no `TopExternFn` / `TopExternType`
variants. Documenting these forms here advertises features that arrive
with a separate, unmerged PR (#92, fix/issue-42-extern-parsing). Spec
re-introduces these sections when the implementation lands.
- 2.9: fix the cross-reference (was "see §5.1" which is Primitive Types;
correct target is §8). Rephrase to make clear that the initializer must
reduce to a Wasm constant expression in the linear-memory backend.
- 8.1: fix `gen_program` -> `generate_module` (the actual fold-over-decls
entry point in lib/codegen.ml). Rewrite the section to:
* separate the encoding (data layout) from the lookup (instruction
selection) so the reader understands what's currently implemented vs.
what issue #73 still needs;
* call out that `ExprApp (ExprVar _, _)` currently emits `call k`
unconditionally, so the sign-test decode path for the negative
sentinel is the remaining piece tracked under #73 rather than being
described as already implemented;
* spell out per-case `gen_decl` behaviour (TopFn registers before
generating its body; TopConst registers after appending the global).
- 8.2: removed alongside the extern grammar — same rationale as 2.10.
The lib/codegen.ml `func_indices` field doc-comment from the original PR
was accurate and stays.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments