runmat-vm 0.5.0

RunMat virtual machine and bytecode interpreter
Documentation
#![allow(clippy::result_large_err)]

pub mod accel;
pub(crate) mod bytecode;
pub(crate) mod call;
pub(crate) mod compiler;
pub mod indexing;
pub(crate) mod instr {
    pub use crate::bytecode::instr::{ArgSpec, EndExpr, Instr};
}
pub(crate) mod interpreter;
pub(crate) mod layout;
pub(crate) mod object;
pub(crate) mod ops;
pub(crate) mod runtime;

pub use bytecode::{compile, compile_semantic_function_registry};
pub use bytecode::{
    ArgSpec, AsyncMetadata, AwaitSite, Bytecode, EmitLabel, EndExpr, FunctionBytecode,
    FunctionRegistry, Instr, SpawnSite, StackEffect,
};
#[cfg(feature = "native-accel")]
pub use bytecode::{
    FusionCandidateGroup, FusionInstructionKind, FusionInstructionWindow, FusionMetadata,
};
pub use call::builtins::set_dynamic_eval_options;
pub use compiler::CompileError;
pub use interpreter::api::{
    set_call_stack_limit, set_error_namespace, DEFAULT_CALLSTACK_LIMIT, DEFAULT_ERROR_NAMESPACE,
};
pub use interpreter::runner::{
    interpret, interpret_function, interpret_function_with_counts, interpret_with_vars,
    invoke_semantic_function_value,
};
pub use interpreter::state::{InterpreterOutcome, InterpreterState};
pub use layout::{
    derive_layout, LayoutError, VmAssemblyLayout, VmEntrypointLayout, VmFunctionLayout, VmSlotId,
};
pub use runtime::workspace::{
    push_pending_workspace, take_updated_workspace_assigned_report, take_updated_workspace_state,
    PendingWorkspaceGuard, WorkspaceAssignedReport,
};

pub async fn call_method_or_member_index_named_with_outputs(
    base: runmat_builtins::Value,
    name: String,
    args: Vec<runmat_builtins::Value>,
    requested_outputs: usize,
    _fallback_policy: runmat_hir::CallableFallbackPolicy,
) -> Result<runmat_builtins::Value, runmat_runtime::RuntimeError> {
    call::closures::call_method_or_member_index_named_with_outputs(
        base,
        name,
        args,
        requested_outputs,
        None,
    )
    .await
}