0xMiden/miden-vm

docs: document word("...") and event("...") constant syntax in code_organization.md

クローズ

#2,688 opened on 2026/02/13

 (1 件のコメント) (0 件のリアクション) (1 人の担当者)Rust (303 件のフォーク)github user discovery
documentationgood first issue

Repository metrics

Stars
 (753 個のスター)
PR merge metrics
 (平均マージ 6d 2h) (30d で 71 merged PRs)

説明

The word("...") and event("...") constant constructors are supported by the assembler (defined in the LALRPOP grammar at crates/assembly-syntax/src/parser/grammar.lalrpop, with HashKind::Word and HashKind::Event in crates/assembly-syntax/src/ast/constants/expr.rs), but they are not documented in the code organization reference (docs/src/user_docs/assembly/code_organization.md).

The "Word constants" section documents array syntax ([1,2,3,4]) and hex format but does not mention the word("string") constructor, which hashes the provided string via Blake3 to derive a deterministic Word. Similarly, event("string") derives a single field element.

These constructors are widely used in Miden account programs for named storage slot IDs and event identifiers, and should be documented alongside the other word constant forms.

Suggested change: Add a "Word constants from strings" subsection after the "Constant slices" section, showing the word("...") syntax with slice notation, and mentioning event("...").

コントリビューターガイド