mruby is a compact Ruby implementation suitable for embedding in applications, with mirb, mrbc byte code compilation, and mrbgems extensions.
Overview
mruby implements a subset of the Ruby language aligned with ISO Ruby standards while staying syntax-compatible with newer Ruby releases. Applications link libmruby to embed scripting without a full standard Ruby interpreter stack.
Shipped tools include the mruby interpreter, interactive mirb shell, and mrbc compiler that can emit C-based bytecode. Developers extend functionality through mrbgems packages in C and Ruby.
Amalgamation builds combine sources into single mruby.c and mruby.h files similar to SQLite for simple embedding. Documentation covers API references, debugging, GC, and build customization.
mruby can be obtained from release tarballs with submodules, source clones, or third-party installers such as Homebrew.
Key features
- Embeddable Ruby interpreter
- Byte code compiler mrbc
- Interactive mirb shell
- mrbgems extension packages
- Single-file amalgamation build
- ISO-standard Ruby subset
- YARD and Doxygen docs
- Cross-platform C core
Use cases
- Scripting inside C applications
- Firmware or game logic embedding
- Compact Ruby teaching runtimes
- Bytecode distribution of scripts