{"slug": "hexaw-a-tiny-time-machine-for-webassembly", "title": "HEXAW: a tiny time machine for WebAssembly", "summary": "A developer has released HEXAW, an experimental MIT-licensed text format for WebAssembly that replaces WAT's nested parentheses with readable mnemonics and a retro assembler feel. The accompanying CLI assembles HEXAW into .wasm, dumps binaries back into annotated instructions with their hex bytes, and steps execution forwards and backwards, and it includes an AI mentor powered by the open-weight gpt-oss-120b model via Groq that is grounded in the opcode table and current VM state. In the demo shell, CALL factorial 5 computes 5! = 120 and BACK reverses the last execution step.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady](https://dev.to/challenges/hacktoberfest-week3-2026-10-19)*\n\nI once wrote a Z80 game on a Videoton TV Computer. I still miss typing an instruction and seeing the exact bytes it becomes.\n\nWebAssembly brought back the possibility. WAT brought me a parenthesis jungle. My brain wanted an assembler listing.\n\nSo I started building **HEXAW: a new, experimental text format for WASM**, with readable mnemonics and a retro assembler feeling.\n\n**It is still totally beta.** The syntax and tooling are evolving. Expect rough edges.\n\nThe CLI can assemble HEXAW into `.wasm`, dump binaries back into readable instructions, and step through code forwards and backwards. There is also an AI mentor you can ask when the bytes stop making sense.\n\nClone the [repository](https://github.com/Pengeszikra/hexaw), run `npm ci`, and save the example below as `factorial.hexaw` in the repository folder. Then:\n\n```\nnpm run shell -- factorial.hexaw\n```\n\nInside the shell:\n\n```\nCALL factorial 5\nG\nBACK\n```\n\nThat computes **5! = 120**, then reverses the last execution step.\n\nThe shell also has an SST-inspired `A` mode: type an instruction, press Enter, see its hex bytes, and continue at the next address. An empty Enter applies the completed draft.\n\nHere is the factorial loop:\n\n```\nEXP \"factorial\" 0\nFN 0\n  PAR 0       ; n\n  RES\n  LOC 1       ; result\n\n  CONST 1\n  SET 1\n  BLOCK\n    LOOP\n      GET 0\n      EQZ\n      BRIF 1  ; leave the outer block when n = 0\n\n      GET 1\n      GET 0\n      MUL\n      SET 1\n\n      GET 0\n      CONST 1\n      SUB\n      SET 0\n      BR 0    ; repeat the loop\n    END\n  END\n  GET 1\nEND\n```\n\nThe default numeric type is `i32`. Prefixes `L`, `F`, and `D` select `i64`, `f32`, and `f64`. This is still WASM: a typed stack, locals, and structured control flow.\n\nThe dump keeps the bytes beside the instructions:\n\n```\n00000032 : 20 00 : GET 0\n00000034 : 45    : EQZ\n00000035 : 0D 01 : BRIF 1\n```\n\nSource: [https://github.com/Pengeszikra/hexaw](https://github.com/Pengeszikra/hexaw)\n\nI built it with Codex, using my **TS+|> TypeScript fork** for the CLI and a shared assembly/debugging engine.\n\nThe mentor uses the open-weight [gpt-oss-120b](https://console.groq.com/docs/model/openai/gpt-oss-120b) model through Groq, carried over from my *Terminal Is Your Friend* project. Its teaching material now focuses on HEXAW and WASM, grounded in the actual opcode table and a limited snapshot of the current code, assembly draft, VM state, and recent errors.\n\nWith `GROQ_API_KEY` set before starting the shell, I can ask:\n\n```\n// What does BRIF 1 mean here?\nAI ERROR\n```\n\nThe reply arrives while I keep working. Suggested code stays an example until I enter it myself.\n\nI can change the language, the compiler fork, and the mentor’s teaching material. Anyone else can too: HEXAW is MIT-licensed.\n\nAn open-weight model leaves a future route to self-hosting. Today the mentor uses Groq’s hosted API; the assembler and debugger work locally.\n\nLess manual byte decoding. Fewer trips between code, documentation, and a separate AI chat.\n\nApparently I am lazy enough to want all of that in one terminal. Just not lazy enough to leave assembly alone.", "url": "https://wpnews.pro/news/hexaw-a-tiny-time-machine-for-webassembly", "canonical_source": "https://dev.to/pengeszikra/hexaw-a-lazy-wasm-text-format-5g5n", "published_at": "2026-10-25 22:10:22+00:00", "updated_at": "2026-10-25 22:13:09.524068+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["HEXAW", "WebAssembly", "Groq", "gpt-oss-120b", "Codex", "Pengeszikra"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/hexaw-a-tiny-time-machine-for-webassembly", "markdown": "https://wpnews.pro/news/hexaw-a-tiny-time-machine-for-webassembly.md", "text": "https://wpnews.pro/news/hexaw-a-tiny-time-machine-for-webassembly.txt", "jsonld": "https://wpnews.pro/news/hexaw-a-tiny-time-machine-for-webassembly.jsonld"}}