1
0
Fork 0
mirror of https://github.com/mruby/mruby.git synced 2026-09-19 17:44:20 +00:00
Lightweight Ruby
  • C 63%
  • Ruby 34.9%
  • C++ 2%
Find a file
Yukihiro "Matz" Matsumoto 6b9c17730a
Merge pull request #7593 from minnnjuuu/fix/hw-adc-pin-range
hw-adc: reject out-of-range pins before narrowing
2026-09-12 00:15:45 +09:00
.github build.yml: give a row that installs a toolchain room for that step 2026-09-09 06:22:50 +09:00
benchmark benchmark: write the Church numeral for 100 as ten applied to ten 2026-09-09 19:36:35 +09:00
build_config zig.rb: let a cross build compile without naming a test runner 2026-09-09 23:38:30 +09:00
doc build: add a zig toolchain 2026-09-09 17:02:58 +09:00
examples/mrbgems mruby.h: include mruby/presym.h for all source files 2026-03-09 16:50:58 +09:00
include string.c: let a gem outside the tree ask for a byte subsequence 2026-09-08 21:57:40 +09:00
lib/mruby build: run a link probe where a link runs 2026-09-09 10:45:01 +09:00
mrbgems hw-adc: reject out-of-range pins before narrowing 2026-09-11 23:47:38 +09:00
mrblib array.c: document what the comparison block of sort and its kin is to return 2026-09-08 14:50:24 +09:00
oss-fuzz Run prek; remove trailing whitespace; cleanup markdown 2026-05-10 14:56:53 +10:00
scripts pre-commit: add hook to ensure Makefiles are indented with tabs 2025-12-30 03:30:04 +10:00
src vm.c: ask OP_CALL whether its receiver is a proc 2026-09-10 17:59:23 +09:00
tasks Merge pull request #7584 from takumin/benchmark-plot-status 2026-09-09 21:34:48 +09:00
test hash.c: see a delete made from inside an eql? callback 2026-09-10 14:33:58 +09:00
tools mruby-regexp: ask the difftest about a character out of every class 2026-08-25 13:58:09 +09:00
.clangd build: write a compile_commands.json from the records of the compiles 2026-08-27 18:48:02 +09:00
.codespellrc mruby-regexp: ask the difftest about a character out of every class 2026-08-25 13:58:09 +09: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 version.c: define MRUBY_REVISION from the source repository 2026-08-26 02:13:23 +09:00
.gitignore clangd: read the tree without a compile_commands.json 2026-08-27 15:58:57 +09:00
.gitmodules build: make Prism the default compiler, keep lrama as an option 2026-06-22 13:41:19 +09:00
.pre-commit-config.yaml build(deps): bump https://github.com/oxipng/oxipng 2026-09-10 14:54:01 +00:00
.prettierignore .prettierignore: exclude the vendored Prism submodule 2026-08-03 23:35:39 +09:00
.prettierrc [CI] Add prettier to pre-commit 2024-11-20 14:51:11 +10:00
.revision version.c: define MRUBY_REVISION from the source repository 2026-08-26 02:13:23 +09: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 appveyor: quote the build folder in the clone script 2026-09-01 19:03:07 +09:00
AUTHORS AUTHORS: update entries [ci skip] 2026-09-01 17:54:13 +09:00
build_config.rb Move build_config.rb -> build_config/default.rb; ref #5098 2020-10-29 11:49:05 +09:00
compile_flags.txt clangd: read the tree without a compile_commands.json 2026-08-27 15:58:57 +09:00
CONTRIBUTING.md numeric.c: convert with Integer.__ensure() instead of Kernel#__to_int 2026-08-09 18:16:05 +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 4.0.0 (2026-04-20)) 2026-04-20 17:43:06 +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 in the bundler-dependencies group 2026-07-22 14:53:54 +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 rake size and the IO callback removal 2026-09-04 06:30:27 +09:00
Rakefile build: log where every define came from as a build starts 2026-09-02 12:02:00 +09:00
README.md Remove broken Star History from README 2026-08-05 15:30:40 +09:00
SECURITY.md SECURITY.md: recommend GitHub private vulnerability reporting 2026-06-17 15:52:03 +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 release candidate version 4.0.0 of mruby can be downloaded via the following URL: https://github.com/mruby/mruby/archive/4.0.0-rc3.zip

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.

Contributors

mruby Contributors