| Crates.io | onion-vm |
| lib.rs | onion-vm |
| version | 0.3.4 |
| created_at | 2025-05-28 15:12:27.734388+00 |
| updated_at | 2025-08-15 10:25:35.815923+00 |
| description | Virtual machine runtime for the Onion programming language with async execution and garbage collection |
| homepage | https://github.com/sjrsjz/onion-lang |
| repository | https://github.com/sjrsjz/onion-lang |
| max_upload_size | |
| id | 1692937 |
| size | 430,242 |
The runtime virtual machine for the Onion programming language. This package provides the execution environment, type system, and runtime services for Onion programs.
The onion-vm package implements a register-based virtual machine designed specifically for functional programming with asynchronous execution capabilities. It features a sophisticated type system, garbage collection, and a generator-based execution model that enables seamless async/await functionality.
Bytecode → VM Instructions → Lambda Scheduler → Type System → Runtime Execution
types/) - Comprehensive type definitions and operationslambda/) - Function execution and schedulinglambda/scheduler/) - Asynchronous task coordinationuse onion_vm::types::object::OnionObject;
use onion_vm::types::tuple::OnionTuple;
use onion_vm::types::lambda::OnionLambda;
// Creating and manipulating types
let obj = OnionObject::new_integer(42);
let tuple = OnionTuple::from_vec(vec![obj]);
let lambda = OnionLambda::new(/* lambda definition */);
The VM uses a sophisticated scheduler that manages:
onion-vm/
├── src/
│ ├── lib.rs # Public API exports
│ ├── types/ # Type system implementation
│ │ ├── mod.rs
│ │ ├── object.rs # Base object type
│ │ ├── tuple.rs # Sequence types
│ │ ├── pair.rs # Key-value pairs
│ │ ├── named.rs # Named values
│ │ ├── lazy_set.rs # Lazy collections
│ │ └── lambda/ # Function types
│ │ ├── mod.rs
│ │ ├── definition.rs
│ │ └── vm_instructions/
│ └── lambda/ # Execution runtime
│ ├── mod.rs
│ ├── runnable.rs # Task execution interface
│ └── scheduler/ # Async scheduler
│ └── scheduler.rs
└── Cargo.toml
This package provides the runtime foundation for:
This package is part of the Onion programming language project and is licensed under the MIT License.