0xMiden/miden-vm
docs: document `word("...")` string constructor for word constants
Aberta
#2.687 aberto em 13 de fev. de 2026
documentationgood first issue
Métricas do repositório
- Stars
- (753 estrelas)
- Métricas de merge de PR
- (Mesclagem média 6d 2h) (71 fundiu PRs em 30d)
Description
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