This articles was published on 2013-03-01

[February 2013] mruby news

What happened on the mruby front in February 2013?

Pluggability

The big topic in February 2013 was the gemification of many mruby core features. In detail the Regular Expression Engine, the Math module, the Time class and Struct were extracted from the mruby core and transformed into independent GEMs. Math, Time and Struct will be maintained inside of the mruby repository. Due to the reason that there are several Regexp implementations (see Pluggable RegExp) these GEMs are maintained in their own repository.

Cross Compile

Serg Podtynnyi built a cross compilation toolchain configuration for Android. It is using the Android NDK to build a mruby executable which can be executed under Android.

Based on kyab‘s work on cross compiling to our first Arduino compatible device (ChipKitMax32) I created an example build configuration file inside of the mruby source.

Improve Test Environment

Akira Yumiyama added several new assert methods like:

  • assert_true
  • assert_nil
  • assert_equal
  • assert_includes
  • assert_instance_of
  • assert_kind_of
  • assert_raises

It is now also possible the pass the verbose flag to minirake which will then output a very detailed test result of every test case with ISO code (if existing). Skip a test is possible too now.

Improve stdlib

String got a couple of new methods like #sub, #sub!, #gsub and #gsub!. At the same time Module got a new method called #remove_const.

Commits

Here a list with all commits during this month.

Pluggability

Move Math::TOLERANCE to mruby-math

mv mrgems/mruby-math to mrbgems

Pluggable Math

Remove needless comment

Cleanup Regexp codes

Fix build

s/mgem/mrbgem/

Regexp: %r notation bug fix. close #85.

Put mruby-time mgem into the repository.

Remove needless files

Pluggable Time class

Remove needless file

parser_dump supports NODE_REGEX.

compile /a/ as ::Regexp.new(“a”)

Remove DISABLE_REGEXP

remove TT_REGEX and TT_MATCH

REGEXP_CLASS

Pluggable Regexp

ready to pass second argument of Regexp.new

Cross Compile

remove user specific directory

add chipKitMax32 target example

Add documentation for Android toolchain

Add androideabi toolchain rake task (Build mruby with Android NDK)

Improve Test Environment

Rake respects verbose flag also for test and clean target

rename assert_raises to assert_raise

remove assert_instance_of and assert_kind_of which might hinder duck typing

rename assert_includes to assert_include

Add skip method for test

add assert_{includes,instance_of,kind_of,raises} methods.

declare local variable at the start of a block in generated gem_test.c

update String#gsub test

add assert_{true,nil,equal} methods.

add mrbtest verbose mode (‘-v’ option)

Add more tests for `begin` and `rescue`.

Generate mrbtest.a file for sparete from driver.o

Improve stdlib

adopt String#gsub to fixed split behavior

String#split should honor limit arg

String#gsub fix with last character

Add Module#remove_const test

fix error output for Module#remove_const

add Module#remove_const

Added String#sub/sub! and String#gsub/gsub!

Others

Adjust space

Fix arena size check.

Do not generate test_args_hash variable if it is not used

Remove freeze leftovers

Ignore *.d, *.o, and /lib

Add document for array_copy

Modify stack position of NODE_DEF and NODE_SDEF.

Increase TEST_INFINITE_RECURSION_MAX value from 100000 to 1000000 because modification of handling of `NODE_RETURN` reduces stack size.

Return nil if argument of NODE_RETURN and NODE_NEXT is not specified.

Clean code up.

mrb_funcall_with_block: adj. ci & sp after error

Simplify mrb_range_beg_len(). Don’t use OTHER macro.

Adjust stack position of NODE_RESCUE.

Make OP_ASGN faster.

Remove commented out code. Remove redundant function calls.

Reduce sprintf() calls. Remove mrb_int_to_str() and MRB_INT_FORMAT.

Support to build on pwd != mruby source root

Fix errors caused by stdio.h dependent code.

Cleanup shift operations.

Fix an underlying bug. flodivmod() will be crashed in case ((y == 0) && ((divp == NULL) || (modp == NULL))).

Add a comment.

Remove a comment at an unsuitable place.

Cosmetic changes. Just added empty lines.

Fix mrb_fix2str() to enable handling some negative values correctly. This fix is based on @cremno’s hack. It will fix #869.

Call compile method to override to memolize instances

Fix indent

better comment description for mrbconf.h configuration

remove unused HAVE_UNISTD_H altogether; ref #865

Clean up mrbconf.h

fix access denied error at incremental build

print the error message before abort()

rename RVALUE union members

add RData entrie to RVALUE union

s must not be freed, removed space in exc msg

vars must be declared at the start of a block

Changed debugger hook to disable

rename hook and macro

resolve conflict

Fix crash when exiting mirb using ctrl-d when compiled with readline support.

Created hook at VM code fetch. It’s for debugger

use mrb_get_args(“n”) instead of decomposing each time

Should be OP_LOADL

Extend MiniRake::DSL module to prevent inheritance pollution

Update doc/compile/README.md

add mrb_str_to_cstr

should adjust stack size when irep->nregs is larger than allocate size; close #835

“for i in (1..12/5); p i ; end” should not print “3″

Don’t overwrite ciidx if it is already set.

Ignore empty gem

Change task rule based on build_dir so main rules don’t clobber gem rules.

changing Make_Data_Struct API; you need to modify your code that uses Make_Data_Struct; close #821

Add semi-colon after the statement.

rewrote mrb_any_to_s

removed declarations of undefined functions

Restore arena in `String#split`.

Fix potential bug about Hash.

Prevent overflow of `Fixnum#to_s`.

Modify handling of integer literal.

Fixed failure

Remove “;” suffix from function-type macros.

Change the way that the DISABLE_GEMS flag is set for vs2012.