Module host

Module host 

Source

Structs§

Atom
The newtype carries the PartialEq, Debug and Display that dyn HostType cannot, which lets Exp keep a derived PartialEq.
OpDef
Registry
Names resolve to indices once, in the reader, so a call site costs an array index and not a hash lookup.
Str
The worked example: a host type is a payload, a name, an equality, an encoding.

Traits§

HostType
Data, emphatically: an atom declares a wire encoding because it must cross a channel as a message payload. What cannot encode is a capability, and capabilities are addresses.

Functions§

builtins
install
Must happen before the first read, since reading is what resolves names to indices. An embedder extends crate::registry rather than starting empty.
registry
The default is the whole language’s table, not this file’s: the reader resolves names and sits below every layer that adds to it, so an op the surface adds would otherwise be unreachable.

Type Aliases§

Decoder
OpResult
An op’s failure is an ordinary narju value, so a partial op is a throw the program can catch, not a second error channel.