mrubyedge-1.0.17 has been yanked.
mrubyedge
A pure-Rust reimplementation of the mruby VM that keeps its core execution engine no_std-friendly while striving for behavioral compatibility with upstream mruby.
Overview
mruby/edge is an mruby-compatible virtual machine implementation written in Rust, specifically designed for WebAssembly environments and embedded systems. It aims to provide:
- WebAssembly-first design: Optimized for running Ruby code in browsers and edge computing environments
- Lightweight runtime: Minimal footprint and binary size suitable for constrained environments
no_stdcore: Can run in environments without standard library support- mruby compatibility: Executes mruby bytecode (
.mrbfiles) and Ruby source code - Rust safety: Built with Rust for memory safety and reliability
Installation
Add this to your Cargo.toml:
[]
= "1.0"
Usage
Running Precompiled Bytecode
Load and execute a precompiled *.mrb file produced by mrbc:
use rite;
use vm;
// Bundle the compiled script at build time
const SCRIPT: & = include_bytes!;
Creating VMs Programmatically
You can also construct IREP (internal representation) structures directly:
use ;
use ;
Use Cases
- Embedded Systems: Run Ruby in resource-constrained devices
- WebAssembly Applications: Deploy Ruby code in browsers and serverless environments
- Edge Computing: Lightweight Ruby runtime for edge nodes
- Rust Integration: Embed Ruby scripting in Rust applications
CLI Tool
For a command-line interface to compile and run Ruby scripts, see mrubyedge-cli.
Documentation
License
See the LICENSE file in the repository root.