Skip to main content

Crate harn_builtin_meta

Crate harn_builtin_meta 

Source
Expand description

Const-constructible type definitions for Harn builtin signatures.

Both harn-parser (for typechecking) and harn-vm (for runtime metadata) consume these shapes. Living in a dep-free crate lets the parser see the types without depending on the VM, and lets the #[harn_builtin] proc-macro emit const literals that link into either side.

Ty::to_type_expr and friends, which convert into the parser’s runtime TypeExpr, live in harn-parser since they depend on parser-internal AST.

The shapes submodule holds the named structural-record consts (LLM_CALL_OPTIONS, LLM_CALL_RESULT, TRANSCRIPT, …) shared by the parser’s static typechecking tables and the #[harn_builtin] macro’s @NAME signature injection.

Modules§

shapes
Shared structural-record Ty::Shape aliases reused across builtin signatures.
signatures
Canonical BuiltinSignature definitions for builtins that both harn-parser (typecheck) and harn-vm (runtime) must agree on at compile time.

Structs§

BuiltinMetadata
Public view of one builtin used by harn-lint and other crates that need just identifier + return-type hints (no parameter types).
BuiltinSignature
A complete, static description of one builtin: identifier, arity range, per-parameter types, generic type parameters, return type, and any where-clause bounds the type checker should enforce on call.
Param
One parameter slot inside a BuiltinSignature.
ShapeFieldDescriptor

Enums§

Ty
const-friendly type IR used in builtin descriptors. Mirrors the runtime TypeExpr from harn-parser but is constructable in const position with no allocation. Convert to TypeExpr at the boundary via the parser-side Ty::to_type_expr helper.

Constants§

TY_ANY
TY_BOOL
TY_BYTES
TY_BYTES_OR_NIL
bytes | nil.
TY_CLOSURE
TY_DECIMAL
TY_DICT
TY_DICT_OR_NIL
dict | nil.
TY_DURATION
TY_FLOAT
TY_INT
TY_INT_OR_NIL
int | nil.
TY_LIST
TY_NEVER
TY_NIL
TY_NUMBER
int | float.
TY_STRING
TY_STRING_OR_NIL
string | nil.