1
0
Fork 0
mirror of https://github.com/mruby/mruby.git synced 2026-03-07 02:30:27 +00:00
Lightweight Ruby
Find a file
2026-03-06 08:17:12 +09:00
.github build(deps): bump actions/upload-artifact from 6 to 7 2026-03-05 14:52:19 +00:00
benchmark benchmark: add VM optimization benchmarks 2026-01-27 14:57:24 +09:00
build_config etc.c: lossless rotation encoding for 32-bit float32 word boxing 2026-02-22 17:51:01 +09:00
doc fix grammar 2026-03-03 13:58:23 +01:00
examples/mrbgems Don't include deleted mruby-print 2025-02-02 21:13:11 +09:00
include version.h: bump version to mruby 4.0.0 2026-03-03 11:10:18 +09:00
lib/mruby build system: remove dead presym_enabled? checks 2026-02-19 14:10:02 +09:00
mrbgems mrbconf.h: rename MRB_WORDBOX_NO_FLOAT_TRUNCATE to MRB_WORDBOX_NO_INLINE_FLOAT 2026-02-27 10:30:01 +09:00
mrblib mrblib: use yield instead of block.call for iteration methods 2026-01-27 14:57:26 +09:00
oss-fuzz fix spaces in the type cast expressions (cosmetic changes) 2023-05-18 23:29:16 +09:00
src vm.c: scope down tc variable from function to block scope 2026-03-02 12:04:48 +09:00
tasks presym.rake: add presym dependencies for all builds, not just internal 2026-03-02 10:23:35 +09:00
test test/t/syntax.rb: add test for &nil in formal parameters 2026-02-19 17:26:04 +09:00
tools/lrama tools/lrama: add missing newline at end of yacc.c template 2025-10-04 07:56:37 +09:00
.codespellrc Add codespell config file .codespellrc 2025-05-09 20:54:27 +10:00
.dockerignore Clean up the .dockerignore file 2024-04-21 22:46:19 +10:00
.editorconfig Clean up the .editorconfig file 2024-03-12 08:41:33 +10:00
.git-blame-ignore-revs .git-blame-ignore-revs: ignore indentation fix commit; ref #6470 2025-01-22 14:10:30 +09:00
.gitattributes Add .gitattributes for newline code normalization 2023-09-17 13:52:48 +09:00
.gitignore .gitignore: build -> /build 2025-08-26 13:31:46 +01:00
.pre-commit-config.yaml update documentation and Makefile for prek migration 2026-02-10 14:45:22 +09:00
.prettierignore Add tools/lrama to .prettierignore 2025-05-03 01:42:36 +10:00
.prettierrc [CI] Add prettier to pre-commit 2024-11-20 14:51:11 +10:00
.travis.yml Adding a serialized test task 2024-11-16 21:21:51 +09:00
.yardopts .yardopts add LEGAL, NEWS, TODO.md 2022-12-30 14:05:16 +10:00
appveyor.yml Adding a serialized test task 2024-11-16 21:21:51 +09:00
AUTHORS AUTHORS: update entries [ci skip] 2026-03-02 11:50:38 +09:00
build_config.rb Move build_config.rb -> build_config/default.rb; ref #5098 2020-10-29 11:49:05 +09:00
CONTRIBUTING.md mlc_config.json: ignore iso.org links in markdown-link-check 2026-02-18 15:41:55 +09:00
docker-compose.yml Adding a serialized test task 2024-11-16 21:21:51 +09:00
Dockerfile super-linter: validate the Dockerfile with hadolint 2024-03-12 04:40:27 +10:00
Doxyfile Update version and release date. (mruby 3.4.0 (2025-04-20)) 2025-04-20 13:08:22 +09:00
Gemfile Add Docker to build and run all mruby tests 2023-04-13 00:12:32 +10:00
Gemfile.lock build(deps): bump yard from 0.9.37 to 0.9.38 2025-12-08 14:07:48 +00:00
LEGAL readfloat.c: new implementation of mrb_read_float(); ref #6187 2024-09-21 02:47:42 +09:00
LICENSE LICENSE: remove the end date of copyright notice; close #6080 2023-10-23 15:31:34 +09:00
Makefile update documentation and Makefile for prek migration 2026-02-10 14:45:22 +09:00
minirake Fix shebang by removing whitespace 2021-06-17 10:26:38 +10:00
mruby-source.gemspec Including header files in include/* by <> 2024-03-26 13:59:59 +09:00
NEWS.md NEWS.md: add notes for macro rename and MRB_INT64 restriction 2026-02-27 11:21:31 +09:00
Rakefile replace pre-commit with prek 2026-02-10 11:14:53 +09:00
README.md version.h: bump version to mruby 4.0.0 2026-03-03 11:10:18 +09:00
SECURITY.md SECURITY.md: clarify security scope with three-tier priority system 2025-11-17 08:17:55 +09:00
TODO.md TODO.md: remove amalgamation (implemented) 2026-01-02 16:58:39 +09:00

The mruby programming language

mruby

GitHub Super-Linter

Table of contents

What is mruby

mruby is the lightweight implementation of the Ruby language complying to (part of) the ISO standard with more recent features provided by Ruby 4.x. Also, its syntax is Ruby 4.x compatible.

You can link and embed mruby within your application. The "mruby" interpreter program and the interactive "mirb" shell are provided as examples. You can also compile Ruby programs into compiled byte code using the "mrbc" compiler. All these tools are located in the "bin" directory. "mrbc" can also generate compiled byte code in a C source file. See the "mrbtest" program under the "test" directory for an example.

This achievement was sponsored by the Regional Innovation Creation R&D Programs of the Ministry of Economy, Trade and Industry of Japan.

How to get mruby

To get mruby, you can download the stable version 4.0.0 from the official mruby GitHub repository or clone the trunk of the mruby source tree with the "git clone" command. You can also install and compile mruby using ruby-install, ruby-build, rvm, conda or Homebrew.

The latest development version of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/zipball/master

The trunk of the mruby source tree can be checked out with the following command:

$ git clone https://github.com/mruby/mruby.git

mruby homepage

The URL of the mruby homepage is: https://mruby.org.

Mailing list

We don't have a mailing list, but you can use GitHub issues.

How to compile, test, and install (mruby and gems)

For the simplest case, type

rake all test

See the compile.md file for the detail.

Amalgamation (single-file build)

mruby supports amalgamation, which combines all source files into a single mruby.c and mruby.h for easy embedding (similar to SQLite).

rake amalgam

Output files are generated in build/host/amalgam/. To use:

gcc -I./build/host/amalgam your_app.c ./build/host/amalgam/mruby.c -o your_app -lm

Building documentation

There are two sets of documentation in mruby: the mruby API (generated by YARD) and C API (Doxygen and Graphviz)

To build both of them, simply go

rake doc

You can also view them in your browser

rake view_api
rake view_capi

How to customize mruby (mrbgems)

mruby contains a package manager called "mrbgems" that you can use to create extensions in C and/or Ruby. For a guide on how to use mrbgems, consult the mrbgems.md file, and for example code, refer to the examples/mrbgems/ folder.

Index of Document

License

mruby is released under the MIT License.

Note for License

mruby has chosen a MIT License due to its permissive license allowing developers to target various environments such as embedded systems. However, the license requires the display of the copyright notice and license information in manuals for instance. Doing so for big projects can be complicated or troublesome. This is why mruby has decided to display "mruby developers" as the copyright name to make it simple conventionally. In the future, mruby might ask you to distribute your new code (that you will commit,) under the MIT License as a member of "mruby developers" but contributors will keep their copyright. (We did not intend for contributors to transfer or waive their copyrights, actual copyright holder name (contributors) will be listed in the AUTHORS file.)

Please ask us if you want to distribute your code under another license.

How to Contribute

To contribute to mruby, please refer to the contribution guidelines and send a pull request to the mruby GitHub repository. By contributing, you grant non-exclusive rights to your code under the MIT License.

Star History

mruby Star History

Contributors

mruby Contributors