We are proudly announcing the first stable release of mruby 2.0 series – mruby 2.0.0.
This release includes the improvement of Ruby2.x compatibility and memory consumption.
Kernel#thenwas added as
Kernel#yield_self(Ruby 2.6 Compatible)
Array#to_hcan be called with a block (Ruby 2.6 Compatible)
Array#unionwas added (Ruby 2.6 Compatible)
String#linescan be called with a block
Meta-programming features are separated as a mrbgem. You need to link
mruby-metaprog to use meta-programming. (See
Breaking Changes for more detail)
matsumotory/mruby-sleep was bundled as a core library.
You can use
--remove-lvoption was added By specifying
--remove-lv, mrbc suppress the generation of local variable information to be used for debugging in the compiled binary. It reduces the size of compiled mruby binary and memory consumption when loaded.
-doption was added By specifying
-d, mruby execute the script in the debugging mode ($DEBUG=true).
-roption was added By specifying
-r library, mruby loads the specified library before the execution.
-doption was added (Behaves as
-roption was added (Behaves as
Several improvements were done in mruby 2.0.0 to reduce memory consumption:
--remove-lvoption was added to mruby compiler(mrbc)
There are two major breaking changes from mruby 1.4.1
VM instruction format has been completely changed. The fixed width instruction until mruby 1.4.1 was abandoned. We chose variable length bytecode instructions in mruby 2.0. You need to recompile everything for mruby 2.0.
From the assumption that meta-programming features are not frequently used in embedded system development, we separated meta-programming features as a mebgem (
mruby-metaprog). The following methods have moved to
Kernel module global_variables, local_variables, singleton_class, instance_variables, instance_variables_defined?, instance_variable_get, instance_variable_set, methods, private_methods, public_methods, protected_methods, singleton_methods, define_singleton_methods, send
Module class class_variables, class_variables_defined?, class_variable_get, class_variable_set, remove_class_variable, included_modules, instance_methods, remove_method, method_removed, constants
Module class (Singleton Methods)
to_strare no longer converted to Integers or Strings respectively. Those implicit conversions cause recursive VM calls and had been the source of many bugs.
We have done 378 commits to 156 files, 7,949 lines were added, 5,430 lines removed since mruby1.4.1. For more detail of the updates, see Commit Log.