runtimeverification / runtimeverification/wasm-semantics

Separate core semantics and text format

Open
#93 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
WebAssembly
Stars
106
Forks
24
PR merge metrics
No merged PRs in 30d

Description

It's becoming a bit inconvenient to have all these folded instructions, aliases and syntactic sugars in the main semantics module, wasm.md. I suggest we move all rules that are just intermediate rewrites, such as instruction unfolding, into a module named normalizations.md. That way, wasm.md becomes a close mirror of the "Execution" part of the spec, dealing with the AST and state updates, and normalizations.md deals with the whole world of valid .wast concrete syntax by only rewriting top-level terms in the <k> cell.

Instead of having all these rules in the core syntax, we can keep them in a separate module. This both makes the core semantics smaller, more like the official spec, and a smaller compile target for the binary format.

Update: Here's the suggested tasks

  • Introduce a separate module for the text format.
  • Move out pure desugaring rules and syntax: folded instructions, inlined exports/imports, etc.
  • Move block instructions (control flow) with identifiers to text module (requires some way to look up the correct branching index).
  • Move definitions with identifers to the core semantics:
    • memory, table
    • func, start
    • global, local
    • imports, exports
    • type
    • elem, data
  • Move Identifiers out of data.md and into text module.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read wasm.md, normalizations.md, and data.md first, then compare the remaining unchecked task items with the current module boundaries. Done means moving the listed definitions and identifiers so wasm.md contains core semantics while normalizations.md handles text-format rewrites, with each checklist item verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.