Skip to main content

Crate intuicio_backend_vm

Crate intuicio_backend_vm 

Source
Expand description

A backend that runs script data as it is, without compiling it first.

A backend turns the operations a frontend produced into a callable function body. This one keeps the operations and walks them one at a time, which makes it a virtual machine rather than a compiler.

scope::VmScope is the interpreter, and it is also the ScriptFunctionGenerator for this backend, so a whole package installs with it:

package.install::<VmScope<MyExpression>>(&mut registry, None);

The None is what the generator takes as input, which here is an optional debugger. See debugger.

§Suspending

A script can stop in the middle with the Suspend operation. scope::VmScope::run_until_suspended gives control back at that point, and scope::VmScopeFuture wraps the same stepping in a Future, so a script can act as a coroutine.

Modules§

debugger
Watching a script while it runs.
scope
The interpreter itself: one scope of script operations, stepped through.

Functions§

backend_vm_version
Returns the version of this crate, for plugins to check against.