PicoRuby 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
- picorbc
- pico 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
- picorbc
build/host-debug/bin/picorbc source.rb
makessource.mrb
which is VM code runs on mruby VM
- picoruby
build/host-debug/bin/picoruby source.rb
executes Ruby just like normalruby
command- You can also do it like
build/host-debug/bin/picoruby -e 'puts "Hello World!"'
- picoshell
- It is an experimental REPL implementation. See picoshell section
make
command makes "debug build" which shows debug-print like this:
(Please replace mmruby
with picoruby
)
You can get "production build" like build/host-production/bin/picoruby
which omits debug-print by make host_production
Because PicoRuby 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 picoshell on your host machine with make picoshell
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.
PicoRuby is still developing halfway towards finishing as of 2020.
See implementation roadmap on issue/6
Fork, fix, then send a pull request.
Part of this project was coded by Monstarlab with the support of the Ruby Association Grant Program 2020.
Copyright © 2020-2021 HASUMI Hitoshi & Monstarlab. See MIT-LICENSE for further details.