We are announcing the first stable release of mruby 3.0 series - mruby 3.0.0.
With mruby 3.0, the memory used of the mruby VM has been significantly reduced, and we have succeeded in significantly saving memory. Previous versions required several hundred KB of RAM, but mruby 3.0 can launch an application with about 100 KB of RAM.
Describes the new features and changes in mruby 3.0.
The main changes in mruby 3.0 are also described in doc/mruby3.md.
R-assignment
by single-line pattern matching
. Ruby:Feature#15921mrbc_cleanup_local_variables()
- Clean up local variables on mrbc_context. #4931mrb_define_singleton_method_id()
mrb_define_class_method_id()
mrb_define_module_function_id()
mrb_undef_method_id()
mrb_undef_class_method_id()
mrb_define_const_id()
mrb_funcall_id()
mrb_intern_check()
mrb_intern_check_cstr()
mrb_intern_check_str()
mrb_fiber_resume()
- Allow context switch from C module.The old build configuration file build_config.rb
has been reconfigured to a file in the build_config
directory.
For example, the following typical build configuration is available.
default
: the default configurationhost-gprof
: compiles with gprof
for performance tuninghost-m32
: compiles in gcc 32bit mode on 64bit platformsboxing
: compiles all three boxing optionsclang-asan
: compiles with clang’s Address SanitizerYou can specify the mruby build configuration by building mruby with the rake
build, specifying the build configuration file in the environment variable MRUBY_CONFIG
.
Array.new([])
initialization. (mruby-array)Hash#except
(mruby-hash-ext)IO#popen
to use keyword arguments. (mruby-io)Module#include
and Module#prepend
behave like Ruby 3.0. 3972df57*.rb
and *.mrb
in mruby
interpreter. a045b6b8irep
C struct dump from mrbc
with -S
option.c
to mrb_get_args()
for receive Class/Module.Due to improvements in the binary format, mruby binaries are no longer backward compatible.
To run the mruby binaries on mruby 3.0, recompile with the mruby 3.0 mrbc
.
RITE_VM_VER
to 0300
(means mruby 3.0).RITE_BINARY_FORMAT_VER
to 0200
.Integer
has been changed to a specification similar to CRuby.
Fixnum
and Integer
.Integral
.int / int -> int
Integer
. APIs for Fixnum
(mrb_fixnum_xxx()
) is also left for compatibility.
mrb_fixnum()
-> mrb_integer()
mrb_fixnum_value()
-> mrb_int_value()
mrb_fixnum_p()
-> mrb_integer_p()
mruby
and mirb
command. #4933block_given?
from inside an orphan block always returns false. #5039#include
. ruby-bug:7844We have done 983 commits to 274 files with 16,929 additions and 11,685 deletions since mruby 2.1.2. For more detail of the updates, see Commit Log.
Thanks to all the contributors who have worked on bug fixes and improvements in the release of mruby 3.0.0
.