In my last post I investigated the possibility of using mruby as embedded language for AvocadoDB. As the first results look quite promising I decided to write a small interactive mruby shell. There is no better way to explore a new toy than to play with it.

(Un)fortunately “irb” from Ruby is written in Ruby itself, so one cannot just use it for mruby. So, instead I had to write a small C++ program using “readline” and the compile/execute functions from mruby. In order to implement a Read-Eval-Print-Loop, well, one needs the print. That in itself is more complicated than expected, see the discussion on github. So, a Read-Eval-Loop will have to do for the time being. In order to find out when a definition is finished I had to do a small patch to the mruby parser. So, if things break down horribly do not blame the mruby developers – it might be entirely my fault.

The source-code can be found on github. Please keep in mind that this is a snapshot of the mruby repository with modifications. Do not blame the mruby developers.

In case you are using homebrew, you can install it as follows:

Again, this is currently just experimental program to play around with mruby. Still, I’ve you have any remarks or improvments, let me know.