0xMiden/miden-vm

docs: document `word("...")` string constructor for word constants

オープン

#2,687 opened on 2026/02/13

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

Repository metrics

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

説明

Summary

The word("...") syntax for deriving a Word constant from a string hash is widely used (especially for named storage slot IDs) but is not documented in the assembly reference.

Details

The code organization docs document word constants declared as arrays ([1,2,3,4]) and hex values, but not the word("string") constructor.

This constructor is used extensively in miden-base and tutorials, e.g.:

const METADATA_SLOT = word("miden::standards::fungible_faucets::metadata")
push.METADATA_SLOT[0..2]
exec.active_account::get_item

Suggestion

Add a subsection to the "Word constants" section in docs/src/user_docs/assembly/code_organization.md explaining:

  • The word("string") syntax and what it computes (deterministic Word from string hash)
  • Common use case: named storage slot IDs with [0..2] slice notation

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