This articles was published on 2013-02-08

[January 2013] mruby news

What happened on the mruby front in January 2013?

Build System

The main item this time was again the build system. CMake was removed as a building choice after the new Rake system could handle nicely cross-compilation via toolchain files. Lots of work went into customisation of the build options. It is possible now to only build specific binaries or just the main library. There is now also an extensive documentation of the (cross-)compilation process.

Garbage Collector

Narihiro Nakamura had a great new year gift in the beginning of January 2013. He wrote a generational garbage collector which is now by default activated. In case you want to use the incremental GC mode you have to set:

GC.generational_mode = false

mrbc

I was a bit surprised seeing that the C function dump option of mrbc was removed by Yuichiro MASUI. I described this function some month back in Five ways to execute mruby but this option was never really used by anyone and also it was a bit buggy. So now it is more like “Four ways to execute mruby” :-)

Range

Masamitsu MURASE fixed some parts of the Range implementation so that the initialisation is now working.

method_defined?

skandhas implemented method_defined?.

Clean Up

Some left-overs were removed like unused functions, macros and constants.

Commits

Build System

Add ability to pass parameters from mrbgem.rake spec into test scripts.

Remove double quote for MRUBY_XXX in libmruby.flags.mak

Change the way that the DISABLE_GEMS flag is set.

Correct conf.gem directory

Added .lib extension for library file on VS2012

Fix some styling of the documentation

Modify code blocks

Fixed markdown of code in mrbgems/README.md

load MRUBY_CONFIG script after ‘build_config.rb’

remove bin/command first to avoid text file busy

Fixed mrbc file ext on host

Moved mrbgems examples

Let’s use more ruby

Listing gems vertically

Remove noisy build message quotes

Add flags_after_libraries

Add build summary at the end of a build.

Makefile: add all to test dependency

Remove reverse

Refine pretty-print indenting

Fix pretty-print test miss

Refine pretty printing

Removed ext

Added finalizer of mrbgems

Add C++/Objective-C init in toolchains

Added “Unknown toolchain/gem” error message

Added flags_before_libraries to linker

Changed flags name in libmruby.flags.mak

vs2012 toolchain: various fixes

Beautify the output of rake

Set default rake to not verbose

make minirake respect verbose and set verbose to false by default

Fixed 1.8 compatibilitywq

fix build faild on Cygwin Environment

Reduce line length

Fix Visual Studio Toolchain

Export build flags to lib/libmruby.flags.mak

Beautify the graphs in the compilation documentation

Add diagram for new build process

build_config gets more flexibility

Modify documentation for new build process

Improved build scripts and config files

silence clang warning

note about $MRUBY_CONFIG.

build gems if build_config.rb is modified.

should be flatten.

Fixed mrbtest result numbers

Removed gem libraries in mrbc

remove compiler warnings.

Test ruby library should depend on host’s mrbc, not its own mrbc

Make conf.bins work for cross compiled deps as well as the host.

Added conf.bins for defining bulding binaries

Added s flag to ar command

Added gem :github option

Run mrbgems test run on isolate mrb_state each rb file.

Remove unused rules in .gitignore and Makefile

Removed XCode build

Added cxx/objc/asmflags in mrbgems. Sorry, I forgot it

Add mruby_ldflags to mrbtest

Fix mrbgem options 689#issuecomment-11911431

Fixed build dependency

Add mruby_ldflags when tools/mruby and tools/mrbc link archive files

Changed objccflags to objcflags Added cxxflags, objcflags, asmflags to mrbgem.rake Support .cxx and .cc as C++ source in mrbgems

Fix an unnecessary space

Fixed pure ruby mrbgems can’t compile and fixed build script wrong variable name

Add documentation for compilation process

Fix documentation for mrbgems

Adapter mrbgems documentation to rake system

Rebuild CRuby based building script without Makefile

Garage Collector

mrb_field_write_barrier paints also gray in the major collector. These objects will be traversed after a minor collect cycle.

Doesn’t clear black of all marked objects in major collections. Since the minor collector doesn’t need to mark these objects, the worst-case pause time is reduced.

Add field_write_barrier when an method is defined.

Clear all old flags, even if we change the gc mode during the major gc.

Compact flags for GC

add test cases for GC API

Skip sweeping old slots which don’t contain any young object.

gc.c: Enable DEBUG(x) if GC_DEBUG is defined. vm.c: Enable DEBUG(x) if VM_DEBUG is defined.

Add the generational gc

These places need the write barrier

mrbc

Removed mrbc -C option what’s C function dump. and TAB to space

Add check for using cdump with DISABLE_STDIO option.

Range

Enable test for `Range#initialize`.

Initialize Range->edges after cheking `beg` and `end` to prevent segmentation fault.

Modify `Range#initialize` to accept optional `exclusive` argument.

Initialize edges of RRange.

method_defined?

add test for Module#method_defined?

add mrb_mod_method_defined

Clean Up

Changed variable $test_args to constant TEST_ARGS

rename mrb_ary_alen to mrb_ary_len; close #781

Fixed MRB_INT64 warning

removed unused mrb_check_funcall

removed unused mrb_funcargv_t

Remove unused define and commented out code.

Removed mistake

more aggressive code elimination for NODE_DOT{2,3}

eliminate unused hash expression more aggresively

eliminate unused array expression more aggresively

supress cast warning on C++.

Remove unused function parametes.

Remove API mrb_str_catf().

Removed tests that look outdated. The mrb_compile_string they use is gone now.

Fixes a number of “comparison between signed and unsigned” warnings.

Remove multiple definition of RuntimeError.

remove mrb_str_each_line form src/string.c

Remove redundant null checks.

remove MRUBY_VERSION for the time being; close #700

Remove DEBUG macro definitions.

Others

Bug fix.

Protect irep of ensure.

Make sure quotes and escapes get escaped.

Fixed minor typo.

defined printf macro for mrb_int

inspecting anonymous class should not SEGV; close #780

Fixed mistake

zero initialize hex buffers; close 768

Add test for `undef` and `alias`.

Modify handling of NODE_UNDEF to accept multiple arguments.

Add a test for quoted non-expanded string literal.

Modify handling of Quoted non-expanded literal strings.

Add test for issue #750.

Modify handling of OP_ENTER.

Modify handling of `bodystmt`.

fixed wrong loop termination introduced by 79d38c4

save/restore arena index in mirb; close #740

check if array expands in each block

check if array shrinks in each block

Fix disappearance of command_call in case of statement without parentheses.

wrong condiiton in too many symbols check; #close #731

use the new specifier b instead of o

include/mruby/cdump.h: Add new error codes. src/cdump.h: Use error codes defined in mruby/cdump.h.

Use MRB_DUMP_OK instead of 0.

change 2012 to 2013

fix typos

add new specifier “b” (boolean) for mrb_get_args()

add mrb_check_hash_type

jump address error when value taken from if statement without else clause; close #712

Add a comment: the usage of MRB_DUMP_GENERAL_FAILURE.

Fix error handlings.

Extract each expresion in “if” statements. It is for maintainability.

Export mrb_ary_clear in array.h

`unless` without `else` should return nil if the condition is true.

Modify NODE_IF handling.