What are the main omissions in mruby compared to MRI?

I'm very interested in the mruby project, but he was not lucky to find a generalization of the main omissions in mruby compared to other, more complete Ruby (most importantly, MRI).

README in the project says that mruby implements a β€œpart” of the ISO standard for Ruby, but without going into details about which features are omitted.

Does anyone know a list of such omissions, or is anyone familiar enough with the implementation to take stock?

+8
ruby mruby
source share
4 answers

So, I did not read the source closely, but after I built mruby and started the interpreter a bit, I found that the following things are missing (by no means is a complete list, and I do not know if these are deliberate omissions or just things that have not yet been written):

  • backticks
  • eval
  • String#scan
  • (instance|module|class)_eval with String arguments
  • Module.constants
  • Regexp
  • Process
  • Bignum
  • IO , File and Dir
  • Encoding
  • Thread and Mutex
  • Marshal

If someone has a more complete list or knows the details that these bits are not yet implemented or are intentionally omitted, I will still be interested to know.

+5
source share

Look at the so-called mrbgems ( https://github.com/mruby/mruby/tree/master/mrbgems ). Some of your missing features (i.e. RegExp, eval, File) are available as an optional GEM.

+3
source share

I just run a simple clip of code with mruby and get a different result from MRI.

 class Fixnum def +(b) self * b end end puts 3+4 

mruby outputs 7, while outputs mri 12

+1
source share

A partial but updated list of the differences between Ruby MRI and MRuby can be found at https://github.com/mruby/mruby/blob/master/doc/limitations.md .

As of February 2018, these are the listed differences:

  • 1/2 gives Float(0.5) because mruby does not support Bignum.
  • Passing an array to puts leads to different conclusions.
  • Kernel.raise without arguments does not throw the current exception in the rescue clause.
  • Fiber execution cannot cross the boundary of function C
  • Array does not support instance variables
  • Method visibility is not supported ( public / private / protected ).
  • defined? missing
  • Merging a global variable works in CRuby, but is not part of the ISO standard.
  • The statement cannot be overwritten by the user.
0
source share

All Articles