Expand description
The building blocks every Intuicio scripting solution is made of.
Intuicio is not a scripting language. It is a set of pieces to build one from. This crate holds the pieces that every part of such a build agrees on.
§The pipeline
source (text, node graph, anything)
| frontend
v
script data -> backend -> Function in a Registry
^
| Host calls it in a Context- A frontend turns some input into script data. It can be a parser, a node graph editor, or anything else that produces the same data.
- A backend turns script data into a callable
function::Function. A virtual machine is the obvious one, a transpiler to Rust is another. - The host is the native side: Rust functions and types registered in a
registry::Registry, callable from scripts and calling back into them.
§Why script and native calls look the same
Every function, native or scripted, has the same shape:
fn(&mut Context, &Registry). It pops its arguments off the context stack
and pushes its results back. Neither side can tell which kind it is calling,
so a program can mix frontends and backends freely.
§Where to start
Modules§
- context
- The storage a function call runs on.
- function
- Callable units, and how to describe and find them.
- host
- The native side of a scripting solution.
- meta
- Free-form annotations attached to types, functions and fields.
- object
- Values of types the host was never compiled against.
- registry
- The catalogue of everything scripts and host can reach.
- script
- The data a frontend produces and a backend consumes.
- transformer
- How native function arguments are represented on the script side.
- types
- Runtime descriptions of structs and enums.
- utils
- Helpers for moving
Objectvalues on and off a data stack.
Macros§
- __
internal__ offset_ of__ - Re-export used by the
define_native_struct!macro to find field offsets. Calculates the offset of the specified field from the start of the named struct. - __
internal__ offset_ of_ enum__ - Returns the byte offset of a field inside one variant of a
repr(u8)enum. - crate_
version - Builds an
IntuicioVersionfrom theCARGO_PKG_VERSION_*variables of the calling crate. - define_
function - Builds a whole
Functionfrom a signature and a Rust body. - define_
native_ enum - Builds an
Enumdescribing arepr(u8)Rust enum, filling in discriminants and field offsets. - define_
native_ struct - Builds a
Structdescribing a Rust type, filling in field offsets. - define_
runtime_ enum - Builds an
Enumthat no Rust type backs, laying its variants out. - define_
runtime_ struct - Builds a
Structthat no Rust type backs, laying its fields out. - function_
signature - Builds a
FunctionSignature, looking every type up in a registry. - meta
- Builds a
Metatree from literal syntax.
Structs§
- Intuicio
Version - Semantic version of a crate, used to check that plugins match their host.
Enums§
- Filter
- A search filter for a field that the target may or may not have.
- Visibility
- How far a type, function or field can be seen from.
Traits§
- Intuicio
Enum - A Rust enum that can describe itself to a registry.
- Intuicio
Struct - A Rust struct that can describe itself to a registry.
Functions§
- core_
version - Returns the version of this crate, for plugins to check against.