| Crates.io | glyph-runtime |
| lib.rs | glyph-runtime |
| version | 0.0.1 |
| created_at | 2025-07-20 13:44:21.62872+00 |
| updated_at | 2025-07-20 13:44:21.62872+00 |
| description | Runtime execution engine for the Glyph programming language |
| homepage | https://github.com/glyph-lang/glyph |
| repository | https://github.com/glyph-lang/glyph |
| max_upload_size | |
| id | 1761073 |
| size | 235,106 |
The Glyph runtime provides an immutable-first virtual machine (VM) for executing Glyph programs with capability-based security.
audio.speak)network.fetch with URL patterns)display.chart, display.image)wait.confirm)Add, Sub, Mul, Div, Mod, PowEq, Ne, Lt, Le, Gt, GeAnd, Or, NotPush, Pop, Dup, Swap, Rot3Jump, JumpIf, JumpIfNot, Call, ReturnMakeList, MakeDict, ListAppend, DictInsertMatch, MatchValue, MatchTypeCallIntrinsic for built-in functionsTraceValue, RecordTelemetryuse glyph_runtime::{VM, VMConfig, Instruction, Value, Capability};
// Configure VM with capabilities
let mut config = VMConfig::default();
config.capabilities.grant(Capability::AudioSpeak);
// Create VM instance
let mut vm = VM::new(config);
// Load bytecode program
vm.load_bytecode(vec![vec![
Instruction::Push(Value::Str("Hello, Glyph!".to_string())),
Instruction::CallIntrinsic("voice.speak".to_string()),
Instruction::Halt,
]]);
// Execute program
match vm.execute() {
Ok(result) => println!("Result: {}", result),
Err(e) => eprintln!("Error: {}", e),
}
VM
├── Stack (configurable size)
├── Call Frames (function contexts)
├── Global bindings (immutable)
├── Capability set (granted permissions)
├── Memory manager (tracks allocations)
└── Telemetry collector
See the examples/ directory for:
simple_vm.rs - Basic arithmetic and list operationscapability_demo.rs - Capability-based security demonstrationsvm_benchmark.rs - Performance benchmarksThe VM is designed for: