Overview
VB6Runtime is a comprehensive Rust implementation of the Visual Basic 6.0 runtime library. It provides implementations for all 194 built-in VB6 functions and 9 statements across 14 function categories and 4 statement categories. The library enables developers to build tools that simulate, analyze, or migrate VB6 applications by providing runtime-equivalent behavior in a modern Rust codebase.
Key Features
📚 Complete API Coverage
194 functions and 9 statements covering all major VB6 runtime categories including string, file, datetime, financial, and more
🚀 Rust Performance
Native Rust implementation with zero vb6 dependencies, leveraging Rust's type system for safe and efficient code
🔧 Tooling Ready
Designed as a foundation for VB6 analysis, conversion, and migration tools that need runtime behavior
📖 Well Documented
Each function includes syntax, parameters, return values, remarks, and examples for easy reference
🎯 VB6 Behavior
Accurate implementation of VB6 runtime semantics, edge cases, and historical quirks
🌐 Cross-Platform
Native Rust implementation compiles everywhere including WASM for browser-based tools
Architecture
VB6Runtime is organized into four architectural layers: a dynamic value system, process-global state management with pluggable backends, a library of standard function implementations, and a boundary module for typed argument conversion. It serves as a shared dependency of vb6interpret and vb6compile.
(dynamic types)
(VBLong, VBString…)
(arbitrary bounds)
(arg conversion)
(static types)
(Err.Raise, numbers)
Layer Details
Library Layer
Responsibility: 194 functions and 9 statements across 13 category modules.
Structure: Each function is a standalone module, re-exported through category mod.rs.
Examples: library::string::len(), library::file::open()
State Layer
Responsibility: Process-global mutable state, all using a pluggable backend pattern.
Backends: Native (OS), Memory (tests/WASM), Mock (clock), Playback (random), File/Registry (settings).
Examples: File I/O manages file numbers 1–511; Random supports classic VB6 LCG, modern Rust rand, and playback modes.
Value System
Responsibility: Runtime value representation and typed argument conversion.
VBVariant: Dynamic enum covering all VB6 types (Empty, Null, Byte…Currency, String, Boolean, Date, Object, Array).
Boundary: arg<T>(), opt_arg<T>(), Nullable<T> for Null-propagating params.
Foundation
Responsibility: Static type definitions and error types shared across the workspace.
Key Types: VbType (enum of all VB6 static types), VBError (full Err object with number, description, source, help context).
Consumed By: vb6interpret (execution), vb6compile (code generation).
Community & Contributing
VB6Runtime is open source and welcomes contributions! Whether you're reporting bugs, suggesting features, or submitting pull requests, your help is appreciated.