mmruby is an alternative mruby implementation which is:
- Small foot print
- ROM: 256KB or less
- RAM: 128KB or less
- Reference board is PSoC5LP which has Arm 32bit processor, 256KB ROM and 64KB RAM
- Portable
- Depends on only standard C library such as glibc, Newlib or Newlib-nano
- mmrbc
- mini mruby compiler. The main part of this repository
- mruby/c (mrubyc/mrubyc)
- Another implementation of mruby virtual machine
- Just hitting
make
will build binaries for your host machine. - You can build library files for PSoC5LP by hitting
make psoc5lp_lib
- It requires you to have Docker though,
- You can make arm-none-eabi tools if you don't want to use Docker
- hasumikin/cross_compilation_toolchains may help you to make an environment
make
command will make three executable binaries
- mmrbc
build/host-debug/bin/mmrbc source.rb
makessource.mrb
which is VM code runs on mruby VM
- mmruby
build/host-debug/bin/mmruby source.rb
executes Ruby just like normalruby
command- You can also do like
build/host-debug/bin/mmruby -e 'puts "Hello World!"'
- mmirb
- It is an experimental REPL implementation. See mmirb section
make
command makes "debug build" which shows debug-print like this:
You can get "production build" like build/host-production/bin/mmruby
which omits debug-print by make host_production
Because mmruby is dedicated for onechip-microcontroller which doesn't have STDIN/STDOUT like normal computers, REPL (or you can also say SHELL) should work over serial communication like UART.
You can start up mmirb on your host machine with make mmirb
though, it may look weird since it is implemented as a ported version from microcontroller version.
Please try to use it according as the message on the screen if you are intersted in.
You will find more information at hasumikin/mruby_machine_PSoC5LP
I gave a talk about this project on RubyKaigi Takeout 2020.
mmruby is still developing halfway towards finishing as of 2020.
See implementation roadmap on issue/6
Fork, fix, then send a pull request.
Copyright © 2020 HASUMI Hitoshi. See MIT-LICENSE for further details.