Expand description
#[harn_builtin] proc-macro.
Annotates a Rust function that implements one builtin and emits both a
runtime registration entry and a parser BuiltinSignature from a single
declaration. This is the only supported way to register stdlib builtins —
see CONTRIBUTING.md (“Adding a stdlib builtin”) for the wire-up
checklist and crates/harn-vm/src/stdlib/bytes.rs, runtime_scope.rs,
and strings.rs for sync, async, and aliases = [...] examples
respectively. The macro contributes each emitted VmBuiltinDef to the
workspace-global ALL_BUILTIN_DEFS linkme distributed slice, so simply
annotating a fn (in a module already pulled into harn-vm) is enough to
make it land in the registry — no per-module aggregation edits required.
Attribute Macros§
- harn_
builtin - Marks a Rust function as the runtime handler for a Harn builtin. Emits a
sibling
static <NAME>_DEF: harn_vm::stdlib::macros::VmBuiltinDef = ...containing the signature, aliases, handler pointer, and metadata.