Skip to main content

runmat_vm/
lib.rs

1#![allow(clippy::result_large_err)]
2
3pub mod accel;
4pub(crate) mod bytecode;
5pub(crate) mod call;
6pub(crate) mod compiler;
7pub mod indexing;
8pub(crate) mod instr {
9    pub use crate::bytecode::instr::{ArgSpec, EndExpr, Instr};
10}
11pub(crate) mod interpreter;
12pub(crate) mod layout;
13pub(crate) mod object;
14pub(crate) mod ops;
15pub(crate) mod runtime;
16
17pub use bytecode::{compile, compile_semantic_function_registry};
18pub use bytecode::{
19    ArgSpec, AsyncMetadata, AwaitSite, Bytecode, EmitLabel, EndExpr, FunctionBytecode,
20    FunctionRegistry, Instr, SpawnSite, StackEffect,
21};
22#[cfg(feature = "native-accel")]
23pub use bytecode::{
24    FusionCandidateGroup, FusionInstructionKind, FusionInstructionWindow, FusionMetadata,
25};
26pub use call::builtins::set_dynamic_eval_options;
27pub use compiler::CompileError;
28pub use interpreter::api::{
29    set_call_stack_limit, set_error_namespace, DEFAULT_CALLSTACK_LIMIT, DEFAULT_ERROR_NAMESPACE,
30};
31pub use interpreter::runner::{
32    interpret, interpret_function, interpret_function_with_counts, interpret_with_vars,
33    invoke_semantic_function_value,
34};
35pub use interpreter::state::{InterpreterOutcome, InterpreterState};
36pub use layout::{
37    derive_layout, LayoutError, VmAssemblyLayout, VmEntrypointLayout, VmFunctionLayout, VmSlotId,
38};
39pub use runtime::workspace::{
40    push_pending_workspace, take_updated_workspace_assigned_report, take_updated_workspace_state,
41    PendingWorkspaceGuard, WorkspaceAssignedReport,
42};
43
44pub async fn call_method_or_member_index_named_with_outputs(
45    base: runmat_builtins::Value,
46    name: String,
47    args: Vec<runmat_builtins::Value>,
48    requested_outputs: usize,
49    _fallback_policy: runmat_hir::CallableFallbackPolicy,
50) -> Result<runmat_builtins::Value, runmat_runtime::RuntimeError> {
51    call::closures::call_method_or_member_index_named_with_outputs(
52        base,
53        name,
54        args,
55        requested_outputs,
56        None,
57    )
58    .await
59}