This articles was published on 2013-06-01

[May 2013] mruby news

What happened on the mruby front in May 2013?

mrbgems

As mentioned by me last month I was proposing to introduce some kind of dependency system for GEMs. This was what I did this month by introducing version and dependency properties to the GEM specification. These specifications will be checked during the build and the build system will tell you when they can’t be satisfied.

Fiber

Matz was adding Fiber support this month as a new GEM. It was quite a fight to make it work proper together with the GC.

Word Boxing

Kimushu was sending a large pull request which introduced Word Boxing. This patch made mrb_value a little bit more native by handling it as a word. My tests showed that this configuration is actually improving the memory usage quite a bit but I also notice that it is incompatible to NAN Boxing.

ObjectSpace

ObjectSpace support was implemented as a GEM too in this month.

Commits

Here a list with all commits during this month.

mrbgems

consider empty version requirements as >= 0.0.0

consider gem version to be 0.0.0 unless specified

Todo is actually already finished :-)

Implement GEM dependency check

Move GemList to MRuby::Gem::List. More logical location

Use advanced GemList as list for GEMs

Implement GemList which can identify GEM duplicates

sort mrbgem’s mrblib/*.rb files

Fix add_dependency declaration documentation

Improve mrbgems documentation

Add more documentation for Gem::Specification

Improve Gem::Specification for support of dependencies and requirements

Apply :core parameter to full-core.gembox

Apply :core parameter to default.gembox

Implement :core parameter for conf.gem

Cosmetic improvements of mrbgems documentation

Move comments from hash.c to hash.rb.

Move Hash#values_at to mruby-hash-ext gem.

Implement fallback print method for testing environment in case mruby-print GEM wasn’t included.

add comments for mruby-array-ext

Fiber

Test for raise when yield is called on root fiber

Add test for raise on resume after fiber is dead

add Fiber#alive?

fix fiber GC problem

Add Fiber Test for issue #1264

fiber do not work on MRB_NAN_BOXING

add fiber tests

manage fiber status (create|running|resumed|terminated)

garbage collect context (fiber) properly

Change Fibder to Fiber and a couple other wording issues

update Fiber.new doc

primary mruby fiber implementation

Word Boxing

small refactoring over word boxing

Add MRB_WORD_BOXING mode (represent mrb_value as a word)

ObjectSpace

Cleanup of mruby_objectspace.c and removed the unneccessary README for mruby_objectspace.

Added mruby-objectspace to the detault gembox.

First implementation of ObjectSpace moved outside of gc.c

ObjectSpace.count_objects was incorrectly checking if an object was already freed. Amended the count_objects test to ensure the correct distinction

Implemented ObjectSpace.count_objects to count the number of allocated objects for each type

Others

mruby error messages should be directed to stderr

fixed a bug in initializing post mandatory block parameters

should set argc at proper position; close #1264

should have protected the return value from GC, even when the method is defined in Ruby; close #1263

remove unnecessary assignment

error in initializing callinfo stack in cipush(); close #1261

avoid unnecessary pool/syms restoration

update error message

Change fortmat to format.

mrbc: use binary mode on outfile

removed unused variables / assigns never used

indentation fix

remove unused local variable

Fixed the each object callback to be more consistent with other callbacks.

Changed the counting so that only objects that are alive are added to the object counts.

Minor formatting change.

Changed the each_object callback so that a pointer is passed for the object, instead of the struct.

Removed debug output

Changed the object_count so that it only iterates over the RBasic object, not the full RVALUE known by the GC

Fix compiler warning by exiting if wfp isn’t set

avoid unnecessary copy of context->filename

mrbc to take multiple files, preserving debug information if -g given; close #1243

Fix off by one issue

Add example of modifying mrbc options to add debug info

Allow mrbc command options to be changed

Fix early free of irep->filename

forgot to add src/backtrace.c

show a backtrace when when an error occurs on gem load; close #1243

move mruby’s showcallinfo into the core

Change in formatting for os_count_objects to be consistent with other functions.

Potential fix for ‘inline’ macro redefinition error – VS2012 C++

Change alghorithm to algorithm

change mrb_bug to get mrb_state and %S formatter

change mrb_warn to get mrb_state and %S formatter

Rename parameter names for mrb_yield

fix indentation

Print mrb_value instead of RClass*

remove unused variables

fix regexp warning: character class has duplicated range

[doc] Add minimal build configuration

Move declaration of kernel to the beginning of the method

mirb should handle exception from inspect; close #1238

Remove mrb_hash_lookup() as no one uses it. Use mrb_hash_get instead.

Add more test cases for test coverage.

Adding a few more respond_to tests

fix typos.

add type check in Hash#merge!

remove explicit check to honor duck typing

avoid subclassing Array not to inherit too much methods

Push Copyright year up to 2013

ArduinoDue Target Cosmetic Change

Remove mrb_class_obj_get