Lightweight Ruby mruby is the lightweight implementation of the Ruby language complying to (part of) the ISO standard. mruby can be linked and embedded within your application. We provide the interpreter program "mruby" and the interactive mruby shell "mirb" as examples. You can also compile Ruby programs into compiled byte code using the mruby compiler "mrbc". All those tools reside in the "bin" directory. "mrbc" is also able to generate compiled byte code in a C source file, see the "mrbtest" program under the "test" directory for an example. https://mruby.org/ Sat, 17 Jan 2026 04:03:36 +0000 Sat, 17 Jan 2026 04:03:36 +0000 Jekyll v3.10.0 mruby 3.4.0 released <h1 id="mruby-340">mruby 3.4.0</h1> <p>We are announcing the first stable release of mruby 3.4 series - <a href="https://github.com/mruby/mruby/releases/tag/3.4.0">mruby 3.4.0</a>.</p> <p>Describes the new features and changes in mruby 3.4.<br /> The main changes in mruby 3.4 are also described in <a href="https://github.com/mruby/mruby/blob/master/doc/mruby3.4.md">doc/mruby3.4.md</a>.</p> <hr /> <h1 id="user-visible-changes-in-mruby34-from-mruby33">User visible changes in <code class="language-plaintext highlighter-rouge">mruby3.4</code> from <code class="language-plaintext highlighter-rouge">mruby3.3</code></h1> <p>“<strong><em>NOTE</em></strong>:” are changes to be aware of.</p> <h1 id="the-language">The language</h1> <ul> <li>mruby now supports <code class="language-plaintext highlighter-rouge">private</code> and <code class="language-plaintext highlighter-rouge">protected</code> visibitily (<a href="https://github.com/mruby/mruby/commit/b0db0bd">b0db0bd</a>)</li> <li>Maximum length of inlined symbols reduced from 5 to 4 characters to provide space for visibility flags (<a href="https://github.com/mruby/mruby/commit/6442a01">6442a01</a>)</li> <li>Many methods are made private according to CRuby visibility (<a href="https://github.com/mruby/mruby/commit/4a0e806">4a0e806</a>)</li> <li>Generate OP_SSEND for <code class="language-plaintext highlighter-rouge">self.method</code> type calls (<a href="https://github.com/mruby/mruby/commit/111fe4b">111fe4b</a>)</li> <li><code class="language-plaintext highlighter-rouge">initialize</code> method will be always private (<a href="https://github.com/mruby/mruby/commit/eb8b412">eb8b412</a>)</li> <li>Add new hooks <code class="language-plaintext highlighter-rouge">method_removed</code>, <code class="language-plaintext highlighter-rouge">method_undefined</code> (<a href="https://github.com/mruby/mruby/commit/9c74f6e">9c74f6e</a>)</li> <li>Add new hooks <code class="language-plaintext highlighter-rouge">singleton_method_removed</code>, <code class="language-plaintext highlighter-rouge">singleton_method_undefined</code> (<a href="https://github.com/mruby/mruby/commit/0863c08">0863c08</a>)</li> <li>Updated <code class="language-plaintext highlighter-rouge">OP_DEF</code> output from codedump (<a href="https://github.com/mruby/mruby/commit/3a3e877">3a3e877</a>)</li> <li>Better handling of binary strings, e.g. String#b (<a href="https://github.com/mruby/mruby/commit/b0127f0">b0127f0</a>)</li> <li>Hash <code class="language-plaintext highlighter-rouge">to_s</code> format has changed (<a href="https://github.com/mruby/mruby/commit/baeeb5e">baeeb5e</a>)</li> <li>Some encoding related method such as <code class="language-plaintext highlighter-rouge">#force_encoding</code> (<a href="https://github.com/mruby/mruby/commit/e47b4ca">e47b4ca</a>), <code class="language-plaintext highlighter-rouge">#b</code> (<a href="https://github.com/mruby/mruby/commit/b0127f0">b0127f0</a>)</li> <li>Constant folding for <code class="language-plaintext highlighter-rouge">String#+</code> (<a href="https://github.com/mruby/mruby/commit/6687bdd">6687bdd</a>)</li> <li>Remove Float bit-operation (<a href="https://github.com/mruby/mruby/commit/db8368f">db8368f</a>)</li> <li>use SWAR technique for strlen performance (<a href="https://github.com/mruby/mruby/commit/cbb31e6">cbb31e6</a>)</li> <li>use merge sort for <code class="language-plaintext highlighter-rouge">Array#sort</code> (<a href="https://github.com/mruby/mruby/commit/5bd63d6">5bd63d6</a>)</li> </ul> <h1 id="changes-in-c-api">Changes in C API</h1> <ul> <li>pool.c renamed to mempool.c (and mrb_pool to mrb_mempool) (<a href="https://github.com/mruby/mruby/commit/49525fa">49525fa</a>)</li> <li>mrb_pool_value renamed to mrb_irep_pool to reduce confusion (<a href="https://github.com/mruby/mruby/commit/62ef5db">62ef5db</a>)</li> <li>rename BOXNIX_SET_VALUE to BOXNO_SET_VALUE (<a href="https://github.com/mruby/mruby/pull/6397">#6397</a>)</li> <li><code class="language-plaintext highlighter-rouge">MRB_FROZEN_P()</code> is replaced by <code class="language-plaintext highlighter-rouge">mrb_frozen_p()</code> (<a href="https://github.com/mruby/mruby/commit/c11d18e">c11d18e</a>)</li> <li>rename <code class="language-plaintext highlighter-rouge">color</code> to <code class="language-plaintext highlighter-rouge">gc_color</code> (<a href="https://github.com/mruby/mruby/commit/0e79f6b">0e79f6b</a>, <a href="https://github.com/mruby/mruby/commit/1e36d76">1e36d76</a>)</li> <li>add <code class="language-plaintext highlighter-rouge">obj-&gt;frozen</code> instead of flags <code class="language-plaintext highlighter-rouge">MRB_SET_FROZEN_FLAG</code>/<code class="language-plaintext highlighter-rouge">MRB_UNSET_FROZEN_FLAG</code> (<a href="https://github.com/mruby/mruby/commit/8276143">8276143</a>)</li> </ul> <h1 id="build--configuration">Build &amp; Configuration</h1> <ul> <li>New Build Target: <code class="language-plaintext highlighter-rouge">test:run:serial</code>, <code class="language-plaintext highlighter-rouge">test:run:serial:lib</code>, <code class="language-plaintext highlighter-rouge">test:run:serial:bin</code> (<a href="https://github.com/mruby/mruby/pull/6423">#6423</a>)</li> <li>New Platform: Playstation Portable (<a href="https://github.com/mruby/mruby/pull/6465">#6022</a>)</li> <li>New Platform: emscripten (<a href="https://github.com/mruby/mruby/pull/6487">#6487</a>)</li> <li>New Config: no-float (with MRB_NO_FLOAT) (<a href="https://github.com/mruby/mruby/commit/32200f1">32200f1</a>)</li> </ul> <h1 id="changes-in-mrbgems">Changes in mrbgems</h1> <ul> <li><strong>mruby-print</strong>: removed; if you do not use <code class="language-plaintext highlighter-rouge">mruby-io</code>, mruby use <code class="language-plaintext highlighter-rouge">#print</code> etc. in the core (<a href="https://github.com/mruby/mruby/commit/8c8bbd9">8c8bbd9</a>)</li> <li><strong>mruby-enum-lazy</strong>: Add Enumerable::Lazy#grep_v to mruby-enum-lazy (<a href="https://github.com/mruby/mruby/pull/6171">#6171</a>)</li> <li><strong>mruby-io</strong>: Add <code class="language-plaintext highlighter-rouge">level</code> argument to <code class="language-plaintext highlighter-rouge">File.dirname</code> (<a href="https://github.com/mruby/mruby/pull/6463">#6463</a>)</li> <li><strong>mruby-io</strong>: File.absolute_path? (<a href="https://github.com/mruby/mruby/pull/6482">#6482</a>)</li> <li><strong>mruby-io</strong>: File.absolute_path (<a href="https://github.com/mruby/mruby/commit/96113a2">96113a2</a>)</li> <li><strong>mruby-toplevel-ext</strong>: top-level public/private/protected moved to the core (<a href="https://github.com/mruby/mruby/commit/2a876d2">2a876d2</a>)</li> <li><strong>mruby-metaprog</strong>: method list methods now works according to the visibility (<a href="https://github.com/mruby/mruby/commit/9229da1">9229da1</a>)</li> <li><strong>mruby-metaprog</strong>: <code class="language-plaintext highlighter-rouge">public_instance_methods</code>, <code class="language-plaintext highlighter-rouge">private_instance_methods</code>, <code class="language-plaintext highlighter-rouge">protected_instance_methods</code> (<a href="https://github.com/mruby/mruby/commit/9e3e7b2">9e3e7b2</a>)</li> <li><strong>mruby-encoding</strong>: MRB_UTF8_STRING turned on automatically with this gem (<a href="https://github.com/mruby/mruby/commit/74bdae9">74bdae9</a>)</li> </ul> <h1 id="fixed-github-issues">Fixed GitHub Issues</h1> <ul> <li><a href="https://github.com/mruby/mruby/issues/6173">#6173</a> Fails to build with tcc(Tiny C Compiler)</li> <li><a href="https://github.com/mruby/mruby/issues/6156">#6156</a> ‘/LIBPATH’ issue</li> <li><a href="https://github.com/mruby/mruby/issues/6183">#6183</a> “.e”.to_f returns NAN</li> <li><a href="https://github.com/mruby/mruby/issues/6182">#6182</a> mrb_read_float() converts “0.3” with a small error compared to strtod()</li> <li><a href="https://github.com/mruby/mruby/issues/6210">#6210</a> Unary minus seems broken</li> <li><a href="https://github.com/mruby/mruby/issues/6255">#6255</a> Wrong number of characters in broken UTF-8 string</li> <li><a href="https://github.com/mruby/mruby/issues/4038">#4038</a> Heap buffer overflow in OP_ENTER</li> <li><a href="https://github.com/mruby/mruby/issues/6262">#6262</a> Unable to define == for objects when using Array#delete</li> <li><a href="https://github.com/mruby/mruby/issues/6267">#6267</a> When MRB_UTF8_STRING is enabled, giving byte characters for String#index and String#split gives wrong results</li> <li><a href="https://github.com/mruby/mruby/issues/6277">#6277</a> MSVC: can’t use malloc() in string.c with WIN32_LEAN_AND_MEAN</li> <li><a href="https://github.com/mruby/mruby/issues/6240">#6240</a> Differentiate between lib and lib64 in the build settings.</li> <li><a href="https://github.com/mruby/mruby/issues/6304">#6304</a> Calling method_missing with only Kwargs passes arguments incorrectly</li> <li><a href="https://github.com/mruby/mruby/issues/6317">#6317</a> mrb_gc_register() may cause GC and collect the object being protected</li> <li><a href="https://github.com/mruby/mruby/issues/6307">#6307</a> Planned change patch for mrb_vm_exec()</li> <li><a href="https://github.com/mruby/mruby/issues/6298">#6298</a> foo :bar {} is legal in mruby?</li> <li><a href="https://github.com/mruby/mruby/issues/6326">#6326</a> Detect “Use-after-free” with address sanitizer</li> <li><a href="https://github.com/mruby/mruby/issues/5358">#5358</a> static warning from getpwnam</li> <li><a href="https://github.com/mruby/mruby/issues/6339">#6339</a> mrb_ary_delete() may refer to an invalid address (use-after-free)</li> <li><a href="https://github.com/mruby/mruby/issues/6346">#6346</a> Block kwargs are passed as last positional arg when using yield</li> <li><a href="https://github.com/mruby/mruby/issues/6365">#6365</a> powl() not available when compiling for Dreamcast</li> <li><a href="https://github.com/mruby/mruby/issues/6369">#6369</a> 100x Performance Regression from 3.1</li> <li><a href="https://github.com/mruby/mruby/issues/6270">#6270</a> NODE_ZSUPER from deeply nested blocks will result in a truncated digits for block index in OP_ARGARY</li> <li><a href="https://github.com/mruby/mruby/issues/6297">#6297</a> Assigning to a block variable changes the actual block (thus affecting block_given? and yield)</li> <li><a href="https://github.com/mruby/mruby/issues/6389">#6389</a> instance_exec named block args don’t work properly</li> <li><a href="https://github.com/mruby/mruby/issues/6388">#6388</a> Recent commit broke my windows build</li> <li><a href="https://github.com/mruby/mruby/issues/6411">#6411</a> Wrong function unwinding when using return in a block</li> <li><a href="https://github.com/mruby/mruby/issues/6439">#6439</a> OP_JMPUW does not call the ensure block when it jumps to the beginning of the begin block</li> <li><a href="https://github.com/mruby/mruby/issues/6441">#6441</a> break inside while loop will execute the ensure block outside of the while loop</li> <li><a href="https://github.com/mruby/mruby/issues/6453">#6453</a> Bigint: incorrect behavior of ^ operator</li> <li><a href="https://github.com/mruby/mruby/issues/6452">#6452</a> Bigint: weird mod behavior</li> <li><a href="https://github.com/mruby/mruby/issues/6451">#6451</a> Bigint: incorrect division behavior</li> <li><a href="https://github.com/mruby/mruby/issues/6456">#6456</a> bigint: bug with division of a small number by a bigint</li> <li><a href="https://github.com/mruby/mruby/issues/6466">#6466</a> mruby-bin-mruby using Kernel#p and Kernel#print in bintest fails test</li> <li><a href="https://github.com/mruby/mruby/issues/6467">#6467</a> Heap-Use-After-Free due to Recursive group_by Calls</li> <li><a href="https://github.com/mruby/mruby/issues/6471">#6471</a> Discrepancy in codegen for binary operations between master branch and 3.3.0</li> <li><a href="https://github.com/mruby/mruby/issues/6477">#6477</a> heap-buffer-overflow in mrb_vm_exec</li> <li><a href="https://github.com/mruby/mruby/issues/6485">#6485</a> Hash#rehash does not check if the hash is frozen</li> <li><a href="https://github.com/mruby/mruby/issues/6483">#6483</a> Hash#default_proc= accepts arbitrary objects that are not callable</li> <li><a href="https://github.com/mruby/mruby/issues/6491">#6491</a> Destroy existing string literals when composing string literals</li> </ul> <h1 id="merged-pull-requests-user-visible-ones">Merged Pull Requests (User Visible Ones)</h1> <ul> <li><a href="https://github.com/mruby/mruby/pull/6171">#6171</a> Add Enumerable::Lazy#grep_v to mruby-enum-lazy</li> <li><a href="https://github.com/mruby/mruby/pull/6174">#6174</a> Fix MRUBY_PACKAGE_DIR in mruby-config.bat</li> <li><a href="https://github.com/mruby/mruby/pull/6175">#6175</a> Corrected strange conditional in mrb_vm_run()</li> <li><a href="https://github.com/mruby/mruby/pull/6176">#6176</a> Stop assuming alias proc in CI_PROC_SET()</li> <li><a href="https://github.com/mruby/mruby/pull/6177">#6177</a> gha: add macOS 14 to the build</li> <li><a href="https://github.com/mruby/mruby/pull/6184">#6184</a> Remove the L_STOP label</li> <li><a href="https://github.com/mruby/mruby/pull/6185">#6185</a> Added mrb_callinfo::u.keep_context for clarity</li> <li><a href="https://github.com/mruby/mruby/pull/6186">#6186</a> Omit NULL check of e-&gt;cxt in OP_RETURN_BLK</li> <li><a href="https://github.com/mruby/mruby/pull/6191">#6191</a> Speed up symbol equality comparison</li> <li><a href="https://github.com/mruby/mruby/pull/6192">#6192</a> Fix <code class="language-plaintext highlighter-rouge">OP_STOP</code> with exception</li> <li><a href="https://github.com/mruby/mruby/pull/6193">#6193</a> Fix wrong assertion in <code class="language-plaintext highlighter-rouge">OP_SENDB</code>.</li> <li><a href="https://github.com/mruby/mruby/pull/6194">#6194</a> Simplify the calculation of the number of closures in <code class="language-plaintext highlighter-rouge">MRB_TT_FIBER</code></li> <li><a href="https://github.com/mruby/mruby/pull/6197">#6197</a> Fix int_xor to call flo_xor.</li> <li><a href="https://github.com/mruby/mruby/pull/6201">#6201</a> tasks/doc.rake: standardize the <code class="language-plaintext highlighter-rouge">rake doc</code> error messages</li> <li><a href="https://github.com/mruby/mruby/pull/6202">#6202</a> Remove the <code class="language-plaintext highlighter-rouge">.yardoc</code> folder with <code class="language-plaintext highlighter-rouge">rake doc:clean:api</code></li> <li><a href="https://github.com/mruby/mruby/pull/6204">#6204</a> Clean up the <code class="language-plaintext highlighter-rouge">.editorconfig</code> file</li> <li><a href="https://github.com/mruby/mruby/pull/6209">#6209</a> Minor <code class="language-plaintext highlighter-rouge">.gitignore</code> clean up</li> <li><a href="https://github.com/mruby/mruby/pull/6211">#6211</a> Minor <code class="language-plaintext highlighter-rouge">.gitignore</code> clean up; order entries</li> <li><a href="https://github.com/mruby/mruby/pull/6216">#6216</a> Shared empty <code class="language-plaintext highlighter-rouge">iv_tbl</code> of module</li> <li><a href="https://github.com/mruby/mruby/pull/6217">#6217</a> Strict declaration for <code class="language-plaintext highlighter-rouge">mrb_istruct_size()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6219">#6219</a> Avoid assigning a fixed value in the loop</li> <li><a href="https://github.com/mruby/mruby/pull/6220">#6220</a> Reorganize <code class="language-plaintext highlighter-rouge">mrb_cache_entry</code> and <code class="language-plaintext highlighter-rouge">mrb_method_t</code> types</li> <li><a href="https://github.com/mruby/mruby/pull/6221">#6221</a> Arranging <code class="language-plaintext highlighter-rouge">each_backtrace()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6222">#6222</a> Need to synchronize <code class="language-plaintext highlighter-rouge">dbg-&gt;regs</code> after VM call in <code class="language-plaintext highlighter-rouge">mrdb</code></li> <li><a href="https://github.com/mruby/mruby/pull/6224">#6224</a> <code class="language-plaintext highlighter-rouge">mrb_env_unshare()</code> to break the link to fiber</li> <li><a href="https://github.com/mruby/mruby/pull/6225">#6225</a> Revert “Adjust environment when <code class="language-plaintext highlighter-rouge">mrb_exec_irep</code> happened.”</li> <li><a href="https://github.com/mruby/mruby/pull/6227">#6227</a> fix: <code class="language-plaintext highlighter-rouge">Array#shuffle(!)</code> result distribution</li> <li><a href="https://github.com/mruby/mruby/pull/6228">#6228</a> Revert “<code class="language-plaintext highlighter-rouge">env</code> referred from top-level callinfo should not be unshared; fix #4019”</li> <li><a href="https://github.com/mruby/mruby/pull/6230">#6230</a> Fix status of fiber after switched by exception raised</li> <li><a href="https://github.com/mruby/mruby/pull/6231">#6231</a> Add a way to let other gems handle closing of fds in mruby-io</li> <li><a href="https://github.com/mruby/mruby/pull/6232">#6232</a> Fold the code for freeing <code class="language-plaintext highlighter-rouge">env</code></li> <li><a href="https://github.com/mruby/mruby/pull/6233">#6233</a> Free stack memory at end of fiber</li> <li><a href="https://github.com/mruby/mruby/pull/6235">#6235</a> fix <code class="language-plaintext highlighter-rouge">Array#delete</code> always firing the block when deleting <code class="language-plaintext highlighter-rouge">nil</code></li> <li><a href="https://github.com/mruby/mruby/pull/6236">#6236</a> unify the code for filter methods (and speed up <code class="language-plaintext highlighter-rouge">#reject!</code>)</li> <li><a href="https://github.com/mruby/mruby/pull/6237">#6237</a> Stricter env objects to attach to ci</li> <li><a href="https://github.com/mruby/mruby/pull/6238">#6238</a> Minimize zero initialization of the stack</li> <li><a href="https://github.com/mruby/mruby/pull/6243">#6243</a> Fixed base64 decoding in <code class="language-plaintext highlighter-rouge">mruby-pack</code></li> <li><a href="https://github.com/mruby/mruby/pull/6244">#6244</a> Revise scope of role of <code class="language-plaintext highlighter-rouge">mrb_vm_run()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6246">#6246</a> Fix typo in <code class="language-plaintext highlighter-rouge">test/t/hash.rb</code></li> <li><a href="https://github.com/mruby/mruby/pull/6249">#6249</a> Fix grammar in <code class="language-plaintext highlighter-rouge">src/vm.c</code>; <code class="language-plaintext highlighter-rouge">catched</code> -&gt; <code class="language-plaintext highlighter-rouge">caught</code></li> <li><a href="https://github.com/mruby/mruby/pull/6250">#6250</a> Fix spelling</li> <li><a href="https://github.com/mruby/mruby/pull/6251">#6251</a> Clean up root move <code class="language-plaintext highlighter-rouge">CODEOWNERS</code> to <code class="language-plaintext highlighter-rouge">.github</code> directory</li> <li><a href="https://github.com/mruby/mruby/pull/6253">#6253</a> Allow recycling fibers by GC if not referenced directly</li> <li><a href="https://github.com/mruby/mruby/pull/6256">#6256</a> Update documentation for <code class="language-plaintext highlighter-rouge">mrb_top_run()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6257">#6257</a> fix some mrbconf.md typos</li> <li><a href="https://github.com/mruby/mruby/pull/6260">#6260</a> Remove <code class="language-plaintext highlighter-rouge">exc_caught</code> from <code class="language-plaintext highlighter-rouge">mrb_vm_exec()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6261">#6261</a> fix: <code class="language-plaintext highlighter-rouge">to_a</code> integer ranges with <code class="language-plaintext highlighter-rouge">begin &gt; end</code> failing</li> <li><a href="https://github.com/mruby/mruby/pull/6263">#6263</a> fix: <code class="language-plaintext highlighter-rouge">Array#delete</code> mistakenly calling block even if not passed</li> <li><a href="https://github.com/mruby/mruby/pull/6264">#6264</a> Must pass keyword arguments for <code class="language-plaintext highlighter-rouge">Kernel#to_enum</code></li> <li><a href="https://github.com/mruby/mruby/pull/6265">#6265</a> Fixes <code class="language-plaintext highlighter-rouge">Dir.children</code> and <code class="language-plaintext highlighter-rouge">Dir.each_child</code></li> <li><a href="https://github.com/mruby/mruby/pull/6266">#6266</a> Passes the nonexistent key as a block argument in <code class="language-plaintext highlighter-rouge">Array#delete</code></li> <li><a href="https://github.com/mruby/mruby/pull/6273">#6273</a> Improvements to <code class="language-plaintext highlighter-rouge">mrb_protect_atexit()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6275">#6275</a> Fixed <code class="language-plaintext highlighter-rouge">Binding#eval</code> that failed to assign to the same variable</li> <li><a href="https://github.com/mruby/mruby/pull/6276">#6276</a> Always run <code class="language-plaintext highlighter-rouge">atexit</code> on the top-level call frame</li> <li><a href="https://github.com/mruby/mruby/pull/6279">#6279</a> Include headers for malloc() explicitly; fix #6277</li> <li><a href="https://github.com/mruby/mruby/pull/6280">#6280</a> Remove <code class="language-plaintext highlighter-rouge">MRB_ENV_CLOSED</code> flag</li> <li><a href="https://github.com/mruby/mruby/pull/6281">#6281</a> Fixes local variables in <code class="language-plaintext highlighter-rouge">mruby-binding</code>.</li> <li><a href="https://github.com/mruby/mruby/pull/6283">#6283</a> Simplify <code class="language-plaintext highlighter-rouge">uvenv()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6288">#6288</a> Detach <code class="language-plaintext highlighter-rouge">env</code> of ci explicitly on atexit</li> <li><a href="https://github.com/mruby/mruby/pull/6289">#6289</a> Simplify <code class="language-plaintext highlighter-rouge">OP_RETURN_BLK</code> and <code class="language-plaintext highlighter-rouge">OP_BREAK</code></li> <li><a href="https://github.com/mruby/mruby/pull/6290">#6290</a> Allow to change the output directory name of the <code class="language-plaintext highlighter-rouge">libmruby</code> file</li> <li><a href="https://github.com/mruby/mruby/pull/6293">#6293</a> Changed the instruction table in <code class="language-plaintext highlighter-rouge">opcode.md</code></li> <li><a href="https://github.com/mruby/mruby/pull/6294">#6294</a> Optimise <code class="language-plaintext highlighter-rouge">mrb_iv_get</code></li> <li><a href="https://github.com/mruby/mruby/pull/6302">#6302</a> Minor cleanup in mrb_str_init</li> <li><a href="https://github.com/mruby/mruby/pull/6303">#6303</a> mrb_str_aset_m() should return replace instead of str</li> <li><a href="https://github.com/mruby/mruby/pull/6305">#6305</a> Protect keyword arguments in <code class="language-plaintext highlighter-rouge">prepare_missing()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6308">#6308</a> Assume that <code class="language-plaintext highlighter-rouge">MRB_CATCH()</code> has <code class="language-plaintext highlighter-rouge">mrb-&gt;exc</code> set</li> <li><a href="https://github.com/mruby/mruby/pull/6310">#6310</a> Doubling the call stack when extending it</li> <li><a href="https://github.com/mruby/mruby/pull/6311">#6311</a> Added fast-path for positional arguments less than 15 in <code class="language-plaintext highlighter-rouge">OP_SEND</code></li> <li><a href="https://github.com/mruby/mruby/pull/6312">#6312</a> Omit error checking at <code class="language-plaintext highlighter-rouge">OP_RETURN</code>, <code class="language-plaintext highlighter-rouge">OP_RETURN_BLK</code> and <code class="language-plaintext highlighter-rouge">OP_BREAK</code></li> <li><a href="https://github.com/mruby/mruby/pull/6313">#6313</a> Fix wrong column number in opcode.md</li> <li><a href="https://github.com/mruby/mruby/pull/6314">#6314</a> Optimize even?/odd? for big integers</li> <li><a href="https://github.com/mruby/mruby/pull/6318">#6318</a> Shrink variables in <code class="language-plaintext highlighter-rouge">mrb_vm_exec()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6320">#6320</a> Shrinking the code in <code class="language-plaintext highlighter-rouge">OP_BREAK</code> and <code class="language-plaintext highlighter-rouge">OP_RETURN_BLK</code></li> <li><a href="https://github.com/mruby/mruby/pull/6321">#6321</a> Avoid warnings in <code class="language-plaintext highlighter-rouge">lib/**/*.rb</code></li> <li><a href="https://github.com/mruby/mruby/pull/6322">#6322</a> Fix mrb_ro_data_p on Intel Mac</li> <li><a href="https://github.com/mruby/mruby/pull/6324">#6324</a> Remove <code class="language-plaintext highlighter-rouge">localjump_error()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6327">#6327</a> fix ncurses linking issues</li> <li><a href="https://github.com/mruby/mruby/pull/6328">#6328</a> Fix use-after-free in <code class="language-plaintext highlighter-rouge">obj_free()</code> for env objects</li> <li><a href="https://github.com/mruby/mruby/pull/6329">#6329</a> Fix use-after-free in <code class="language-plaintext highlighter-rouge">mrb_obj_alloc()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6330">#6330</a> Add a precondition to call <code class="language-plaintext highlighter-rouge">mrb_env_unshare()</code>.</li> <li><a href="https://github.com/mruby/mruby/pull/6331">#6331</a> Restore the GC arena with tests</li> <li><a href="https://github.com/mruby/mruby/pull/6332">#6332</a> Must not depend on the “host” build to generate <code class="language-plaintext highlighter-rouge">mruby-compiler/core/y.tab.c</code></li> <li><a href="https://github.com/mruby/mruby/pull/6333">#6333</a> Reduce the number of branch instructions in the <code class="language-plaintext highlighter-rouge">heap_p()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6335">#6335</a> Add <code class="language-plaintext highlighter-rouge">return_ci</code> in <code class="language-plaintext highlighter-rouge">CHECKPOINT_MAIN()</code> of <code class="language-plaintext highlighter-rouge">OP_RETURN</code></li> <li><a href="https://github.com/mruby/mruby/pull/6338">#6338</a> Need to place static proc objects into 8-byte alignments</li> <li><a href="https://github.com/mruby/mruby/pull/6340">#6340</a> Fix use-after-free for <code class="language-plaintext highlighter-rouge">Array#&lt;=&gt;</code></li> <li><a href="https://github.com/mruby/mruby/pull/6341">#6341</a> Need to restore the GC arena after some function calls</li> <li><a href="https://github.com/mruby/mruby/pull/6344">#6344</a> prefer using <code class="language-plaintext highlighter-rouge">mrb_yield</code> to call block arguments</li> <li><a href="https://github.com/mruby/mruby/pull/6347">#6347</a> codegen.c,parse.y: remove flattening of <code class="language-plaintext highlighter-rouge">yield</code> arguments; fix #6346</li> <li><a href="https://github.com/mruby/mruby/pull/6348">#6348</a> Cancel the warning disablement</li> <li><a href="https://github.com/mruby/mruby/pull/6349">#6349</a> Perform GC before deleting directories</li> <li><a href="https://github.com/mruby/mruby/pull/6350">#6350</a> Fixed character encoding conversion function mismatch</li> <li><a href="https://github.com/mruby/mruby/pull/6351">#6351</a> Remove unnecessary <code class="language-plaintext highlighter-rouge">mrb_gc_arena_restore()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6353">#6353</a> Fix use-after-free in <code class="language-plaintext highlighter-rouge">mrb_ary_delete()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6356">#6356</a> Making splat argument objects invisible from Ruby side</li> <li><a href="https://github.com/mruby/mruby/pull/6373">#6373</a> Add build config for Milk-V Duo (RISC-V Linux) board</li> <li><a href="https://github.com/mruby/mruby/pull/6382">#6382</a> Make array objects invisible in <code class="language-plaintext highlighter-rouge">mrb_gc_register()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6385">#6385</a> Small improvements for <code class="language-plaintext highlighter-rouge">mrb_gc_register()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6386">#6386</a> Avoid calling <code class="language-plaintext highlighter-rouge">mrb_gv_set()</code> from <code class="language-plaintext highlighter-rouge">mrb_gc_unregister()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6387">#6387</a> Small improvements for <code class="language-plaintext highlighter-rouge">mrb_gc_unregister()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6390">#6390</a> Fix use-after-free by <code class="language-plaintext highlighter-rouge">mrb_gc_unregistor()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6391">#6391</a> Fixed argument forwarding in <code class="language-plaintext highlighter-rouge">instance_exec</code></li> <li><a href="https://github.com/mruby/mruby/pull/6392">#6392</a> Fix argument forwarding in <code class="language-plaintext highlighter-rouge">mrb_exec_irep()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6393">#6393</a> Follow-up to #6391</li> <li><a href="https://github.com/mruby/mruby/pull/6395">#6395</a> Storing method-id inside Symbol#to_proc</li> <li><a href="https://github.com/mruby/mruby/pull/6396">#6396</a> Milk-V Build Config: update GPIO gem URL</li> <li><a href="https://github.com/mruby/mruby/pull/6397">#6397</a> boxing_no.h: rename BOXNIX_SET_VALUE -&gt; BOXNO_SET_VALUE</li> <li><a href="https://github.com/mruby/mruby/pull/6399">#6399</a> Add macOS 15 to the build</li> <li><a href="https://github.com/mruby/mruby/pull/6405">#6405</a> <code class="language-plaintext highlighter-rouge">io_read</code>: use <code class="language-plaintext highlighter-rouge">%i</code> instead of <code class="language-plaintext highlighter-rouge">%d</code> in call to <code class="language-plaintext highlighter-rouge">mrb_raisef</code></li> <li><a href="https://github.com/mruby/mruby/pull/6407">#6407</a> Allow to exclude specific files in <code class="language-plaintext highlighter-rouge">rake install</code></li> <li><a href="https://github.com/mruby/mruby/pull/6408">#6408</a> Improve compliance with C++ standards</li> <li><a href="https://github.com/mruby/mruby/pull/6410">#6410</a> Put <code class="language-plaintext highlighter-rouge">#include &lt;stdlib.h&gt;</code> in <code class="language-plaintext highlighter-rouge">parse.y</code></li> <li><a href="https://github.com/mruby/mruby/pull/6412">#6412</a> Distinguish the call frame of the generator with <code class="language-plaintext highlighter-rouge">OP_RETURN_BLK</code></li> <li><a href="https://github.com/mruby/mruby/pull/6413">#6413</a> Add links to documentation in <code class="language-plaintext highlighter-rouge">README.md</code></li> <li><a href="https://github.com/mruby/mruby/pull/6415">#6415</a> Fix numbered parameters when used as a singleton</li> <li><a href="https://github.com/mruby/mruby/pull/6416">#6416</a> Optimize the “new” method’s iseq</li> <li><a href="https://github.com/mruby/mruby/pull/6419">#6419</a> Follow Ruby’s behavior for numbered parameters in -&gt; {}</li> <li><a href="https://github.com/mruby/mruby/pull/6420">#6420</a> Update <code class="language-plaintext highlighter-rouge">labeler.yml</code>: add label for the <code class="language-plaintext highlighter-rouge">tools</code> directory</li> <li><a href="https://github.com/mruby/mruby/pull/6422">#6422</a> Add annotations for function names defined in the preprocessor</li> <li><a href="https://github.com/mruby/mruby/pull/6423">#6423</a> Adding a serialized test task</li> <li><a href="https://github.com/mruby/mruby/pull/6427">#6427</a> Need to update <code class="language-plaintext highlighter-rouge">ci</code> variable after re-entry to VM</li> <li><a href="https://github.com/mruby/mruby/pull/6428">#6428</a> Change the limits of OP_ADDI and OP_SUBI from 0-127 to 0-255.</li> <li><a href="https://github.com/mruby/mruby/pull/6429">#6429</a> Fix numbered parameters when used as hash keys</li> <li><a href="https://github.com/mruby/mruby/pull/6432">#6432</a> Moving code in macro arguments out of macros</li> <li><a href="https://github.com/mruby/mruby/pull/6434">#6434</a> Added document “Layout of the mruby filesystem”</li> <li><a href="https://github.com/mruby/mruby/pull/6436">#6436</a> Make <code class="language-plaintext highlighter-rouge">rake doc:update-index</code> prettier friendly</li> <li><a href="https://github.com/mruby/mruby/pull/6437">#6437</a> Add more details to the pre-commit config</li> <li><a href="https://github.com/mruby/mruby/pull/6438">#6438</a> Remove unused <code class="language-plaintext highlighter-rouge">MRuby::Build#list_install_excludes</code> method</li> <li><a href="https://github.com/mruby/mruby/pull/6440">#6440</a> Fix <code class="language-plaintext highlighter-rouge">redo</code> keyword</li> <li><a href="https://github.com/mruby/mruby/pull/6442">#6442</a> Fixed wrong range condition in <code class="language-plaintext highlighter-rouge">OP_JMPUW</code></li> <li><a href="https://github.com/mruby/mruby/pull/6443">#6443</a> Fix NODE_NEGATE for bigints</li> <li><a href="https://github.com/mruby/mruby/pull/6444">#6444</a> Add test cases for bigints</li> <li><a href="https://github.com/mruby/mruby/pull/6446">#6446</a> Omit the <code class="language-plaintext highlighter-rouge">_WIN64</code> definition check</li> <li><a href="https://github.com/mruby/mruby/pull/6447">#6447</a> Fixed <code class="language-plaintext highlighter-rouge">File.expand_path</code></li> <li><a href="https://github.com/mruby/mruby/pull/6448">#6448</a> Suppress presym in <code class="language-plaintext highlighter-rouge">mruby/ext/io.h</code> file</li> <li><a href="https://github.com/mruby/mruby/pull/6449">#6449</a> Using presym in the <code class="language-plaintext highlighter-rouge">mruby-io/src/file_test.c</code> file</li> <li><a href="https://github.com/mruby/mruby/pull/6450">#6450</a> Change <code class="language-plaintext highlighter-rouge">MRB_WITH_IO_PREAD_PWRITE</code> configuration name</li> <li><a href="https://github.com/mruby/mruby/pull/6454">#6454</a> mruby-bigint: handle rhs bigint in int_mod and int_divmod functions</li> <li><a href="https://github.com/mruby/mruby/pull/6455">#6455</a> mruby-bigint: fix rounding behavior in mpz_mdiv and mpz_mdivmod functions</li> <li><a href="https://github.com/mruby/mruby/pull/6457">#6457</a> bigint: fix bug with division of a small number by a bigint</li> <li><a href="https://github.com/mruby/mruby/pull/6459">#6459</a> <code class="language-plaintext highlighter-rouge">FileTest</code> is a module</li> <li><a href="https://github.com/mruby/mruby/pull/6461">#6461</a> To create a release package file in draft</li> <li><a href="https://github.com/mruby/mruby/pull/6462">#6462</a> Properly cast the return value of <code class="language-plaintext highlighter-rouge">memchr()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6463">#6463</a> Add <code class="language-plaintext highlighter-rouge">level</code> argument to <code class="language-plaintext highlighter-rouge">File.dirname</code></li> <li><a href="https://github.com/mruby/mruby/pull/6465">#6465</a> Add initial playstation portable crossbuild support</li> <li><a href="https://github.com/mruby/mruby/pull/6468">#6468</a> Fixed missing changes to <code class="language-plaintext highlighter-rouge">IB_FIND_BY_KEY()</code> parameter names</li> <li><a href="https://github.com/mruby/mruby/pull/6469">#6469</a> Add more <code class="language-plaintext highlighter-rouge">const</code> qualifier for <code class="language-plaintext highlighter-rouge">RProc</code></li> <li><a href="https://github.com/mruby/mruby/pull/6472">#6472</a> Moved tests for <code class="language-plaintext highlighter-rouge">Integer#quo</code></li> <li><a href="https://github.com/mruby/mruby/pull/6473">#6473</a> Hide <code class="language-plaintext highlighter-rouge">mpz_and()</code> symbol</li> <li><a href="https://github.com/mruby/mruby/pull/6473">#6473</a> Hide mpz_and() symbol</li> <li><a href="https://github.com/mruby/mruby/pull/6474">#6474</a> Avoid array object creation with “unknown keyword” error</li> <li><a href="https://github.com/mruby/mruby/pull/6475">#6475</a> Don’t include deleted mruby-print</li> <li><a href="https://github.com/mruby/mruby/pull/6478">#6478</a> Fixed buffer overrun in function <code class="language-plaintext highlighter-rouge">chars2bytes()</code></li> <li><a href="https://github.com/mruby/mruby/pull/6479">#6479</a> Reimplementation of <code class="language-plaintext highlighter-rouge">File.expand_path</code> method</li> <li><a href="https://github.com/mruby/mruby/pull/6482">#6482</a> Add <code class="language-plaintext highlighter-rouge">File.absolute_path?</code> method</li> <li><a href="https://github.com/mruby/mruby/pull/6487">#6487</a> Add Emscripten toolchain &amp; build_config</li> </ul> <hr /> <p>We have done 1,188 commits to 354 files with 20,650 additions and 21,537 deletions since mruby 3.3.0. For more detail of the updates, <a href="https://github.com/mruby/mruby/compare/3.3.0...3.4.0">see Commit Log</a>.</p> <p>Thanks to all the contributors who have worked on bug fixes and improvements in the release of <code class="language-plaintext highlighter-rouge">mruby 3.4.0</code>.</p> Sun, 20 Apr 2025 00:00:00 +0000 https://mruby.org/releases/2025/04/20/mruby-3.4.0-released.html https://mruby.org/releases/2025/04/20/mruby-3.4.0-released.html releases mruby 3.3.0 released <h1 id="mruby-330">mruby 3.3.0</h1> <p>We are announcing the first stable release of mruby 3.3 series - <a href="https://github.com/mruby/mruby/releases/tag/3.3.0">mruby 3.3.0</a>.</p> <p>Describes the new features and changes in mruby 3.3.<br /> The main changes in mruby 3.3 are also described in <a href="https://github.com/mruby/mruby/blob/master/doc/mruby3.3.md">doc/mruby3.3.md</a>.</p> <hr /> <h1 id="user-visible-changes-in-mruby33-from-mruby32">User visible changes in <code class="language-plaintext highlighter-rouge">mruby3.3</code> from <code class="language-plaintext highlighter-rouge">mruby3.2</code></h1> <p>“<strong><em>NOTE</em></strong>:” are changes to be aware of.</p> <h1 id="the-language">The language</h1> <ul> <li>aliases work properly with <code class="language-plaintext highlighter-rouge">super</code> (<a href="https://github.com/mruby/mruby/commit/2ad3f0e">2ad3f0e</a>)</li> <li><code class="language-plaintext highlighter-rouge">callee</code> method work differently with aliases in mruby (<a href="https://github.com/mruby/mruby/commit/f2dc76e">f2dc76e</a>)</li> <li>define <code class="language-plaintext highlighter-rouge">Kernel#respond_to_missing?</code> method (<a href="https://github.com/mruby/mruby/commit/347586e">347586e</a>)</li> <li><code class="language-plaintext highlighter-rouge">_inspect</code> method (<code class="language-plaintext highlighter-rouge">inspect</code> with recursive check) is removed (<a href="https://github.com/mruby/mruby/commit/e2bbf75">e2bbf75</a>, <a href="https://github.com/mruby/mruby/commit/5cb0c74">5cb0c74</a>, <a href="https://github.com/mruby/mruby/commit/113565a">113565a</a>, <a href="https://github.com/mruby/mruby/commit/0713f2a">0713f2a</a>, <a href="https://github.com/mruby/mruby/commit/6ae6b63">6ae6b63</a>, <a href="https://github.com/mruby/mruby/commit/fc9fffc">fc9fffc</a>)</li> <li><code class="language-plaintext highlighter-rouge">__printstr__</code> method is removed; use <code class="language-plaintext highlighter-rouge">print</code> instead (<a href="https://github.com/mruby/mruby/commit/acecee0">acecee0</a>, <a href="https://github.com/mruby/mruby/commit/192e6e3">192e6e3</a>)</li> <li>New method <code class="language-plaintext highlighter-rouge">String#bytesplice</code> (<a href="https://github.com/mruby/mruby/commit/5274647">5274647</a>, <a href="https://github.com/mruby/mruby/commit/a2e2e83">a2e2e83</a>)</li> <li>Allow <code class="language-plaintext highlighter-rouge">return</code> in blocks to cross C boundaries (<a href="https://github.com/mruby/mruby/pull/6125">#6125</a>)</li> </ul> <h1 id="configuration">Configuration</h1> <ul> <li>mruby can be built using Docker now. Try <code class="language-plaintext highlighter-rouge">docker-compose build</code> for example. (<a href="https://github.com/mruby/mruby/pull/5961">#5961</a>)</li> <li>New Platform: DJGPP (MS-DOS) (<a href="https://github.com/mruby/mruby/pull/6022">#6022</a>)</li> <li>New Platform: Nintendo Wii (<a href="https://github.com/mruby/mruby/pull/6086">#6086</a>)</li> <li>Improved Platform: Android (<a href="https://github.com/mruby/mruby/pull/6013">#6013</a>)</li> <li>Improved Platform: Dreamcast (<a href="https://github.com/mruby/mruby/pull/6130">#6130</a>)</li> <li>Allow tests to be disabled for specific gems; warn about disabled tests (<a href="https://github.com/mruby/mruby/pull/6012">#6012</a>)</li> <li>Replace <code class="language-plaintext highlighter-rouge">MRB_NO_DIRECT_THREADING</code> with <code class="language-plaintext highlighter-rouge">MRB_USE_VM_SWITCH_DISPATCH</code> (<a href="https://github.com/mruby/mruby/pull/5902">#5902</a>)</li> </ul> <h1 id="mruby-memory-api">mruby memory API</h1> <ul> <li><code class="language-plaintext highlighter-rouge">mrb_default_allocf</code> can be overridden by the application (<a href="https://github.com/mruby/mruby/commit/34c5d96">34c5d96</a>)</li> <li><code class="language-plaintext highlighter-rouge">mrb_open_allocf</code> will be deprecated (<a href="https://github.com/mruby/mruby/commit/cfee5c2">cfee5c2</a>)</li> </ul> <h1 id="changes-in-c-api">Changes in C API</h1> <ul> <li>add new error handling API functions (<a href="https://github.com/mruby/mruby/commit/8c8bbd9">8c8bbd9</a>)</li> <li>Add <code class="language-plaintext highlighter-rouge">mrb_vm_ci_env_clear()</code> function with <code class="language-plaintext highlighter-rouge">MRB_API</code> (<a href="https://github.com/mruby/mruby/pull/5945">#5945</a>)</li> <li>a new function <code class="language-plaintext highlighter-rouge">mrb_check_frozen_value()</code> (<a href="https://github.com/mruby/mruby/commit/ccdf75c">ccdf75c</a>)</li> <li>avoid formatting in <code class="language-plaintext highlighter-rouge">mrb_bug()</code> (<a href="https://github.com/mruby/mruby/commit/82a48bd">82a48bd</a>) <br /> <strong><em>NOTE</em></strong>: If you are using it, you must give a simple string or replace it with a call to <code class="language-plaintext highlighter-rouge">mrb_raise()</code> series.</li> <li>stop using <code class="language-plaintext highlighter-rouge">mrbc_</code> prefix for compiler context (<a href="https://github.com/mruby/mruby/commit/c5e3cbe">c5e3cbe</a>) <br /> The same names are provided as before, but we recommend replacing them.</li> <li>Allow <code class="language-plaintext highlighter-rouge">Class#allocate</code> to be prohibited (<a href="https://github.com/mruby/mruby/pull/5979">#5979</a>, <a href="https://github.com/mruby/mruby/pull/6122">#6122</a>, <a href="https://github.com/mruby/mruby/pull/6123">#6123</a>) <br /> To disable <code class="language-plaintext highlighter-rouge">#allocate</code>, use <code class="language-plaintext highlighter-rouge">MRB_UNDEF_ALLOCATOR()</code>. This is also automatically applied when the subclass is created, but to explicitly allow it, use <code class="language-plaintext highlighter-rouge">MRB_DEFINE_ALLOCATOR()</code>.</li> </ul> <h1 id="changes-in-mrbgems">Changes in mrbgems</h1> <ul> <li><strong>default.gembox</strong>: Add mruby debugger mrdb (<code class="language-plaintext highlighter-rouge">mruby-bin-debugger</code>) (<a href="https://github.com/mruby/mruby/pull/5966">#5966</a>)</li> <li><strong>mruby-bin-config</strong>: new options <code class="language-plaintext highlighter-rouge">--cxx</code>, <code class="language-plaintext highlighter-rouge">--cxxflags</code>, <code class="language-plaintext highlighter-rouge">--as</code>, <code class="language-plaintext highlighter-rouge">--asflags</code>, <code class="language-plaintext highlighter-rouge">--objc</code>, <code class="language-plaintext highlighter-rouge">--objcflags</code> (<a href="https://github.com/mruby/mruby/pull/6054">#6054</a>)</li> <li><strong>mruby-binding</strong>: renamed from <code class="language-plaintext highlighter-rouge">mruby-binding-core</code> of mruby3.2 (<a href="https://github.com/mruby/mruby/commit/11af5db">11af5db</a>) <br /> <strong><em>NOTE</em></strong>: If using <code class="language-plaintext highlighter-rouge">mruby-binding-core</code> of mruby 3.2, replace it with <code class="language-plaintext highlighter-rouge">mruby-binding</code>.</li> <li><strong>mruby-binding</strong>: implemented <code class="language-plaintext highlighter-rouge">Binding#initialize_copy</code> method (<a href="https://github.com/mruby/mruby/pull/5517">#5517</a>)</li> <li><strong>mruby-binding</strong>: <code class="language-plaintext highlighter-rouge">Kernel#binding</code> responds only to calls from Ruby (<a href="https://github.com/mruby/mruby/pull/5981">#5981</a>)</li> <li><strong>mruby-compar-ext</strong>: Comparable#clamp to accept nil as arguments (<a href="https://github.com/mruby/mruby/commit/836bebc">836bebc</a>)</li> <li><strong>mruby-compiler</strong>: add print name for identifier tokens (<a href="https://github.com/mruby/mruby/commit/d7b2e3a">d7b2e3a</a>)</li> <li><strong>mruby-data</strong>: allow empty Data (<a href="https://github.com/mruby/mruby/commit/927a9df">927a9df</a>)</li> <li><strong>mruby-enumerator</strong>: remove internal attribute methods <code class="language-plaintext highlighter-rouge">obj</code>, <code class="language-plaintext highlighter-rouge">args</code>, <code class="language-plaintext highlighter-rouge">kwd</code>, <code class="language-plaintext highlighter-rouge">meth</code>, <code class="language-plaintext highlighter-rouge">fib</code>. (<a href="https://github.com/mruby/mruby/commit/735fa24">735fa24</a>)</li> <li><strong>mruby-enumerator</strong>: add Enumerator#size (<a href="https://github.com/mruby/mruby/commit/861f8bd">861f8bd</a>)</li> <li><strong>mruby-eval</strong>: merged <code class="language-plaintext highlighter-rouge">mruby-binding</code> of mruby3.2 (<a href="https://github.com/mruby/mruby/commit/501b22a">501b22a</a>, <a href="https://github.com/mruby/mruby/pull/5989">#5989</a>) <br /> <strong><em>NOTE</em></strong>: If using <code class="language-plaintext highlighter-rouge">mruby-binding</code> of mruby 3.2, replace it with <code class="language-plaintext highlighter-rouge">mruby-eval</code>.</li> <li><strong>mruby-fiber</strong>: Add a new <code class="language-plaintext highlighter-rouge">mrb_fiber_new()</code> with <code class="language-plaintext highlighter-rouge">MRB_API</code> (<a href="https://github.com/mruby/mruby/pull/6097">#6097</a>)</li> <li><strong>mruby-fiber</strong>: Allows calling <code class="language-plaintext highlighter-rouge">Fiber#resume</code> from C (<a href="https://github.com/mruby/mruby/pull/6106">#6106</a>)</li> <li><strong>mruby-fiber</strong>: <code class="language-plaintext highlighter-rouge">Fiber#to_s</code> format changed (<a href="https://github.com/mruby/mruby/pull/6105">#6105</a>)</li> <li><strong>mruby-io</strong>: add File#atime and File#ctime (<a href="https://github.com/mruby/mruby/commit/321cfe9">321cfe9</a>)</li> <li><strong>mruby-io</strong>: Add “x” mode option for <code class="language-plaintext highlighter-rouge">IO.open</code> (<a href="https://github.com/mruby/mruby/pull/6081">#6081</a>)</li> <li><strong>mruby-io</strong>: File.new should not take blocks (<a href="https://github.com/mruby/mruby/commit/53de964">53de964</a>)</li> <li><strong>mruby-method</strong>: <code class="language-plaintext highlighter-rouge">Method#to_s</code> format changed (<a href="https://github.com/mruby/mruby/commit/f5bc82f">f5bc82f</a>, <a href="https://github.com/mruby/mruby/commit/02f189c">02f189c</a>)</li> <li><strong>mruby-numeric-ext</strong>: <code class="language-plaintext highlighter-rouge">int.pow(n,m)</code> to take bigint as exponential (<a href="https://github.com/mruby/mruby/commit/d482eab">d482eab</a>)</li> <li><strong>mruby-pack</strong>: support new directives <code class="language-plaintext highlighter-rouge">j</code>, <code class="language-plaintext highlighter-rouge">J</code>, <code class="language-plaintext highlighter-rouge">b</code>, <code class="language-plaintext highlighter-rouge">B</code>, <code class="language-plaintext highlighter-rouge">#</code> (<a href="https://github.com/mruby/mruby/commit/2a1e3a5">2a1e3a5</a>, <a href="https://github.com/mruby/mruby/commit/e7021f1">e7021f1</a>, <a href="https://github.com/mruby/mruby/commit/e17f325">e17f325</a>)</li> <li><strong>mruby-range-ext</strong>: new method <code class="language-plaintext highlighter-rouge">Range#overlap?</code> (<a href="https://github.com/mruby/mruby/commit/384d0e2">384d0e2</a>)</li> <li><strong>mruby-string-ext</strong>: Add <code class="language-plaintext highlighter-rouge">String#valid_encoding?</code> method (<a href="https://github.com/mruby/mruby/commit/eabe2d9">eabe2d9</a>)</li> <li><strong>mruby-struct</strong>: allow empty Struct when a name is not given (<a href="https://github.com/mruby/mruby/commit/c212ede">c212ede</a>)</li> <li><strong>mruby-time</strong>: should allow year before 1900 (<a href="https://github.com/mruby/mruby/commit/e5de08b">e5de08b</a>)</li> <li><strong>mruby-time</strong>: support bigint to time_t if necessary (<a href="https://github.com/mruby/mruby/commit/7096d27">7096d27</a>)</li> <li><strong>mruby-time</strong>: need to handle negative time_t (<a href="https://github.com/mruby/mruby/commit/b064d7e">b064d7e</a>)</li> </ul> <h1 id="changes-in-build-system">Changes in build system</h1> <ul> <li>Extended <code class="language-plaintext highlighter-rouge">rake install</code> task (<a href="https://github.com/mruby/mruby/pull/5928">#5928</a>) <br /> <strong><em>NOTE</em></strong>: Due to this impact, executable files in the <code class="language-plaintext highlighter-rouge">mruby/bin/</code> directory by default are now symbolic links (batch files on Windows). If previously relied on those executables, should be replaced with direct references to the entity created under the build directory (e.g. <code class="language-plaintext highlighter-rouge">mruby/build/host/bin/</code>).</li> <li>Encode and decode escape characters for presym (<a href="https://github.com/mruby/mruby/pull/6011">#6011</a>)</li> <li>Rakefile: remove default build target directories in <code class="language-plaintext highlighter-rouge">deep_clean</code> (<a href="https://github.com/mruby/mruby/pull/6032">#6032</a>, <a href="https://github.com/mruby/mruby/commit/1e38569">1e38569</a>)</li> </ul> <h1 id="other-breaking-changes">Other breaking changes</h1> <ul> <li><code class="language-plaintext highlighter-rouge">mrb_f_raise()</code> is now an internal function (<a href="https://github.com/mruby/mruby/pull/5923">#5923</a>, <a href="https://github.com/mruby/mruby/pull/6070">#6070</a>)</li> <li><code class="language-plaintext highlighter-rouge">mrb_make_exception()</code> is now an internal function with different parameters (<a href="https://github.com/mruby/mruby/commit/431f83e">431f83e</a>, <a href="https://github.com/mruby/mruby/commit/78137f3">78137f3</a>)</li> <li>The <code class="language-plaintext highlighter-rouge">File#path</code> method no longer uses the <code class="language-plaintext highlighter-rouge">#to_path</code> method for implicit conversion (<a href="https://github.com/mruby/mruby/commit/d86c4a7">d86c4a7</a>)</li> <li>stop mrb isolation for each test file (<a href="https://github.com/mruby/mruby/commit/a20fbe5">a20fbe5</a>)</li> <li>RBreak remembers the CI location (<a href="https://github.com/mruby/mruby/pull/6103">#6103</a>)</li> </ul> <h1 id="bugs-fixed">Bugs Fixed</h1> <ul> <li><a href="https://github.com/mruby/mruby/issues/5724">#5724</a> Rational#** is missing</li> <li><a href="https://github.com/mruby/mruby/issues/5725">#5725</a> weird const_missing exceptions in mrblib code</li> <li><a href="https://github.com/mruby/mruby/issues/5789">#5789</a> No memory release of backtrace information due to stack error</li> <li><a href="https://github.com/mruby/mruby/issues/5932">#5932</a> How to create a block using the C API? mrb_yield keeps crashing!</li> <li><a href="https://github.com/mruby/mruby/issues/5943">#5943</a> TCPSocket#write is failed</li> <li><a href="https://github.com/mruby/mruby/issues/5944">#5944</a> Behavior of calling method with a hash variable</li> <li><a href="https://github.com/mruby/mruby/pull/5946">#5946</a> Don’t switch constant search path from modules to Object</li> <li><a href="https://github.com/mruby/mruby/issues/5949">#5949</a> Caller appears to report wrong line when block passed and brackets omitted</li> <li><a href="https://github.com/mruby/mruby/commit/0906cd7">0906cd7</a> numeric.c: fix rounding function issues with big numbers</li> <li><a href="https://github.com/mruby/mruby/issues/5974">#5974</a> Invalid escape sequences in gem_init.c on windows</li> <li><a href="https://github.com/mruby/mruby/issues/5975">#5975</a> Equals comparison fails on extreme ends of 64-bit integers</li> <li><a href="https://github.com/mruby/mruby/issues/5985">#5985</a> Sign extension with OP_LOADI32 in get_int_operand()</li> <li><a href="https://github.com/mruby/mruby/issues/5986">#5986</a> Fix bugs in String#bytesplice</li> <li><a href="https://github.com/mruby/mruby/issues/5987">#5987</a> ~(-1 « 64) is incorrect</li> <li><a href="https://github.com/mruby/mruby/issues/5991">#5991</a> ‘gets’ method not working in mruby-3.2.0</li> <li><a href="https://github.com/mruby/mruby/pull/5994">#5994</a> fix typo in mrbgems/mruby-io/src/io.c</li> <li><a href="https://github.com/mruby/mruby/issues/5995">#5995</a> One seemingly unnecessary parameter is passed in the block parameters</li> <li><a href="https://github.com/mruby/mruby/pull/6008">#6008</a> Make “bintest” independent of directory</li> <li><a href="https://github.com/mruby/mruby/commit/b47c8b7">b47c8b7</a> gc.c (clear_all_old): fix a generational GC bug</li> <li><a href="https://github.com/mruby/mruby/issues/6029">#6029</a> mruby build fails under mrbgems directory</li> <li><a href="https://github.com/mruby/mruby/commit/a264965">a264965</a> mruby-os-memsize/memsize.c: fix irep size calculation</li> <li><a href="https://github.com/mruby/mruby/commit/3310e10">3310e10</a> mruby-test/mrbgem.rake: fix mrb_state handling bug</li> <li><a href="https://github.com/mruby/mruby/issues/6041">#6041</a> GC Performance may have degraded</li> <li><a href="https://github.com/mruby/mruby/issues/6044">#6044</a> Generated presym/table.h contains invalid characters</li> <li><a href="https://github.com/mruby/mruby/issues/6051">#6051</a> Null pointer dereference in mrb_addrinfo_unix_path</li> <li><a href="https://github.com/mruby/mruby/issues/6052">#6052</a> Null pointer dereference while handling the Proc class</li> <li><a href="https://github.com/mruby/mruby/pull/6055">#6055</a> Fix libmruby name for VisualC++</li> <li><a href="https://github.com/mruby/mruby/issues/6060">#6060</a> SEGFAULT Issue Related to Fiber Usage in ngx_mruby Development</li> <li><a href="https://github.com/mruby/mruby/issues/6061">#6061</a> Performance issue in String#codepoints</li> <li><a href="https://github.com/mruby/mruby/issues/6064">#6064</a> MRUBY_PACKAGE_DIR does not always have a value.</li> <li><a href="https://github.com/mruby/mruby/issues/6065">#6065</a> Null pointer dereference while handling the Proc class</li> <li><a href="https://github.com/mruby/mruby/issues/6066">#6066</a> Null pointer dereference involving Struct.new()</li> <li><a href="https://github.com/mruby/mruby/issues/6067">#6067</a> Null pointer dereference in mrb_string_value_cstr</li> <li><a href="https://github.com/mruby/mruby/issues/6068">#6068</a> Stack overflow in mrb_vm_exec</li> <li><a href="https://github.com/mruby/mruby/pull/6076">#6076</a> Fixed unwinding block that could point to invalid PC</li> <li><a href="https://github.com/mruby/mruby/issues/6084">#6084</a> Incorrect symbolic sinks in binary built on Linux</li> <li><a href="https://github.com/mruby/mruby/issues/6087">#6087</a> ‘Remote branch HEAD not found in upstream origin’ error on build</li> <li><a href="https://github.com/mruby/mruby/issues/6089">#6089</a> binding.eval() handles def expressions differently from CRuby</li> <li><a href="https://github.com/mruby/mruby/issues/6098">#6098</a> Fails to call superclass of wrapped method</li> <li><a href="https://github.com/mruby/mruby/issues/6099">#6099</a> <code class="language-plaintext highlighter-rouge">ensure</code> section is not executed if the function exits via a return in a proc</li> <li><a href="https://github.com/mruby/mruby/issues/6108">#6108</a> VM crashes with break</li> <li><a href="https://github.com/mruby/mruby/pull/6118">#6118</a> Fixed IO#read with buf</li> <li><a href="https://github.com/mruby/mruby/pull/6120">#6120</a> Set EBADF if check_file_descriptor() fails</li> <li><a href="https://github.com/mruby/mruby/pull/6126">#6126</a> Fixed return value of <code class="language-plaintext highlighter-rouge">OP_RETURN_BLK</code> called directly under C function</li> <li><a href="https://github.com/mruby/mruby/issues/6134">#6134</a> String#unpack1 returns an array instead of a single string</li> <li><a href="https://github.com/mruby/mruby/pull/6136">#6136</a> Fixed when combined <code class="language-plaintext highlighter-rouge">mrb_fiber_resume()</code> and <code class="language-plaintext highlighter-rouge">Fiber#transfer</code></li> </ul> <h1 id="pull-requests-user-visible-ones">Pull Requests (User Visible Ones)</h1> <ul> <li><a href="https://github.com/mruby/mruby/pull/5517">#5517</a> Fixed local variables not separated between copied binding objects</li> <li><a href="https://github.com/mruby/mruby/pull/5902">#5902</a> Replace <code class="language-plaintext highlighter-rouge">MRB_NO_DIRECT_THREADING</code> with <code class="language-plaintext highlighter-rouge">MRB_USE_VM_SWITCH_DISPATCH</code></li> <li><a href="https://github.com/mruby/mruby/pull/5923">#5923</a> Demotion <code class="language-plaintext highlighter-rouge">mrb_f_raise()</code> from <code class="language-plaintext highlighter-rouge">MRB_API</code></li> <li><a href="https://github.com/mruby/mruby/pull/5928">#5928</a> Improved <code class="language-plaintext highlighter-rouge">rake install</code></li> <li><a href="https://github.com/mruby/mruby/pull/5945">#5945</a> Avoid exposure for <code class="language-plaintext highlighter-rouge">REnv</code> objects</li> <li><a href="https://github.com/mruby/mruby/pull/5946">#5946</a> Don’t switch constant search path from modules to Object</li> <li><a href="https://github.com/mruby/mruby/pull/5966">#5966</a> Update default.gembox add mruby debugger mrdb</li> <li><a href="https://github.com/mruby/mruby/pull/5979">#5979</a> Allow Class#allocate to be prohibited</li> <li><a href="https://github.com/mruby/mruby/pull/5981">#5981</a> <code class="language-plaintext highlighter-rouge">Kernel#binding</code> responds only to calls from Ruby</li> <li><a href="https://github.com/mruby/mruby/pull/5989">#5989</a> Integrate mruby-binding-eval into mruby-eval</li> <li><a href="https://github.com/mruby/mruby/pull/5961">#5961</a> Add Docker to build and run all mruby tests. Run pre-commit and generate YARD docs with Docker</li> <li><a href="https://github.com/mruby/mruby/pull/5994">#5994</a> fix typo in mrbgems/mruby-io/src/io.c</li> <li><a href="https://github.com/mruby/mruby/pull/6008">#6008</a> Make “bintest” independent of directory</li> <li><a href="https://github.com/mruby/mruby/pull/6009">#6009</a> Avoid adding <MRUBY_ROOT>/bintest which does not exist</MRUBY_ROOT></li> <li><a href="https://github.com/mruby/mruby/pull/6011">#6011</a> Encode and decode escape characters for presym</li> <li><a href="https://github.com/mruby/mruby/pull/6012">#6012</a> Allow tests to be disabled for specific gems; warn about disabled tests</li> <li><a href="https://github.com/mruby/mruby/pull/6013">#6013</a> Fix Android toolchain</li> <li><a href="https://github.com/mruby/mruby/pull/6022">#6022</a> Build configuration for MS-DOS and DJGPP</li> <li><a href="https://github.com/mruby/mruby/pull/6032">#6032</a> Rake: update task clean to remove bin and build folders</li> <li><a href="https://github.com/mruby/mruby/pull/6045">#6045</a> Fixes escape sequence bug and enhancements in Presym scanning</li> <li><a href="https://github.com/mruby/mruby/pull/6054">#6054</a> Extends <code class="language-plaintext highlighter-rouge">bin/mruby-config</code></li> <li><a href="https://github.com/mruby/mruby/pull/6055">#6055</a> Fix libmruby name for VisualC++</li> <li><a href="https://github.com/mruby/mruby/pull/6070">#6070</a> Demotion mrb_f_raise() in kernel.c from MRB_API too</li> <li><a href="https://github.com/mruby/mruby/pull/6076">#6076</a> Fixed unwinding block that could point to invalid PC</li> <li><a href="https://github.com/mruby/mruby/pull/6081">#6081</a> Add “x” mode option for IO.open</li> <li><a href="https://github.com/mruby/mruby/pull/6086">#6086</a> Add build config for Nintendo Wii</li> <li><a href="https://github.com/mruby/mruby/pull/6097">#6097</a> Add a new mrb_fiber_new() with MRB_API</li> <li><a href="https://github.com/mruby/mruby/pull/6103">#6103</a> RBreak remembers the CI location</li> <li><a href="https://github.com/mruby/mruby/pull/6105">#6105</a> Implement <code class="language-plaintext highlighter-rouge">Fiber#to_s</code> method</li> <li><a href="https://github.com/mruby/mruby/pull/6106">#6106</a> Ease fiber limitations</li> <li><a href="https://github.com/mruby/mruby/pull/6118">#6118</a> Fixed IO#read with buf</li> <li><a href="https://github.com/mruby/mruby/pull/6120">#6120</a> Set EBADF if check_file_descriptor() fails</li> <li><a href="https://github.com/mruby/mruby/pull/6122">#6122</a> Prohibit <code class="language-plaintext highlighter-rouge">Class#allocate</code> in a different way</li> <li><a href="https://github.com/mruby/mruby/pull/6123">#6123</a> Inherit <code class="language-plaintext highlighter-rouge">MRB_FL_UNDEF_ALLOCATE</code> in subclasses</li> <li><a href="https://github.com/mruby/mruby/pull/6125">#6125</a> Allow <code class="language-plaintext highlighter-rouge">OP_RETURN_BLK</code> to cross C boundaries</li> <li><a href="https://github.com/mruby/mruby/pull/6126">#6126</a> Fixed return value of <code class="language-plaintext highlighter-rouge">OP_RETURN_BLK</code> called directly under C function</li> <li><a href="https://github.com/mruby/mruby/pull/6130">#6130</a> <code class="language-plaintext highlighter-rouge">dreamcast_shelf build config</code>: complete overhaul</li> <li><a href="https://github.com/mruby/mruby/pull/6136">#6136</a> Fixed when combined <code class="language-plaintext highlighter-rouge">mrb_fiber_resume()</code> and <code class="language-plaintext highlighter-rouge">Fiber#transfer</code></li> </ul> <hr /> <p>We have done 763 commits to 232 files with 8,871 additions and 5,978 deletions since mruby 3.2.0. For more detail of the updates, <a href="https://github.com/mruby/mruby/compare/3.2.0...3.3.0">see Commit Log</a>.</p> <p>Thanks to all the contributors who have worked on bug fixes and improvements in the release of <code class="language-plaintext highlighter-rouge">mruby 3.3.0</code>.</p> Wed, 14 Feb 2024 00:00:00 +0000 https://mruby.org/releases/2024/02/14/mruby-3.3.0-released.html https://mruby.org/releases/2024/02/14/mruby-3.3.0-released.html releases mruby, mruby/c Common I/O API Guidelines and Community-developed Libraries released <h1 id="common-io-api-guidelines-for-mruby-and-mrubyc">Common I/O API Guidelines for mruby and mruby/c</h1> <p>Common I/O API Guidelines for mruby and <a href="https://github.com/mrubyc/mrubyc">mruby/c</a> have been established and released.</p> <p>We have established the Common I/O API Guidelines(hereinafter referred to as “Guidelines”) for mruby and mruby/c. This initiative enhances the portability of programs across different microcontrollers (hereinafter referred to as “MCUs”) and improves the reusability of various sensors and I/O control libraries. When utilizing mruby and mruby/c in the future, we sincerely hope that you will refer to these Guidelines.</p> <p>Additionally, we would like to introduce libraries developed by enthusiastic contributors for MCUs that have been made available. If there are MCU libraries not listed below and you have created your own, we encourage you to inform us through the inquiry so that we can include it in our introductions.</p> <h1 id="mruby-mrubyc-common-io-api-guidelines">mruby, mruby/c Common I/O API Guidelines</h1> <p><a href="https://github.com/mruby/microcontroller-peripheral-interface-guide">https://github.com/mruby/microcontroller-peripheral-interface-guide</a></p> Tue, 19 Sep 2023 00:00:00 +0000 https://mruby.org/releases/2023/09/19/microcontroller-peripheral-interface-guide.html https://mruby.org/releases/2023/09/19/microcontroller-peripheral-interface-guide.html releases mruby 3.2.0 released <h1 id="mruby-320">mruby 3.2.0</h1> <p>We are announcing the first stable release of mruby 3.2 series - <a href="https://github.com/mruby/mruby/releases/tag/3.2.0">mruby 3.2.0</a>.</p> <p>Describes the new features and changes in mruby 3.2.<br /> The main changes in mruby 3.2 are also described in <a href="https://github.com/mruby/mruby/blob/master/doc/mruby3.2.md">doc/mruby3.2.md</a>.</p> <hr /> <h1 id="the-language">The language</h1> <ul> <li>Now <code class="language-plaintext highlighter-rouge">a::B = c</code> should evaluate <code class="language-plaintext highlighter-rouge">a</code> then <code class="language-plaintext highlighter-rouge">c</code>.</li> <li>Anonymous arguments <code class="language-plaintext highlighter-rouge">*</code>, <code class="language-plaintext highlighter-rouge">**</code>, <code class="language-plaintext highlighter-rouge">&amp;</code> can be passed for forwarding.</li> <li>Multi-precision integer is available now via <code class="language-plaintext highlighter-rouge">mruby-bigint</code> gem.</li> </ul> <h1 id="mruby-vm-and-bytecode">mruby VM and bytecode</h1> <ul> <li><code class="language-plaintext highlighter-rouge">OP_ARYDUP</code> was renamed to <code class="language-plaintext highlighter-rouge">OP_ARYSPLAT</code>. The instruction name was changed but instruction number and basic behavior have not changed (except that <code class="language-plaintext highlighter-rouge">ARYDUP nil</code> makes <code class="language-plaintext highlighter-rouge">[]</code>).</li> </ul> <h1 id="tools">Tools</h1> <h2 id="mruby"><code class="language-plaintext highlighter-rouge">mruby</code></h2> <ul> <li><code class="language-plaintext highlighter-rouge">-b</code> only specifies the script is the binary. The files loaded by <code class="language-plaintext highlighter-rouge">-r</code> are not affected by the option.</li> <li><code class="language-plaintext highlighter-rouge">mruby</code> now loads complied binary if the suffix is <code class="language-plaintext highlighter-rouge">.mrb</code>.</li> </ul> <h2 id="mrbc"><code class="language-plaintext highlighter-rouge">mrbc</code></h2> <ul> <li>Add <code class="language-plaintext highlighter-rouge">--no-optimize</code> option to disable optimization.</li> </ul> <h1 id="mrbgems">mrbgems</h1> <h2 id="mruby-class-ext">mruby-class-ext</h2> <ul> <li>Add <code class="language-plaintext highlighter-rouge">Class#subclasses</code> method.</li> <li>Add <code class="language-plaintext highlighter-rouge">Module#undefined_instance_methods</code> method.</li> </ul> <h2 id="new-bundled-gems">New bundled gems</h2> <ul> <li>mruby-errno from [https://github.com/iij/mruby-errno.git]</li> <li>mruby-set from [https://github.com/yui-knk/mruby-set.git]</li> <li>mruby-dir from [https://github.com/iij/mruby-dir.git]</li> <li>mruby-data</li> </ul> <h1 id="breaking-changes">Breaking Changes</h1> <h2 id="mrb_vm_run-may-detach-top-level-local-variables-referenced-from-blocks"><code class="language-plaintext highlighter-rouge">mrb_vm_run()</code> may detach top-level local variables referenced from blocks</h2> <p>When the <code class="language-plaintext highlighter-rouge">mrb_vm_run()</code> function (including <code class="language-plaintext highlighter-rouge">mrb_top_run()</code>) is called, the previous top-level local variables referenced from blocks is detached under either of the following conditions.</p> <ul> <li>If the <code class="language-plaintext highlighter-rouge">stack_keep</code> parameter is given as 0.</li> <li>If the number of variables in <code class="language-plaintext highlighter-rouge">irep</code> to be executed is less than the number of previous top-level local variables.</li> </ul> <p>This change also affects API functions such as <code class="language-plaintext highlighter-rouge">mrb_load_string()</code> and <code class="language-plaintext highlighter-rouge">mrb_load_file()</code>. The conditions under which the previous top-level local variables referenced from blocks is detached in these functions are as follows:</p> <ul> <li>If the function has no <code class="language-plaintext highlighter-rouge">mrbc_context</code> pointer parameter, or the <code class="language-plaintext highlighter-rouge">mrbc_context</code> pointer parameter is set to <code class="language-plaintext highlighter-rouge">NULL</code>.</li> <li>If the number of variables held in the <code class="language-plaintext highlighter-rouge">mrbc_context</code> pointer is less than the number of previous top-level local variables.</li> </ul> <p>Intentional reliance on previous behavior may cause compatibility problems in your application.</p> <h1 id="cves">CVEs</h1> <p>Following CVEs are fixed.</p> <ul> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0080">CVE-2022-0080</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0240">CVE-2022-0240</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0326">CVE-2022-0326</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0631">CVE-2022-0631</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0481">CVE-2022-0481</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0525">CVE-2022-0525</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0570">CVE-2022-0570</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0614">CVE-2022-0614</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0623">CVE-2022-0623</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0630">CVE-2022-0630</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0631">CVE-2022-0631</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0632">CVE-2022-0632</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0717">CVE-2022-0717</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0890">CVE-2022-0890</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1106">CVE-2022-1106</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1212">CVE-2022-1212</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1276">CVE-2022-1276</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1286">CVE-2022-1286</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1934">CVE-2022-1934</a></li> </ul> <hr /> <p>We have done 1,243 commits to 270 files with 19,130 additions and 10,192 deletions since mruby 3.1.0. For more detail of the updates, <a href="https://github.com/mruby/mruby/compare/3.1.0...3.2.0">see Commit Log</a>.</p> <p>Thanks to all the contributors who have worked on bug fixes and improvements in the release of <code class="language-plaintext highlighter-rouge">mruby 3.2.0</code>.</p> Fri, 24 Feb 2023 00:00:00 +0000 https://mruby.org/releases/2023/02/24/mruby-3.2.0-released.html https://mruby.org/releases/2023/02/24/mruby-3.2.0-released.html releases mruby 3.1.0 released <h1 id="mruby-310">mruby 3.1.0</h1> <p>We are announcing the first stable release of mruby 3.1 series - <a href="https://github.com/mruby/mruby/releases/tag/3.1.0">mruby 3.1.0</a>.</p> <p>Describes the new features and changes in mruby 3.1.<br /> The main changes in mruby 3.1 are also described in <a href="https://github.com/mruby/mruby/blob/master/doc/mruby3.1.md">doc/mruby3.1.md</a>.</p> <hr /> <h1 id="new-features">New Features</h1> <h2 id="core-language-features">Core Language Features</h2> <h3 id="keyword-arguments">Keyword Arguments</h3> <p>CRuby3.0 compatible keyword arguments are introduced. Keyword arguments are basically separated from ordinal arguments.</p> <h3 id="other-language-enhancement">Other Language Enhancement</h3> <ul> <li>Implement endless-def <a href="https://bugs.ruby-lang.org/issues/16746">Ruby:Feature#16746</a></li> <li>Replace <code class="language-plaintext highlighter-rouge">R-assignment</code> by <code class="language-plaintext highlighter-rouge">single-line pattern matching</code> <a href="https://bugs.ruby-lang.org/issues/15921">Ruby:Feature#15921</a></li> <li>Support squiggly heredocs. <a href="https://github.com/mruby/mruby/pull/5246">#5246</a></li> <li>Hash value omission <a href="https://bugs.ruby-lang.org/issues/14579">Ruby:Feature#14579</a></li> </ul> <h2 id="configuration-options-changed">Configuration Options Changed</h2> <p>Some configuration macros are available:</p> <ul> <li><code class="language-plaintext highlighter-rouge">MRB_WORDBOX_NO_FLOAT_TRUNCATE</code>: by default, float values are packed in the word if possible, but define this macro to allocate float values in the heap.</li> <li><code class="language-plaintext highlighter-rouge">MRB_USE_RO_DATA_P_ETEXT</code>: define this macro if <code class="language-plaintext highlighter-rouge">_etext</code> is available on your platform.</li> <li><code class="language-plaintext highlighter-rouge">MRB_NO_DEFAULT_RO_DATA_P</code>: define this macro to avoid using predefined <code class="language-plaintext highlighter-rouge">mrb_ro_data_p()</code> function</li> </ul> <hr /> <h1 id="updated-features">Updated Features</h1> <h2 id="new-build-configurations">New build configurations</h2> <p>We have added several new build configurations in the <code class="language-plaintext highlighter-rouge">build_config</code> directory.</p> <ul> <li><code class="language-plaintext highlighter-rouge">cross-mingw-winetest.rb</code></li> <li><code class="language-plaintext highlighter-rouge">cross-mingw.rb</code></li> <li><code class="language-plaintext highlighter-rouge">nintendo_switch.rb</code></li> <li><code class="language-plaintext highlighter-rouge">serenity.rb</code></li> <li><code class="language-plaintext highlighter-rouge">minimal</code>: minimal configuration</li> <li><code class="language-plaintext highlighter-rouge">host-f32</code>: compiles with <code class="language-plaintext highlighter-rouge">mrb_float</code> as 32 bit <code class="language-plaintext highlighter-rouge">float</code></li> <li><code class="language-plaintext highlighter-rouge">host-nofloat</code>: compiles with no float configuration</li> <li><code class="language-plaintext highlighter-rouge">android_arm64_v8a.rb</code>: renamed from <code class="language-plaintext highlighter-rouge">android_arm64-v8a.rb</code></li> </ul> <h2 id="core-libraries">Core Libraries</h2> <h3 id="new-methods">New Methods</h3> <ul> <li><code class="language-plaintext highlighter-rouge">Array#product</code></li> <li><code class="language-plaintext highlighter-rouge">Array#repeated_combination</code></li> <li><code class="language-plaintext highlighter-rouge">Array#repeated_permutation</code></li> <li><code class="language-plaintext highlighter-rouge">Kernel#__ENCODING__</code></li> <li><code class="language-plaintext highlighter-rouge">Random.bytes</code></li> <li><code class="language-plaintext highlighter-rouge">Random#bytes</code></li> <li><code class="language-plaintext highlighter-rouge">String#center</code></li> </ul> <h3 id="new-gem-enhancement">New Gem Enhancement</h3> <ul> <li><code class="language-plaintext highlighter-rouge">mrbgems/mruby-pack</code> now supports <code class="language-plaintext highlighter-rouge">M</code> directive (Q encoding)</li> <li><code class="language-plaintext highlighter-rouge">mrbgems/mruby-pack</code> now supports <code class="language-plaintext highlighter-rouge">X</code> directive (back-up by bytes)</li> <li><code class="language-plaintext highlighter-rouge">mrbgems/mruby-pack</code> now supports <code class="language-plaintext highlighter-rouge">@</code> directive (absolute position)</li> <li><code class="language-plaintext highlighter-rouge">mrbgems/mruby-pack</code> now supports <code class="language-plaintext highlighter-rouge">w</code> directive (BER compression)</li> </ul> <h2 id="tools">Tools</h2> <ul> <li><code class="language-plaintext highlighter-rouge">mruby-config</code> now supports <code class="language-plaintext highlighter-rouge">--cc</code> and <code class="language-plaintext highlighter-rouge">--ld</code> options.</li> <li>Remove <code class="language-plaintext highlighter-rouge">OP_</code> prefix from <code class="language-plaintext highlighter-rouge">mruby -v</code> code dump output.</li> <li>Prohibit use of <code class="language-plaintext highlighter-rouge">OP_EXT{1,2,3}</code> by <code class="language-plaintext highlighter-rouge">mrbc</code> with <code class="language-plaintext highlighter-rouge">--no-ext-ops</code> option.</li> </ul> <h2 id="features-for-mruby-developer">Features for mruby Developer</h2> <ul> <li>Add new specifier <code class="language-plaintext highlighter-rouge">c</code> to <code class="language-plaintext highlighter-rouge">mrb_get_args()</code> for receive Class/Module.</li> </ul> <hr /> <h1 id="breaking-changes">Breaking Changes</h1> <h2 id="incompatibly-changed-methods">Incompatibly Changed Methods</h2> <ul> <li><code class="language-plaintext highlighter-rouge">Kernel#printf</code> (<code class="language-plaintext highlighter-rouge">mruby-sprintf</code>) Format specifiers <code class="language-plaintext highlighter-rouge">%a</code> and <code class="language-plaintext highlighter-rouge">%A</code> are removed.</li> <li><code class="language-plaintext highlighter-rouge">Kernel#puts</code> (<code class="language-plaintext highlighter-rouge">mruby-print</code>) Now expand Array arguments.</li> </ul> <h2 id="mruby-vm-and-bytecode">mruby VM and bytecode</h2> <p>Due to improvements in the binary format, mruby binaries are no longer backward compatible. To run the mruby binaries on mruby 3.1, recompile with the mruby 3.1 <code class="language-plaintext highlighter-rouge">mrbc</code>.</p> <ul> <li>Upgrade mruby VM version <code class="language-plaintext highlighter-rouge">RITE_VM_VER</code> to <code class="language-plaintext highlighter-rouge">0300</code> (means mruby 3.0 or after).</li> <li>Upgrade mruby binary version <code class="language-plaintext highlighter-rouge">RITE_BINARY_FORMAT_VER</code> to <code class="language-plaintext highlighter-rouge">0300</code>.</li> </ul> <h2 id="reintroduced-instructions">Reintroduced Instructions</h2> <p><code class="language-plaintext highlighter-rouge">mruby3.0</code> removed <code class="language-plaintext highlighter-rouge">OP_EXT1</code>, <code class="language-plaintext highlighter-rouge">OP_EXT2</code>, <code class="language-plaintext highlighter-rouge">OP_EXT3</code> for operand extension. But the operand size limitations was too tight for real-world application. <code class="language-plaintext highlighter-rouge">mruby3.1</code> reintroduces those extension instructions.</p> <h2 id="removed-instructions">Removed Instructions</h2> <p><code class="language-plaintext highlighter-rouge">mruby3.1</code> removed following instructions.</p> <ul> <li><code class="language-plaintext highlighter-rouge">OP_LOADL16</code></li> <li><code class="language-plaintext highlighter-rouge">OP_LOADSYM16</code></li> <li><code class="language-plaintext highlighter-rouge">OP_STRING16</code></li> <li><code class="language-plaintext highlighter-rouge">OP_LAMBDA16</code></li> <li><code class="language-plaintext highlighter-rouge">OP_BLOCK16</code></li> <li><code class="language-plaintext highlighter-rouge">OP_METHOD16</code></li> <li><code class="language-plaintext highlighter-rouge">OP_EXEC16</code></li> </ul> <p>Those instructions are no longer needed by reintroduction of extension instructions.</p> <ul> <li><code class="language-plaintext highlighter-rouge">OP_SENDV</code></li> <li><code class="language-plaintext highlighter-rouge">OP_SENDVB</code></li> </ul> <p>Those instructions for method calls with variable number of arguments are no longer needed. They are covered by <code class="language-plaintext highlighter-rouge">OP_SEND</code> instruction with <code class="language-plaintext highlighter-rouge">n=15</code>.</p> <h2 id="new-instructions">New Instructions</h2> <p><code class="language-plaintext highlighter-rouge">mruby3.1</code> introduces following new instructions.</p> <ul> <li><code class="language-plaintext highlighter-rouge">OP_GETIDX</code>: takes 1 operands <code class="language-plaintext highlighter-rouge">R[a][a+1]</code></li> <li><code class="language-plaintext highlighter-rouge">OP_SETIDX</code>: takes 1 operands <code class="language-plaintext highlighter-rouge">R[a][a+1]=R[a+2]</code></li> <li><code class="language-plaintext highlighter-rouge">OP_SSEND</code>: takes 3 operands <code class="language-plaintext highlighter-rouge">a=self.b(c...)</code>; see <code class="language-plaintext highlighter-rouge">OP_SEND</code></li> <li><code class="language-plaintext highlighter-rouge">OP_SSENDB</code>: takes 3 operands <code class="language-plaintext highlighter-rouge">a=self.b(c...){...}</code>; see <code class="language-plaintext highlighter-rouge">OP_SEND</code></li> <li><code class="language-plaintext highlighter-rouge">OP_SYMBOL</code>: takes 2 operands <code class="language-plaintext highlighter-rouge">R[a] = intern(Pool[b])</code></li> </ul> <h3 id="op_getidx-and-op_setidx"><code class="language-plaintext highlighter-rouge">OP_GETIDX</code> and <code class="language-plaintext highlighter-rouge">OP_SETIDX</code></h3> <p>Execute <code class="language-plaintext highlighter-rouge">obj[int]</code> and <code class="language-plaintext highlighter-rouge">obj[int] = value</code> respectively, where <code class="language-plaintext highlighter-rouge">obj</code> is <code class="language-plaintext highlighter-rouge">string|array|hash</code>.</p> <h3 id="op_ssend-and-op_ssendb"><code class="language-plaintext highlighter-rouge">OP_SSEND</code> and <code class="language-plaintext highlighter-rouge">OP_SSENDB</code></h3> <p>They are similar to <code class="language-plaintext highlighter-rouge">OP_SEND</code> and <code class="language-plaintext highlighter-rouge">OP_SENDB</code> respectively. They initialize the <code class="language-plaintext highlighter-rouge">R[a]</code> by <code class="language-plaintext highlighter-rouge">self</code> first so that we can skip one <code class="language-plaintext highlighter-rouge">OP_LOADSELF</code> instruction for each call.</p> <h3 id="op_symbol"><code class="language-plaintext highlighter-rouge">OP_SYMBOL</code></h3> <p>Extracts the character string placed in the pool as a symbol.</p> <h2 id="changed-instructions">Changed Instructions</h2> <h3 id="op_send-and-op_sendb"><code class="language-plaintext highlighter-rouge">OP_SEND</code> and <code class="language-plaintext highlighter-rouge">OP_SENDB</code></h3> <p>Method calling instructions are unified. Now <code class="language-plaintext highlighter-rouge">OP_SEND</code> and <code class="language-plaintext highlighter-rouge">OP_SENDB</code> (method call with a block) can support both splat arguments and keyword arguments as well.</p> <p>The brief description of the instructions:</p> <table> <tbody> <tr> <td><code class="language-plaintext highlighter-rouge">OP_SEND</code></td> <td>BBB</td> <td><code class="language-plaintext highlighter-rouge">R[a] = R[a].call(Syms[b],R[a+1..n],R[a+n+1],R[a+n+2]..nk) c=n|nk&lt;&lt;4</code></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">OP_SENDB</code></td> <td>BBB</td> <td><code class="language-plaintext highlighter-rouge">R[a] = R[a].call(Syms[b],R[a+1..n],R[a+n+1..nk],R[a+n+2..nk],&amp;R[a+n+2*nk+2]) c=n|nk&lt;&lt;4</code></td> </tr> </tbody> </table> <p>Operand C specifies the number of arguments. Lower 4 bits (<code class="language-plaintext highlighter-rouge">n</code>) represents the number of ordinal arguments, and higher 4 bits (<code class="language-plaintext highlighter-rouge">nk</code>) represents the number of keyword arguments. When <code class="language-plaintext highlighter-rouge">n == 15</code>, the method takes arguments packed in an array. When <code class="language-plaintext highlighter-rouge">nk == 15</code>, the method takes keyword arguments are packed in a hash.</p> <h3 id="op_arypush"><code class="language-plaintext highlighter-rouge">OP_ARYPUSH</code></h3> <p>Now takes 2 operands and pushes multiple entries to an array.</p> <h2 id="boxing-updated">Boxing Updated</h2> <h3 id="word-boxing">Word Boxing</h3> <p><code class="language-plaintext highlighter-rouge">MRB_WORD_BOXING</code> now packs floating point numbers in the word, if the size of <code class="language-plaintext highlighter-rouge">mrb_float</code> is equal or smaller than the size of <code class="language-plaintext highlighter-rouge">mrb_int</code> by default. If the size of <code class="language-plaintext highlighter-rouge">mrb_float</code> and <code class="language-plaintext highlighter-rouge">mrb_int</code> are same, the last 2 bits in the <code class="language-plaintext highlighter-rouge">mrb_float</code> are trimmed and used as flags. If you need full precision, you need to define <code class="language-plaintext highlighter-rouge">MRB_WORDBOX_NO_FLOAT_TRUNCATE</code> as described above.</p> <h3 id="nan-boxing">NaN Boxing</h3> <p>Previous NaN boxing packs values in NaN representation, but pointer retrievals are far more frequent than floating point number references. So we add constant offset to NaN representation to clear higher bits of pointer representation. This representation is called “Favor Pointer” NaN Boxing.</p> <p>Also, previous NaN boxing limit the size of <code class="language-plaintext highlighter-rouge">mrb_int</code> to 4 bytes (32 bits) to fit in NaN values. Now we allocate integer values in the heap, if the value does not fit in the 32 bit range, just like we did in Word Boxing.</p> <h2 id="constant-folding">Constant Folding</h2> <p>The code generator was updated to reduce the number of instructions, e.g.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>a = 2 * 5 </code></pre></div></div> <p>will be interpreted as</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>a = 10 </code></pre></div></div> <p>In addition, we have improved peephole optimizations, for example:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GETIV R4 :@foo MOVE R1 R4 </code></pre></div></div> <p>to</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GETIV R1 :@foo </code></pre></div></div> <h2 id="stringhash-now-use-fnv1a-algorithm"><code class="language-plaintext highlighter-rouge">String#hash</code> now use <code class="language-plaintext highlighter-rouge">FNV1a</code> algorithm</h2> <p>For better and faster hash values.</p> <hr /> <h1 id="major-bug-fixes">Major bug fixes</h1> <ul> <li>Fix infinite recursive call bugs in integer division <a href="https://github.com/mruby/mruby/commit/98799aa6">98799aa6</a></li> <li>Fix to raise TypeError with super inside instance_eval / class_eval <a href="https://github.com/mruby/mruby/pull/5476">#5476</a></li> <li>Fix to call <code class="language-plaintext highlighter-rouge">method_added</code> hooks on method definitions; <a href="https://github.com/mruby/mruby/pull/2339">#2339</a></li> <li>Fix a potential buffer overflow in <code class="language-plaintext highlighter-rouge">time_zonename</code> <a href="https://github.com/mruby/mruby/commit/26340a88">26340a88</a></li> <li>Fix <code class="language-plaintext highlighter-rouge">Module.instance_eval</code> bug <a href="https://github.com/mruby/mruby/pull/5528">#5528</a></li> <li>Fix fix <code class="language-plaintext highlighter-rouge">M</code> packing bug <a href="https://github.com/mruby/mruby/commit/bfe2bd49">bfe2bd49</a></li> <li>Fix a bug regarding attribute assignment with kargs <a href="https://github.com/mruby/mruby/commit/de2b4bd0">de2b4bd0</a></li> <li>Fix SIGSEGV with mrbgems/mruby-method <a href="https://github.com/mruby/mruby/pull/5580">#5580</a></li> <li>Fix print error before cleanup in <code class="language-plaintext highlighter-rouge">codegen_error()</code> <a href="https://github.com/mruby/mruby/pull/5603">#5603</a></li> <li>Fix a bug in unpacking BER <a href="https://github.com/mruby/mruby/pull/5611">#5611</a></li> <li>Fix a bug with numbered parameters as arguments <a href="https://github.com/mruby/mruby/pull/5605">#5605</a></li> <li>Fix <code class="language-plaintext highlighter-rouge">mrb_ary_shift_m</code> initialization bug <a href="https://github.com/mruby/mruby/commit/27d1e013">27d1e013</a></li> <li>Fix keyword argument with <code class="language-plaintext highlighter-rouge">super</code> <a href="https://github.com/mruby/mruby/pull/5628">#5628</a></li> <li>Fix a bug with numbered parameters on toplevel <a href="https://github.com/mruby/mruby/commit/7e7f1b2f">7e7f1b2f</a></li> <li>Fix keyword argument bug <a href="https://github.com/mruby/mruby/issues/5632">#5632</a></li> <li>Fix multiple assignments in parameters <a href="https://github.com/mruby/mruby/issues/5647">#5647</a></li> <li>Fix keyword parameters not passing through super <a href="https://github.com/mruby/mruby/issues/5660">#5660</a></li> <li>Fix infinite loop from unclosed here-doc <a href="https://github.com/mruby/mruby/issues/5676">#5676</a></li> <li>Fix negative integer division bug <a href="https://github.com/mruby/mruby/issues/5678">#5678</a></li> </ul> <h1 id="cves">CVEs</h1> <h2 id="fixed-cves">Fixed CVEs</h2> <h2 id="following-cves-are-fixed-in-this-release">Following CVEs are fixed in this release.</h2> <p><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-">CVE-2021-</a></p> <ul> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-4110">CVE-2021-4110</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-4188">CVE-2021-4188</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0080">CVE-2022-0080</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0240">CVE-2022-0240</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0326">CVE-2022-0326</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0481">CVE-2022-0481</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0631">CVE-2022-0631</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0632">CVE-2022-0632</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0890">CVE-2022-0890</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1071">CVE-2022-1071</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1106">CVE-2022-1106</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1201">CVE-2022-1201</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1427">CVE-2022-1427</a></li> </ul> <h2 id="unaffected-cves">Unaffected CVEs</h2> <p>Following CVEs do not cause problems in this release. They are fixed in the later release.</p> <ul> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0481">CVE-2022-0481</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0525">CVE-2022-0525</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0570">CVE-2022-0570</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0614">CVE-2022-0614</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0623">CVE-2022-0623</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0630">CVE-2022-0630</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-0817">CVE-2022-0717</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1212">CVE-2022-1212</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1276">CVE-2022-1276</a></li> <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-1286">CVE-2022-1286</a></li> </ul> <hr /> <p>We have done 1,076 commits to 287 files with 17,188 additions and 15,549 deletions since mruby 3.0.0. For more detail of the updates, <a href="https://github.com/mruby/mruby/compare/3.0.0...3.1.0">see Commit Log</a>.</p> <p>Thanks to all the contributors who have worked on bug fixes and improvements in the release of <code class="language-plaintext highlighter-rouge">mruby 3.1.0</code>.</p> Sat, 12 Mar 2022 00:00:00 +0000 https://mruby.org/releases/2022/03/12/mruby-3.1.0-released.html https://mruby.org/releases/2022/03/12/mruby-3.1.0-released.html releases mruby 3.0.0 released <h1 id="mruby-300">mruby 3.0.0</h1> <p>We are announcing the first stable release of mruby 3.0 series - <a href="https://github.com/mruby/mruby/releases/tag/3.0.0">mruby 3.0.0</a>.</p> <p>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.</p> <p>Describes the new features and changes in mruby 3.0.<br /> The main changes in mruby 3.0 are also described in <a href="https://github.com/mruby/mruby/blob/master/doc/mruby3.md">doc/mruby3.md</a>.</p> <hr /> <h1 id="new-features">New Features</h1> <h2 id="core-language-features">Core Language Features</h2> <ul> <li>Implement endless-def. <a href="https://bugs.ruby-lang.org/issues/16746">Ruby:Feature#16746</a></li> <li>Replace <code class="language-plaintext highlighter-rouge">R-assignment</code> by <code class="language-plaintext highlighter-rouge">single-line pattern matching</code>. <a href="https://bugs.ruby-lang.org/issues/15921">Ruby:Feature#15921</a></li> <li>Support squiggly heredocs. <a href="https://github.com/mruby/mruby/pull/5246">#5246</a></li> </ul> <h2 id="features-for-mruby-developer">Features for mruby Developer</h2> <ul> <li>Add new C APIs <ul> <li><code class="language-plaintext highlighter-rouge">mrbc_cleanup_local_variables()</code> - Clean up local variables on mrbc_context. <a href="https://github.com/mruby/mruby/pull/4931">#4931</a></li> <li>Add functions that take symbols as arguments. <ul> <li><code class="language-plaintext highlighter-rouge">mrb_define_singleton_method_id()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_define_class_method_id()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_define_module_function_id()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_undef_method_id()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_undef_class_method_id()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_define_const_id()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_funcall_id()</code></li> </ul> </li> <li>Add functions for symbol checking that return mrb_sym value. <ul> <li><code class="language-plaintext highlighter-rouge">mrb_intern_check()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_intern_check_cstr()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_intern_check_str()</code></li> </ul> </li> <li><code class="language-plaintext highlighter-rouge">mrb_fiber_resume()</code> - Allow context switch from C module.</li> </ul> </li> </ul> <hr /> <h1 id="update-features">Update Features</h1> <h2 id="reduce-memory-usage">Reduce memory usage</h2> <ul> <li>Preallocate Symbols<br /> The mruby 3.0 can now significantly reduce RAM usage by allocating symbols to static memory area at compile time. See <a href="https://github.com/mruby/mruby/blob/master/doc/guides/symbol.md">doc/guides/symbol.md</a> for more information.</li> <li>Reduce memory usage of Hash objects. <a href="https://github.com/mruby/mruby/commit/f2d8db39">f2d8db39</a></li> <li>Reduce memory usage when calling methods. <a href="https://github.com/mruby/mruby/pull/5272">#5272</a></li> </ul> <h2 id="updated-build-process">Updated build process</h2> <p>The old build configuration file <code class="language-plaintext highlighter-rouge">build_config.rb</code> has been reconfigured to a file in the <code class="language-plaintext highlighter-rouge">build_config</code> directory.<br /> For example, the following typical build configuration is available.</p> <ul> <li><code class="language-plaintext highlighter-rouge">default</code>: the default configuration</li> <li><code class="language-plaintext highlighter-rouge">host-gprof</code>: compiles with <code class="language-plaintext highlighter-rouge">gprof</code> for performance tuning</li> <li><code class="language-plaintext highlighter-rouge">host-m32</code>: compiles in gcc 32bit mode on 64bit platforms</li> <li><code class="language-plaintext highlighter-rouge">boxing</code>: compiles all three boxing options</li> <li><code class="language-plaintext highlighter-rouge">clang-asan</code>: compiles with clang’s Address Sanitizer</li> </ul> <p>You can specify the mruby build configuration by building mruby with the <code class="language-plaintext highlighter-rouge">rake</code> build, specifying the build configuration file in the environment variable <code class="language-plaintext highlighter-rouge">MRUBY_CONFIG</code>.</p> <h2 id="core-libraries">Core Libraries</h2> <ul> <li>Add new libraries. <ul> <li><code class="language-plaintext highlighter-rouge">mruby-catch</code> - Support <code class="language-plaintext highlighter-rouge">Kernel.#catch</code> and <code class="language-plaintext highlighter-rouge">Kernel.#throw</code>. <a href="https://github.com/mruby/mruby/commit/7eaaee54">7eaaee54</a></li> <li><code class="language-plaintext highlighter-rouge">mruby-os-memsize</code> - Support <code class="language-plaintext highlighter-rouge">ObjectSpace.memsize_of</code> and <code class="language-plaintext highlighter-rouge">ObjectSpace.memsize_of_all</code>. <a href="https://github.com/mruby/mruby/pull/5032">#5032</a> <a href="https://github.com/mruby/mruby/pull/5040">#5040</a> <a href="https://github.com/mruby/mruby/pull/5041">#5041</a></li> </ul> </li> <li>Add <code class="language-plaintext highlighter-rouge">Array.new([])</code> initialization. (mruby-array)</li> <li>Add <code class="language-plaintext highlighter-rouge">Hash#except</code> (mruby-hash-ext)</li> <li>Update <code class="language-plaintext highlighter-rouge">IO#popen</code> to use keyword arguments. (mruby-io)</li> <li>Make <code class="language-plaintext highlighter-rouge">Module#include</code> and <code class="language-plaintext highlighter-rouge">Module#prepend</code> behave like Ruby 3.0. <a href="https://github.com/mruby/mruby/commit/3972df57">3972df57</a></li> </ul> <h2 id="tools">Tools</h2> <ul> <li>Allow to mixed and specify <code class="language-plaintext highlighter-rouge">*.rb</code> and <code class="language-plaintext highlighter-rouge">*.mrb</code> in <code class="language-plaintext highlighter-rouge">mruby</code> interpreter. <a href="https://github.com/mruby/mruby/commit/a045b6b8">a045b6b8</a></li> <li>Add <code class="language-plaintext highlighter-rouge">irep</code> C struct dump from <code class="language-plaintext highlighter-rouge">mrbc</code> with <code class="language-plaintext highlighter-rouge">-S</code> option.</li> </ul> <h2 id="features-for-mruby-developer-1">Features for mruby Developer</h2> <ul> <li>Add new specifier <code class="language-plaintext highlighter-rouge">c</code> to <code class="language-plaintext highlighter-rouge">mrb_get_args()</code> for receive Class/Module.</li> </ul> <hr /> <h1 id="breaking-changes">Breaking Changes</h1> <h2 id="mruby-vm-and-bytecode">mruby VM and bytecode</h2> <p>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 <code class="language-plaintext highlighter-rouge">mrbc</code>.</p> <ul> <li>Upgrade mruby VM version <code class="language-plaintext highlighter-rouge">RITE_VM_VER</code> to <code class="language-plaintext highlighter-rouge">0300</code> (means mruby 3.0).</li> <li>Upgrade mruby binary version <code class="language-plaintext highlighter-rouge">RITE_BINARY_FORMAT_VER</code> to <code class="language-plaintext highlighter-rouge">0200</code>.</li> </ul> <h2 id="recognize-integer-system">Recognize Integer system</h2> <p><code class="language-plaintext highlighter-rouge">Integer</code> has been changed to a specification similar to CRuby.</p> <ul> <li>Integrate <code class="language-plaintext highlighter-rouge">Fixnum</code> and <code class="language-plaintext highlighter-rouge">Integer</code>.</li> <li>Remove <code class="language-plaintext highlighter-rouge">Integral</code>.</li> <li><code class="language-plaintext highlighter-rouge">int / int -&gt; int</code></li> <li>Add APIs for <code class="language-plaintext highlighter-rouge">Integer</code>. APIs for <code class="language-plaintext highlighter-rouge">Fixnum</code> (<code class="language-plaintext highlighter-rouge">mrb_fixnum_xxx()</code>) is also left for compatibility. <ul> <li><code class="language-plaintext highlighter-rouge">mrb_fixnum()</code> -&gt; <code class="language-plaintext highlighter-rouge">mrb_integer()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_fixnum_value()</code> -&gt; <code class="language-plaintext highlighter-rouge">mrb_int_value()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_fixnum_p()</code> -&gt; <code class="language-plaintext highlighter-rouge">mrb_integer_p()</code></li> </ul> </li> </ul> <hr /> <h1 id="major-bug-fixes">Major bug fixes</h1> <ul> <li>Fix take over file scope variables with <code class="language-plaintext highlighter-rouge">mruby</code> and <code class="language-plaintext highlighter-rouge">mirb</code> command. <a href="https://github.com/mruby/mruby/issues/4933">#4933</a></li> <li>Fix performing <code class="language-plaintext highlighter-rouge">block_given?</code> from inside an orphan block always returns false. <a href="https://github.com/mruby/mruby/issues/5039">#5039</a></li> <li>Fix segmentation fault in Mruby interpreter making it crash <a href="https://github.com/mruby/mruby/issues/5046">#5046</a></li> <li>Fix splat operator to frozen Array raises FrozenError. <a href="https://github.com/mruby/mruby/issues/5067">#5067</a></li> <li>Fix wrong behavior of File.extname when the filename starts or ends with a period. (mruby-io) <a href="https://github.com/mruby/mruby/issues/5077">#5077</a></li> <li>Fix #parameters mistakes keyword “splat” for a block parameter. <a href="https://github.com/mruby/mruby/issues/5066">#5066</a></li> <li>Fix mruby-io doesn’t work in processes started as Windows service. <a href="https://github.com/mruby/mruby/issues/5114">#5114</a></li> <li>Fix resuming fiber from C seems to loop infinitely. <a href="https://github.com/mruby/mruby/issues/5261">#5261</a></li> <li>Fix invalid UTF-8 string length. <a href="https://github.com/mruby/mruby/issues/5269">#5269</a></li> <li>Fix avoid syntax error when EXPR_MID appears in conditional operator. <a href="https://github.com/mruby/mruby/issues/5290">#5290</a></li> <li>Fix symbols like numbered parameters in blocks get a syntax error. <a href="https://github.com/mruby/mruby/issues/5295">#5295</a></li> <li>Avoid infinite loops when converting objects to strings. <a href="https://github.com/mruby/mruby/commit/01a8d849">01a8d849</a></li> <li>Fix module order of <code class="language-plaintext highlighter-rouge">#include</code>. <a href="https://bugs.ruby-lang.org/issues/7844">ruby-bug:7844</a></li> </ul> <hr /> <p>We 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, <a href="https://github.com/mruby/mruby/compare/2.1.2...3.0.0">see Commit Log</a>.</p> <p>Thanks to all the contributors who have worked on bug fixes and improvements in the release of <code class="language-plaintext highlighter-rouge">mruby 3.0.0</code>.</p> Fri, 05 Mar 2021 00:00:00 +0000 https://mruby.org/releases/2021/03/05/mruby-3.0.0-released.html https://mruby.org/releases/2021/03/05/mruby-3.0.0-released.html releases mruby 2.1.2 released <h1 id="mruby-212">mruby 2.1.2</h1> <p>We are announcing the stable release of mruby 2.1 series - <a href="https://github.com/mruby/mruby/releases/tag/2.1.2">mruby 2.1.2</a>.</p> <hr /> <h1 id="new-features">New Features</h1> <h2 id="core-language-features">Core Language Features</h2> <ul> <li>Support for <code class="language-plaintext highlighter-rouge">Argument Forwarding</code>, which allows you to forward arguments in the form <code class="language-plaintext highlighter-rouge">def foo(...)</code>.</li> </ul> <h2 id="mruby-vm-and-bytecode">mruby VM and bytecode</h2> <ul> <li>Add <code class="language-plaintext highlighter-rouge">OP_LOADI16</code> instruction that loads a 16-bit integer into a register.</li> <li>Remove endian information/flags from compiled binary format.</li> <li>The version of the mruby binary has changed from <code class="language-plaintext highlighter-rouge">0006</code> to <code class="language-plaintext highlighter-rouge">0007</code>.</li> </ul> <h2 id="for-mruby-developer">for mruby Developer</h2> <ul> <li>Add new C APIs. <ul> <li><code class="language-plaintext highlighter-rouge">mrb_float_to_cstr()</code> - Convert Float to C String.</li> <li><code class="language-plaintext highlighter-rouge">mrb_singleton_class_ptr()</code> - Get pointer of Singleton class. <a href="https://github.com/mruby/mruby/pull/4973">#4973</a></li> <li><code class="language-plaintext highlighter-rouge">mrb_utf8len()</code> - Get size of UTF-8 string. <a href="https://github.com/mruby/mruby/pull/4712">#4712</a></li> <li><code class="language-plaintext highlighter-rouge">mrb_utf8_strlen()</code> - Get length of UTF-8 string. <a href="https://github.com/mruby/mruby/pull/4712">#4712</a></li> <li><code class="language-plaintext highlighter-rouge">mrb_get_arg1()</code> - Retrieve the first and only argument from mrb_state.</li> </ul> </li> </ul> <hr /> <h1 id="update-features">Update Features</h1> <h2 id="core-libraries">Core Libraries</h2> <ul> <li>Add to the libraries included by default in the mruby VM. <ul> <li><code class="language-plaintext highlighter-rouge">mruby-eval</code></li> <li><code class="language-plaintext highlighter-rouge">mruby-complex</code></li> <li><code class="language-plaintext highlighter-rouge">mruby-rational</code></li> </ul> </li> <li>Support <code class="language-plaintext highlighter-rouge">MRB_DISABLE_STDIO</code> for <code class="language-plaintext highlighter-rouge">mruby-pack</code> and <code class="language-plaintext highlighter-rouge">mruby-sprintf</code>. <a href="https://github.com/mruby/mruby/pull/4954">#4954</a></li> <li>Support <code class="language-plaintext highlighter-rouge">IO#pread</code> and <code class="language-plaintext highlighter-rouge">IO#pwrite</code> on macOS.</li> <li>Improve <code class="language-plaintext highlighter-rouge">Kernel.#eval</code> to call method with the same name as a variable name without any arguments.</li> <li><code class="language-plaintext highlighter-rouge">IO#readchar</code> supports UTF-8 characters.</li> </ul> <h2 id="tools">Tools</h2> <ul> <li>Remove <code class="language-plaintext highlighter-rouge">-e</code> / <code class="language-plaintext highlighter-rouge">-E</code> options from <code class="language-plaintext highlighter-rouge">mrbc</code>.</li> </ul> <h2 id="for-mruby-developer-1">for mruby Developer</h2> <ul> <li>Support width specifier with <code class="language-plaintext highlighter-rouge">mrb_float_to_str()</code>.</li> <li>Support integer and float combination in <code class="language-plaintext highlighter-rouge">mrb_equal()</code>.</li> </ul> <h2 id="improve-mruby-build">Improve mruby build</h2> <ul> <li>A mruby can be built without GNU Bison. (<a href="https://github.com/mruby/mruby/commit/a3ec6ede">a3ec6ede</a>)</li> <li>Supports GitHub Actions. <a href="https://github.com/mruby/mruby/pull/4903">#4903</a><br /> Execute CI of the following platforms updating the repository. <ul> <li>Ubuntu 16.04</li> <li>Ubuntu 18.04 (gcc)</li> <li>Ubuntu 18.04 (clang)</li> <li>macOS</li> <li>Windows (MinGW)</li> <li>Windows (Cygwin)</li> <li>Windows (MSVC)</li> </ul> </li> </ul> <hr /> <h1 id="breaking-changes">Breaking Changes</h1> <ul> <li><code class="language-plaintext highlighter-rouge">IO#readchar</code> returns a UTF-8 character fragment instead of <code class="language-plaintext highlighter-rouge">EOFError</code> if EOF is reached in the middle of UTF-8 characters. (<a href="(https://github.com/mruby/mruby/commit/86271572)">86271572</a>)<br /> This behavior is different from CRuby, but it is a mruby specification that supports either ASCII or UTF-8 exclusively.</li> <li>Remove <code class="language-plaintext highlighter-rouge">mrb_run()</code> from C APIs.</li> </ul> <hr /> <h1 id="major-bug-fixes">Major bug fixes</h1> <ul> <li>Segmentation fault at <code class="language-plaintext highlighter-rouge">mrb_io_s_select</code>. <a href="https://github.com/mruby/mruby/issues/4966">#4966</a></li> <li>Segmentation fault at <code class="language-plaintext highlighter-rouge">mrb_vm_exec</code>. <a href="https://github.com/mruby/mruby/issues/4973">#4973</a></li> <li>Some <code class="language-plaintext highlighter-rouge">Hash</code> methods are inconsistent with <code class="language-plaintext highlighter-rouge">values</code> when hash has duplicate key. <a href="https://github.com/mruby/mruby/commit/181f7b97">181f7b97</a></li> <li>Get local variable names from orphan block. <a href="https://github.com/mruby/mruby/issues/5014">#5014</a></li> <li>Memory leaks in some places when out of memory. <a href="https://github.com/mruby/mruby/commit/f1523d24">f1523d24</a></li> <li>Heap buffer overflow in mruby interpreter. <a href="https://github.com/mruby/mruby/issues/5042">#5042</a></li> <li>Type tag not used when calculating hash code. <a href="https://github.com/mruby/mruby/issues/5049">#5049</a></li> </ul> <hr /> <p>We have done 185 commits to 99 files with 14,883 additions and 1,653 deletions since mruby 2.1.1. For more detail of the updates, <a href="https://github.com/mruby/mruby/compare/2.1.1...2.1.2">see Commit Log</a>.</p> <p>Thanks all the contributors who have worked on bug fix and improvements in the release of <code class="language-plaintext highlighter-rouge">mruby 2.1.2</code>.</p> Thu, 06 Aug 2020 00:00:00 +0000 https://mruby.org/releases/2020/08/06/mruby-2.1.2-released.html https://mruby.org/releases/2020/08/06/mruby-2.1.2-released.html releases mruby 2.1.1 released <h1 id="mruby-211">mruby 2.1.1</h1> <p>We are announcing the stable release of mruby 2.1 series - <a href="https://github.com/mruby/mruby/releases/tag/2.1.1">mruby 2.1.1</a>.</p> <hr /> <h1 id="new-features">New Features</h1> <h2 id="core-language-features">Core Language Features</h2> <h3 id="ruby-27-features">Ruby 2.7 features</h3> <ul> <li>Numbered parameters as default block parameters are introduced. (<a href="https://github.com/mruby/mruby/commit/72d57ad094b8e1c529e2e8b41d895fc6f212e31e">72d57ad0</a>)</li> </ul> <h2 id="core-libraries">Core Libraries</h2> <h3 id="ruby-27-features-1">Ruby 2.7 features</h3> <ul> <li>Revert Implement Ruby2.7’s frozen strings from <code class="language-plaintext highlighter-rouge">Symbol#to_s</code>. (<a href="https://github.com/mruby/mruby/commit/4296c77e29b67e72399dde8295dd6fa4a10cc321">a367373f</a>)</li> </ul> <hr /> <h1 id="update-features">Update Features</h1> <h2 id="core-language-features-1">Core Language Features</h2> <ul> <li>Always enable the rational and complex literals. (<a href="https://github.com/mruby/mruby/commit/351c9c80e786b6a3f3779cdf2d89879a58f35407">351c9c80</a>)</li> </ul> <h2 id="core-libraries-1">Core Libraries</h2> <ul> <li>The <code class="language-plaintext highlighter-rouge">#prepend_features</code> and <code class="language-plaintext highlighter-rouge">#module_function</code> methods are not haves for class objects. (<a href="https://github.com/mruby/mruby/commit/cc52fa66e8c12be2b6bbe3c7fd850ea0b2beb0c1">cc52fa66</a>)</li> <li>Remove location info from <code class="language-plaintext highlighter-rouge">Exception#inspect</code>. (<a href="https://github.com/mruby/mruby/commit/d2f2f9db511afc348a88f864b9f0b0ccfc59a8f1">d2f2f9db</a>)</li> <li>Allow <code class="language-plaintext highlighter-rouge">true</code>/<code class="language-plaintext highlighter-rouge">false</code> argument to <code class="language-plaintext highlighter-rouge">Kernel#exit</code>. (mrbgems/mruby-exit) (<a href="https://github.com/mruby/mruby/commit/d81e4d71c17f9d65ea87f0e66a4338411863f7bf">d81e4d71</a>)</li> <li>Improved the judgment of absolute path on Windows. <a href="https://github.com/mruby/mruby/pull/4950">#4950</a></li> </ul> <h2 id="tools">Tools</h2> <ul> <li>Support short options concatenation to <code class="language-plaintext highlighter-rouge">mruby</code> command. (<a href="https://github.com/mruby/mruby/commit/9de7130a9a77482b27a101211ff0f4a63d57a613">9de7130a</a>)</li> <li>Support <code class="language-plaintext highlighter-rouge">--</code> (end of options) to <code class="language-plaintext highlighter-rouge">mruby</code> command. (<a href="https://github.com/mruby/mruby/commit/f4b528e07a069b9acbbcb61cced2b04115e61db7">f4b528e0</a>)</li> <li>Quit <code class="language-plaintext highlighter-rouge">mruby -v</code> immediately if no program is given for Ruby compatibility. (<a href="https://github.com/mruby/mruby/commit/49653b81ea978a5f02c4a6ce1ed53eb1cd0dbe7a">49653b81</a>)</li> </ul> <h2 id="for-mruby-developer">for mruby Developer</h2> <ul> <li>Add assertion to <code class="language-plaintext highlighter-rouge">RVALUE</code> size. (<a href="https://github.com/mruby/mruby/commit/6cf99d12ac17e50b91e6aeb0dd79c611e579fd1b">6cf99d12</a>)</li> </ul> <hr /> <h1 id="compatibility">Compatibility</h1> <h2 id="core-libraries-2">Core Libraries</h2> <ul> <li>Add <code class="language-plaintext highlighter-rouge">File#size</code> and <code class="language-plaintext highlighter-rouge">File#truncate</code>. (mrbgems/mruby-io) (<a href="https://github.com/mruby/mruby/commit/6d9ac89f925e83bd7ca25e04190f264bea600831">6d9ac89f</a>)</li> <li>Add <code class="language-plaintext highlighter-rouge">IO#pread</code> and <code class="language-plaintext highlighter-rouge">IO#pwrite</code>. (mrbgems/mruby-io) (<a href="https://github.com/mruby/mruby/commit/4c6d524c473ebb9174d0183dc1d1ac0530337314">4c6d524c</a>)</li> <li>Support bit flags for <code class="language-plaintext highlighter-rouge">IO.open</code>. (mrbgems/mruby-io) (<a href="https://github.com/mruby/mruby/commit/69619aeeb1434c30565ff1229897cf5b1af462da">69619aee</a>)</li> </ul> <hr /> <h1 id="changes">Changes</h1> <h2 id="build-system">Build system</h2> <ul> <li>Abandon <code class="language-plaintext highlighter-rouge">minirake</code>. Use <code class="language-plaintext highlighter-rouge">rake</code> for compilation.<br /> Currently, <code class="language-plaintext highlighter-rouge">minirake</code> is left for compatibility, but it will be removed in the future. (<a href="https://github.com/mruby/mruby/commit/de17f63b4567cad3b02f1f1f9386eaf8dd704bbe">de17f63</a>)</li> </ul> <hr /> <h1 id="breaking-changes">Breaking Changes</h1> <ul> <li>Remove <code class="language-plaintext highlighter-rouge">MRB_INT16</code> configuration option. (<a href="https://github.com/mruby/mruby/commit/ff57c0278fe7c2b83231fa40e0284e6685a29ee7">ff57c027</a>)</li> </ul> <hr /> <h1 id="major-bug-fixes">Major bug fixes</h1> <ul> <li>Parser rejects heredoc without following comma or closing bracket in array/hash literal. <a href="https://github.com/mruby/mruby/issues/4796">#4796</a></li> <li>Segfault due to invalid read in <code class="language-plaintext highlighter-rouge">str_init_shared</code>. <a href="https://github.com/mruby/mruby/issues/4807">#4807</a></li> <li>Invalid read in array_copy and <code class="language-plaintext highlighter-rouge">mrb_ary_unshift_m</code>. <a href="https://github.com/mruby/mruby/issues/4808">#4808</a></li> <li>Parser segfault (invalid read) in <code class="language-plaintext highlighter-rouge">local_add_f</code>. <a href="https://github.com/mruby/mruby/issues/4810">#4810</a></li> <li>Parser rejects some heredoc in hash literal. <a href="https://github.com/mruby/mruby/issues/4815">#4815</a></li> <li>Rakefile in mruby build emits warnings with Windows paths. <a href="https://github.com/mruby/mruby/issues/4817">#4817</a></li> <li>Coredump when use <code class="language-plaintext highlighter-rouge">ensure</code> in <code class="language-plaintext highlighter-rouge">Kernel#eval</code> script. <a href="https://github.com/mruby/mruby/issues/4833">#4833</a></li> <li>Fix keyword arguments not be obtained with <code class="language-plaintext highlighter-rouge">mrb_get_args()</code>. <a href="https://github.com/mruby/mruby/issues/4855">#4855</a></li> <li>Undefined method `Pathname’ for MRuby::Toolchain::Android. <a href="https://github.com/mruby/mruby/issues/4895">#4895</a></li> <li>Cygwin compile error. <a href="https://github.com/mruby/mruby/issues/4904">#4904</a></li> <li><code class="language-plaintext highlighter-rouge">String#to_f</code> should not allow hexdecimal format. <a href="https://github.com/mruby/mruby/issues/4924">#4924</a></li> <li>Heap use after free in hash_values_at in mrbgems/mruby-hash-ext/src/hash-ext.c:33. <a href="https://github.com/mruby/mruby/issues/4926">#4926</a></li> <li>The method name becomes <code class="language-plaintext highlighter-rouge">call</code> in backtrace inside a block outside a method. <a href="https://github.com/mruby/mruby/issues/4936">#4936</a></li> <li>Segmentation fault at mrbgems/mruby-metaprog/src/metaprog.c:142. <a href="https://github.com/mruby/mruby/issues/4955">#4955</a></li> <li>Test <code class="language-plaintext highlighter-rouge">mruby-io</code> in tmpdir when AF_UNIX cannot be created on cwd. <a href="https://github.com/mruby/mruby/issues/4981">#4981</a></li> <li>IO#readlines/IO#getc hangs while reading over TCPSocket <a href="https://github.com/mruby/mruby/issues/4982">#4982</a></li> <li><code class="language-plaintext highlighter-rouge">p-&gt;locals</code> may be <code class="language-plaintext highlighter-rouge">NULL</code> when error occurs before the point. <a href="https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19886">oss-fuzz: Issue 19886</a></li> <li>Fix buffer overflow in <code class="language-plaintext highlighter-rouge">mrb_str_len_to_dbl</code>. <a href="https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19902">oss-fuzz: Issue 19902</a></li> <li>Fix file/directory name parameter for <code class="language-plaintext highlighter-rouge">git</code> command.</li> <li>Fix <code class="language-plaintext highlighter-rouge">MRB_FIXNUM_SHIFT</code> with <code class="language-plaintext highlighter-rouge">MRB_WORD_BOXING</code>, <code class="language-plaintext highlighter-rouge">MRB_INT32</code> and <code class="language-plaintext highlighter-rouge">MRB_64BIT</code>.</li> <li>Build when directories and files have spaces.</li> <li>Fix argument specs of below methods. <ul> <li><code class="language-plaintext highlighter-rouge">Exception</code><br /> <code class="language-plaintext highlighter-rouge">Exception#exception</code>.</li> <li><code class="language-plaintext highlighter-rouge">IO</code> (mrbgems/mruby-io)<br /> <code class="language-plaintext highlighter-rouge">IO._popen</code>, <code class="language-plaintext highlighter-rouge">IO.for_fd</code>, <code class="language-plaintext highlighter-rouge">IO.select</code>, <code class="language-plaintext highlighter-rouge">IO.sysopen</code>, <code class="language-plaintext highlighter-rouge">IO.new</code>, <code class="language-plaintext highlighter-rouge">IO#sysread</code> and <code class="language-plaintext highlighter-rouge">IO#sysseek</code>.</li> <li><code class="language-plaintext highlighter-rouge">File</code> (mrbgems/mruby-io)<br /> <code class="language-plaintext highlighter-rouge">File.umask</code>.</li> <li><code class="language-plaintext highlighter-rouge">Integer</code><br /> <code class="language-plaintext highlighter-rouge">Integer#ceil</code>, <code class="language-plaintext highlighter-rouge">Integer#floor</code>, <code class="language-plaintext highlighter-rouge">Integer#round</code> and <code class="language-plaintext highlighter-rouge">Integer#truncate</code>.</li> <li><code class="language-plaintext highlighter-rouge">Kernel</code><br /> <code class="language-plaintext highlighter-rouge">BasicObject#instance_eval</code>, <code class="language-plaintext highlighter-rouge">Kernel#integer</code>, <code class="language-plaintext highlighter-rouge">Kernel#define_singleton_method</code>, <code class="language-plaintext highlighter-rouge">Kernel#send</code>, <code class="language-plaintext highlighter-rouge">Kernel#proc</code>, <code class="language-plaintext highlighter-rouge">Kernel#sprintf</code>, <code class="language-plaintext highlighter-rouge">Kernel#format</code> and <code class="language-plaintext highlighter-rouge">Kernel#respond_to?</code>.</li> <li><code class="language-plaintext highlighter-rouge">Hash</code><br /> <code class="language-plaintext highlighter-rouge">Hash.new</code> and <code class="language-plaintext highlighter-rouge">Hash#default</code>.</li> <li><code class="language-plaintext highlighter-rouge">Fiber</code> (mrbgems/mruby-fiber)<br /> <code class="language-plaintext highlighter-rouge">Fiber.new</code>.</li> </ul> </li> </ul> <hr /> <p>We have done 321 commits to 134 files, 4,084 lines were added, 2,742 lines removed since mruby 2.1.0. For more detail of the updates, <a href="https://github.com/mruby/mruby/compare/2.1.0...2.1.1">see Commit Log</a>.</p> <p>Stay Home and enjoy <code class="language-plaintext highlighter-rouge">mruby 2.1.1</code>.</p> Thu, 04 Jun 2020 00:00:00 +0000 https://mruby.org/releases/2020/06/04/mruby-2.1.1-released.html https://mruby.org/releases/2020/06/04/mruby-2.1.1-released.html releases mruby 2.1.0 released <h1 id="mruby-210">mruby 2.1.0</h1> <p>We are proudly announcing the stable release of mruby 2.0 series - <a href="https://github.com/mruby/mruby/releases/tag/2.1.0">mruby 2.1.0</a>.<br /> The <a href="https://github.com/mruby/mruby/releases/tag/2.1.0">mruby 2.1.0</a> has been enhanced with compatibility with Ruby 2 series, and some new features of Ruby 2.7 have been added.</p> <hr /> <h1 id="new-features">New Features</h1> <h2 id="core-language-features">Core Language Features</h2> <ul> <li>Suffix support (<code class="language-plaintext highlighter-rouge">Rational</code> and <code class="language-plaintext highlighter-rouge">Complex</code> literals) (#4125)</li> </ul> <h2 id="core-libraries">Core Libraries</h2> <h3 id="ruby-27-features">Ruby 2.7 features</h3> <ul> <li>Add <code class="language-plaintext highlighter-rouge">Array#intersection</code> method which returns a new array containing elements common to both arrays. (mrbgems/mruby-array-ext)</li> <li>Add <code class="language-plaintext highlighter-rouge">Enumerable#filter_map</code> method which is a short hand for <code class="language-plaintext highlighter-rouge">filter</code> + <code class="language-plaintext highlighter-rouge">map</code> in a single call. (mrbgems/mruby-enum-ext)</li> <li>Add <code class="language-plaintext highlighter-rouge">Enumerable#tally</code> method which group and count elements of the collection. (mrbgems/mruby-enum-ext)</li> <li>Add <code class="language-plaintext highlighter-rouge">Enumerator.produce</code> method which creates an infinite enumerator from any block. (mrbgems/mruby-enumerator)</li> <li>Add <code class="language-plaintext highlighter-rouge">UnboundMethod#bind_call</code> method which call a method that overridden without allocation of intermediate Method object. (mruby-method)</li> <li><code class="language-plaintext highlighter-rouge">Module#name</code>, <code class="language-plaintext highlighter-rouge">true#to_s</code>, <code class="language-plaintext highlighter-rouge">false#to_s</code> return a frozen string. The returned string is always the same object.</li> </ul> <h3 id="ruby-26-features">Ruby 2.6 features</h3> <ul> <li>Add <code class="language-plaintext highlighter-rouge">Array#difference</code> method:<br /> <code class="language-plaintext highlighter-rouge">Array#difference</code> returns a new array that is a copy of the original array, removing any items that also appear in other_ary. (mrbgems/mruby-array-ext)</li> </ul> <h3 id="new-libraries">New Libraries</h3> <ul> <li>Add <code class="language-plaintext highlighter-rouge">mrbgems/mruby-rational</code>:<br /> <code class="language-plaintext highlighter-rouge">Rational</code> class has been included into the core library, and rational numbers like <code class="language-plaintext highlighter-rouge">1/3</code> can be handled.</li> <li>Add <code class="language-plaintext highlighter-rouge">mrbgems/mruby-complex</code>:<br /> <code class="language-plaintext highlighter-rouge">Complex</code> class has been included into the core library to handle complex numbers.</li> </ul> <h3 id="new-c-apis">New C APIs</h3> <h4 id="macros-for-checking-object-type">Macros for checking object type</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">mrb_false_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_true_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_free_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_object_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_class_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_module_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_iclass_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_sclass_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_proc_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_range_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_file_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_env_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_data_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_fiber_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_istruct_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="n">mrb_break_p</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> </code></pre></div></div> <h4 id="mruby-core-mrubyh">mruby core (mruby.h)</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">MRB_API</span> <span class="n">mrb_int</span> <span class="nf">mrb_cmp</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">obj1</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">obj2</span><span class="p">);</span> </code></pre></div></div> <h4 id="mruby-binary-mrubydumph-mrubyireph">mruby binary (mruby/dump.h, mruby/irep.h)</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">MRB_API</span> <span class="n">mrb_irep</span> <span class="o">*</span><span class="nf">mrb_read_irep_buf</span><span class="p">(</span><span class="n">mrb_state</span><span class="o">*</span><span class="p">,</span> <span class="k">const</span> <span class="kt">void</span><span class="o">*</span><span class="p">,</span> <span class="kt">size_t</span><span class="p">);</span> <span class="c1">// mruby/dump.h</span> <span class="n">MRB_API</span> <span class="n">mrb_value</span> <span class="nf">mrb_load_irep_buf</span><span class="p">(</span><span class="n">mrb_state</span><span class="o">*</span><span class="p">,</span> <span class="k">const</span> <span class="kt">void</span><span class="o">*</span><span class="p">,</span> <span class="kt">size_t</span><span class="p">);</span> <span class="c1">// mruby/irep.h</span> <span class="n">MRB_API</span> <span class="n">mrb_value</span> <span class="nf">mrb_load_irep_buf_cxt</span><span class="p">(</span><span class="n">mrb_state</span><span class="o">*</span><span class="p">,</span> <span class="k">const</span> <span class="kt">void</span><span class="o">*</span><span class="p">,</span> <span class="kt">size_t</span><span class="p">,</span> <span class="n">mrbc_context</span><span class="o">*</span><span class="p">);</span> <span class="c1">// mruby/irep.h</span> </code></pre></div></div> <h4 id="numeric-class-mrubynumerich">Numeric class (mruby/numeric.h)</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">MRB_API</span> <span class="n">mrb_value</span> <span class="nf">mrb_num_plus</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">x</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">y</span><span class="p">);</span> <span class="n">MRB_API</span> <span class="n">mrb_value</span> <span class="nf">mrb_num_minus</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">x</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">y</span><span class="p">);</span> <span class="n">MRB_API</span> <span class="n">mrb_value</span> <span class="nf">mrb_num_mul</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">x</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">y</span><span class="p">);</span> <span class="n">MRB_API</span> <span class="n">mrb_value</span> <span class="nf">mrb_int_value</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="n">mrb_float</span> <span class="n">f</span><span class="p">);</span> </code></pre></div></div> <h4 id="string-class-mrubystringh">String class (mruby/string.h)</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">MRB_API</span> <span class="kt">void</span> <span class="nf">mrb_str_modify_keep_ascii</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="k">struct</span> <span class="n">RString</span> <span class="o">*</span><span class="n">s</span><span class="p">);</span> <span class="n">MRB_API</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="nf">mrb_string_cstr</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">str</span><span class="p">);</span> </code></pre></div></div> <h4 id="mrubyvalueh">mruby/value.h</h4> <ul> <li>Add customized <code class="language-plaintext highlighter-rouge">mrb_ro_data_p()</code> (#4408)</li> </ul> <h4 id="enumerable-module-and-hash-class">Enumerable module and Hash class</h4> <ul> <li>Add <code class="language-plaintext highlighter-rouge">filter</code> aliases for <code class="language-plaintext highlighter-rouge">Enumerable</code> and <code class="language-plaintext highlighter-rouge">Hash</code>. (57a0132b)</li> </ul> <h2 id="configuration">Configuration</h2> <ul> <li>(Proof of Concept) mruby tuning profiles (#4446)</li> </ul> <h2 id="mrbtest">mrbtest</h2> <h3 id="test-features">Test Features</h3> <ul> <li>Warn if assertion is missing inside <code class="language-plaintext highlighter-rouge">assert</code> (#4320)</li> </ul> <h3 id="new-test-method-mrbtest">New test method (mrbtest)</h3> <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">assert_match</span><span class="p">(</span><span class="n">pattern</span><span class="p">,</span> <span class="n">str</span><span class="p">,</span> <span class="n">msg</span><span class="o">=</span><span class="kp">nil</span><span class="p">)</span> <span class="n">assert_not_match</span><span class="p">(</span><span class="n">pattern</span><span class="p">,</span> <span class="n">str</span><span class="p">,</span> <span class="n">msg</span><span class="o">=</span><span class="kp">nil</span><span class="p">)</span> <span class="n">assert_raise_with_message</span><span class="p">(</span><span class="n">exc</span><span class="p">,</span> <span class="n">exp_msg</span><span class="p">,</span> <span class="n">msg</span> <span class="o">=</span> <span class="kp">nil</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">block</span> <span class="n">assert_raise_with_message_pattern</span><span class="p">(</span><span class="n">exc</span><span class="p">,</span> <span class="n">exp_msg</span><span class="p">,</span> <span class="n">msg</span> <span class="o">=</span> <span class="kp">nil</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">block</span><span class="p">)</span> <span class="n">assert_not_nil</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span> </code></pre></div></div> <h2 id="tools">Tools</h2> <h3 id="interactive-mruby-mirb">Interactive mruby (mirb)</h3> <ul> <li>As with <code class="language-plaintext highlighter-rouge">irb</code> in Ruby, a local variable <code class="language-plaintext highlighter-rouge">_</code> is added to store the last result.</li> </ul> <hr /> <h1 id="update-features">Update Features</h1> <h2 id="mruby-core">mruby core</h2> <ul> <li>Allow newlines and comments between method calls. (4296c77e)</li> <li>Support <code class="language-plaintext highlighter-rouge">&amp;.</code> at the beginning of the line (4124047c)</li> </ul> <h2 id="build-system">Build system</h2> <ul> <li>Support lock file<br /> It is now possible to fix mruby and mrbgems versions in products that use mruby.</li> <li>Rename MRB_USE_ETEXT_EDATA to MRB_USE_LINK_TIME_RO_DATA_P and support lld linked programs (#4716)</li> </ul> <h2 id="c-apis">C APIs</h2> <h3 id="mruby-core-1">mruby core</h3> <ul> <li>Keyword arguments can be obtained with <code class="language-plaintext highlighter-rouge">mrb_get_args</code> using the format string <code class="language-plaintext highlighter-rouge">:</code>.</li> <li><code class="language-plaintext highlighter-rouge">mrb_parser_dump</code> supports displaying <code class="language-plaintext highlighter-rouge">NODE_DSYM</code>, <code class="language-plaintext highlighter-rouge">NODE_WORDS</code>, <code class="language-plaintext highlighter-rouge">NODE_SYMBOLS</code> and <code class="language-plaintext highlighter-rouge">NODE_LITERAL_DELIM</code>.</li> <li>Raise <code class="language-plaintext highlighter-rouge">ArgumentError</code> by <code class="language-plaintext highlighter-rouge">aspec</code> check. (30f37872)</li> </ul> <h3 id="srcerrorc">src/error.c</h3> <ul> <li>Add new specifiers/modifiers to format string of <code class="language-plaintext highlighter-rouge">mrb_vfromat()</code> (#4608)</li> </ul> <h2 id="mrbtest-1">mrbtest</h2> <ul> <li>Nested <code class="language-plaintext highlighter-rouge">assert</code> for mrbtest (#4540)</li> </ul> <hr /> <h1 id="compatibility">Compatibility</h1> <h2 id="mruby-core-2">mruby core</h2> <ul> <li>Pad leading zero to month and day in <code class="language-plaintext highlighter-rouge">MRUBY_RELEASE_DATE</code> (#4353)</li> </ul> <h2 id="core-libraries-1">Core Libraries</h2> <ul> <li>Add <code class="language-plaintext highlighter-rouge">Class#new(*args, &amp;block)</code> method.</li> <li>Add optional argument to <code class="language-plaintext highlighter-rouge">Module#class_variables</code>.</li> <li>Add constants for floating point number. (<code class="language-plaintext highlighter-rouge">RADIX</code>, <code class="language-plaintext highlighter-rouge">MANT_DIG</code>, <code class="language-plaintext highlighter-rouge">EPSILON</code>, <code class="language-plaintext highlighter-rouge">DIG</code>, <code class="language-plaintext highlighter-rouge">MIN_EXP</code>, <code class="language-plaintext highlighter-rouge">MIN</code>, <code class="language-plaintext highlighter-rouge">MIN_10_EXP</code>, <code class="language-plaintext highlighter-rouge">MAX_EXP</code>, <code class="language-plaintext highlighter-rouge">MAX</code>, <code class="language-plaintext highlighter-rouge">MAX_10_EXP</code>)</li> <li>Removed <code class="language-plaintext highlighter-rouge">$1</code>..<code class="language-plaintext highlighter-rouge">$9</code> from <code class="language-plaintext highlighter-rouge">Kernel#global_variables</code>.</li> <li>String#unpack/Array#pack does support base64 directive (<code class="language-plaintext highlighter-rouge">m</code>).</li> <li>Add encoding argument to <code class="language-plaintext highlighter-rouge">Integral#chr</code> (#4593)</li> <li>Fixed <code class="language-plaintext highlighter-rouge">length</code> for IO should be in bytes, not in characters (8c90b5fc)</li> </ul> <hr /> <h1 id="breaking-changes">Breaking Changes</h1> <p>There are three major breaking changes from mruby 2.0.1.</p> <h2 id="changed-methods">Changed methods</h2> <ul> <li>Move <code class="language-plaintext highlighter-rouge">Array#append</code> and <code class="language-plaintext highlighter-rouge">Array#prepend</code> from core to <code class="language-plaintext highlighter-rouge">mrbgems/mruby-ary-ext</code>.</li> <li>Move <code class="language-plaintext highlighter-rouge">Numeric#div</code> from <code class="language-plaintext highlighter-rouge">mrbgems/mruby-numeric-ext</code> to the core.</li> <li>Move <code class="language-plaintext highlighter-rouge">Integral#zero?</code>, <code class="language-plaintext highlighter-rouge">Integral#nonzero?</code>, <code class="language-plaintext highlighter-rouge">Integral#positive?</code> and <code class="language-plaintext highlighter-rouge">Integral#negative)?</code> to <code class="language-plaintext highlighter-rouge">Numeric</code> class.</li> <li>Move <code class="language-plaintext highlighter-rouge">Numeric#__coerce_step_counter</code> to <code class="language-plaintext highlighter-rouge">Integral</code> class.</li> <li>Move <code class="language-plaintext highlighter-rouge">Kernel#instance_exec</code>, <code class="language-plaintext highlighter-rouge">Kernel#equal?</code> and <code class="language-plaintext highlighter-rouge">Kernel#instance_eval</code> to <code class="language-plaintext highlighter-rouge">BasicObject</code> class.</li> <li>Move <code class="language-plaintext highlighter-rouge">NilClass#to_h</code> to <code class="language-plaintext highlighter-rouge">mrbgems/mruby-object-ext</code> from <code class="language-plaintext highlighter-rouge">mrbgems/mruby-enum-ext</code></li> <li>Move <code class="language-plaintext highlighter-rouge">String#getbyte</code>, <code class="language-plaintext highlighter-rouge">String#setbyte</code> and <code class="language-plaintext highlighter-rouge">String#byteslice</code> to the core. (#4696)</li> <li>Remove <code class="language-plaintext highlighter-rouge">Kernel#global_variables</code> from core. This method is defined in <code class="language-plaintext highlighter-rouge">mrbgems/mruby-metaprog</code>.</li> <li>Integrate <code class="language-plaintext highlighter-rouge">Integral#chr</code> (<code class="language-plaintext highlighter-rouge">Fixnum#chr</code>) to <code class="language-plaintext highlighter-rouge">mrbgems/mruby-string-ext</code>.</li> <li>Remove <code class="language-plaintext highlighter-rouge">String#=~</code> and <code class="language-plaintext highlighter-rouge">String#match</code> that requires <code class="language-plaintext highlighter-rouge">Regexp</code> (fd37bc53)</li> <li><code class="language-plaintext highlighter-rouge">Symbol#to_s</code> return a frozen string. The returned string is always the same object. This feature will be reverted next mruby, because which reverted from Ruby 2.7.</li> <li>Explicit <code class="language-plaintext highlighter-rouge">.0</code> is removed from result of <code class="language-plaintext highlighter-rouge">Float#to_s</code> and <code class="language-plaintext highlighter-rouge">Float#inspect</code>. (9d08025b)</li> </ul> <h2 id="change-c-apis">Change C APIs</h2> <ul> <li>Rename symbol-to-string functions. (#4684) <ul> <li><code class="language-plaintext highlighter-rouge">mrb_sym2name()</code> -&gt; <code class="language-plaintext highlighter-rouge">mrb_sym_name()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_sym2name_len()</code> -&gt; <code class="language-plaintext highlighter-rouge">mrb_sym_name_len()</code></li> <li><code class="language-plaintext highlighter-rouge">mrb_sym2str()</code> -&gt; <code class="language-plaintext highlighter-rouge">mrb_sym_str()</code></li> </ul> </li> </ul> <h2 id="remove-c-apis">Remove C APIs</h2> <ul> <li>Functions to remove <code class="language-plaintext highlighter-rouge">MRB_API</code> from definitions (referenced from within <code class="language-plaintext highlighter-rouge">libmruby</code>):<br /> <code class="language-plaintext highlighter-rouge">mrb_instance_new()</code>, <code class="language-plaintext highlighter-rouge">mrb_vm_define_class()</code>, <code class="language-plaintext highlighter-rouge">mrb_vm_define_module()</code></li> <li><code class="language-plaintext highlighter-rouge">struct RIstruct</code> is renamed to <code class="language-plaintext highlighter-rouge">struct RIStruct</code> (e41f1574)</li> <li>Remove <code class="language-plaintext highlighter-rouge">mrb_fixnum_plus()</code>, <code class="language-plaintext highlighter-rouge">mrb_fixnum_minus()</code>, <code class="language-plaintext highlighter-rouge">mrb_fixnum_mul()</code>, and <code class="language-plaintext highlighter-rouge">mrb_num_div()</code>. Use <code class="language-plaintext highlighter-rouge">mrb_num_plus()</code>, <code class="language-plaintext highlighter-rouge">mrb_num_minus()</code>, <code class="language-plaintext highlighter-rouge">mrb_num_mul()</code> instead.</li> <li>Remove a member <code class="language-plaintext highlighter-rouge">ary</code> of <code class="language-plaintext highlighter-rouge">struct RString</code>. <code class="language-plaintext highlighter-rouge">struct RStringEmbed</code> is used for String embedding. (#4646)</li> </ul> <h2 id="mruby-core-3">mruby core</h2> <ul> <li>Remove global variable <code class="language-plaintext highlighter-rouge">$/</code>. The current Ruby policy do not encourage Perl-ish global variables.</li> <li>Remove <code class="language-plaintext highlighter-rouge">MRB_TT_HAS_BASIC</code> macro. (#4728)</li> <li>Remove members <code class="language-plaintext highlighter-rouge">flags</code> and <code class="language-plaintext highlighter-rouge">mems</code> of <code class="language-plaintext highlighter-rouge">struct mrb_state</code>. (0c5f26e0 and #4470)</li> </ul> <h2 id="configuration-1">Configuration</h2> <ul> <li>Remove <code class="language-plaintext highlighter-rouge">MRB_METHOD_TABLE_INLINE</code> and <code class="language-plaintext highlighter-rouge">MRB_NO_INIT_ARRAY_START</code>. (2256bb07 and #4716)</li> <li><code class="language-plaintext highlighter-rouge">MRB_USE_ETEXT_EDATA</code> is deprecated (warned and ignored). instead, use <code class="language-plaintext highlighter-rouge">MRB_USE_LINK_TIME_RO_DATA_P</code>. (#4716)</li> </ul> <h2 id="mruby-binary-mrb">mruby binary (MRB)</h2> <ul> <li>Remove “LINE” section reader. (#4455)</li> </ul> <hr /> <h1 id="major-bug-fixes">Major bug fixes</h1> <ul> <li><code class="language-plaintext highlighter-rouge">SystemStackError</code> is raised from <code class="language-plaintext highlighter-rouge">String#=~</code>. (#4363)</li> <li>Null pointer dereference in ecall. (#4370)</li> <li>mismatched shift functions. (#4380)</li> <li>Compilation error with “MRB_ARY_EMBED_LEN_MAX” in “array.h”. (#4382)</li> <li>Fixed a bug in recursive <code class="language-plaintext highlighter-rouge">mrb_top_run</code> calls; fix (#4384)</li> <li>Unexpected error: <code class="language-plaintext highlighter-rouge">Can't get cfunc env from non-cfunc proc.</code> (#4389)</li> <li>build error on master by MRB_WITHOUT_FLOAT. (#4478)</li> <li>Null pointer dereference in mrb_str_cat_str. (#4504)</li> <li>Some comments do not increment lineno on context. (#4513)</li> <li>Null pointer dereference in mrb_check_frozen. (#4519)</li> <li>Invalid read in mrb_class. (#4534)</li> <li>Array#inspect recurses too much for self-referential arrays. (#4552)</li> <li>Infinite loop in Integer#step when both args are INFINITY. (#4555)</li> <li>Float#round hangs for large ndigits. (#4566)</li> <li>Cannot call <code class="language-plaintext highlighter-rouge">Fiber.yield</code> in method. (#4567)</li> <li>Reference to top-level variable in top-level block is broken. (#4581)</li> <li>Bugs with mutually recursive Array and Hash. (#4582)</li> <li><code class="language-plaintext highlighter-rouge">mrb_gc_unregister()</code> may access freed memory. (#4618)</li> <li>memcpy-param-overlap in str_replace_partial. (#4627)</li> <li>Symbol#inspect does not handle Unicode characters. (#4678)</li> <li>mrb_funcall returns odd value. (#4696)</li> <li>behavior of alias is different from CRuby. (#4718)</li> <li>compile error at master by clang 9. (#4786)</li> </ul> <hr /> <p>We have done 912 commits to 229 files, 12,006 lines were added, 5,382 lines removed since mruby 2.0.1. For more detail of the updates, <a href="https://github.com/mruby/mruby/compare/2.0.1...stable">see Commit Log</a>.</p> <p>Let’s try <code class="language-plaintext highlighter-rouge">mruby 2.1.0</code>.</p> Tue, 19 Nov 2019 00:00:00 +0000 https://mruby.org/releases/2019/11/19/mruby-2.1.0-released.html https://mruby.org/releases/2019/11/19/mruby-2.1.0-released.html releases mruby 2.0.1 released <h1 id="mruby-201">mruby 2.0.1</h1> <p>We are proudly announcing the stable release of mruby 2.0 series - mruby 2.0.1.</p> <hr /> <h2 id="new-features">New Features</h2> <h3 id="core-language-features">Core Language Features</h3> <ul> <li>Support string literal concatenation.</li> </ul> <h3 id="core-libraries">Core Libraries</h3> <h4 id="ruby-26-features">Ruby 2.6 Features</h4> <ul> <li>Add <code class="language-plaintext highlighter-rouge">Enumerator::Chain</code>, <code class="language-plaintext highlighter-rouge">Enumerable#chain</code> and <code class="language-plaintext highlighter-rouge">Enumerator#+</code>.</li> <li>Add function composition operators <code class="language-plaintext highlighter-rouge">&lt;&lt;</code> and <code class="language-plaintext highlighter-rouge">&gt;&gt;</code> to <code class="language-plaintext highlighter-rouge">Proc</code> and <code class="language-plaintext highlighter-rouge">Method</code>.</li> </ul> <h4 id="compatibility">Compatibility</h4> <ul> <li>Recover methods removed in mruby 2.0.0. <code class="language-plaintext highlighter-rouge">String#to_str</code>, <code class="language-plaintext highlighter-rouge">Integer#to_int</code>, <code class="language-plaintext highlighter-rouge">Float#to_int</code></li> <li>Improve compatibility to CRuby for <code class="language-plaintext highlighter-rouge">Float#to_s</code> <a href="https://github.com/mruby/mruby/pull/4225">#4225</a></li> </ul> <h4 id="mruby-class-ext">mruby-class-ext</h4> <ul> <li>Add methods.<br /> <code class="language-plaintext highlighter-rouge">Module#&lt;</code>, <code class="language-plaintext highlighter-rouge">Module&lt;=</code>, <code class="language-plaintext highlighter-rouge">Module&gt;</code>, <code class="language-plaintext highlighter-rouge">Module&gt;=</code>, <code class="language-plaintext highlighter-rouge">Module&lt;=&gt;</code></li> </ul> <h4 id="mruby-pack">mruby-pack</h4> <ul> <li>Support Big-endian platform.</li> </ul> <h3 id="tools">Tools</h3> <h4 id="mruby-debugger-mrdb">mruby debugger (mrdb)</h4> <ul> <li>Add <code class="language-plaintext highlighter-rouge">info locals</code> command.</li> </ul> <h3 id="new-c-apis">New C APIs</h3> <h4 id="mruby-core">mruby core</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">MRB_API</span> <span class="n">mrb_value</span> <span class="nf">mrb_ary_splice</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">self</span><span class="p">,</span> <span class="n">mrb_int</span> <span class="n">head</span><span class="p">,</span> <span class="n">mrb_int</span> <span class="n">len</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">rpl</span><span class="p">);</span> <span class="n">MRB_API</span> <span class="kt">void</span> <span class="nf">mrb_notimplement</span><span class="p">(</span><span class="n">mrb_state</span><span class="o">*</span><span class="p">);</span> <span class="n">MRB_API</span> <span class="n">mrb_value</span> <span class="nf">mrb_vformat</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">format</span><span class="p">,</span> <span class="kt">va_list</span> <span class="n">ap</span><span class="p">);</span> </code></pre></div></div> <h4 id="string-class">String class</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">MRB_API</span> <span class="kt">double</span> <span class="nf">mrb_cstr_to_dbl</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">mrb_bool</span> <span class="n">badcheck</span><span class="p">);</span> <span class="n">MRB_API</span> <span class="n">mrb_value</span> <span class="nf">mrb_cstr_to_inum</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="n">mrb_int</span> <span class="n">base</span><span class="p">,</span> <span class="n">mrb_bool</span> <span class="n">badcheck</span><span class="p">);</span> </code></pre></div></div> <h4 id="hash-class">Hash class</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">MRB_API</span> <span class="kt">void</span> <span class="nf">mrb_hash_foreach</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="k">struct</span> <span class="n">RHash</span> <span class="o">*</span><span class="n">hash</span><span class="p">,</span> <span class="n">mrb_hash_foreach_func</span> <span class="o">*</span><span class="n">func</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">p</span><span class="p">);</span> <span class="n">MRB_API</span> <span class="n">mrb_int</span> <span class="nf">mrb_hash_size</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">hash</span><span class="p">);</span> </code></pre></div></div> <h4 id="object-class">Object class</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">MRB_API</span> <span class="kt">void</span> <span class="nf">mrb_iv_foreach</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="n">mrb_value</span> <span class="n">obj</span><span class="p">,</span> <span class="n">mrb_iv_foreach_func</span> <span class="o">*</span><span class="n">func</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">p</span><span class="p">);</span> </code></pre></div></div> <h4 id="time-class">Time class</h4> <div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">MRB_API</span> <span class="nf">mrb_time_at</span><span class="p">(</span><span class="n">mrb_state</span> <span class="o">*</span><span class="n">mrb</span><span class="p">,</span> <span class="kt">double</span> <span class="n">sec</span><span class="p">,</span> <span class="kt">double</span> <span class="n">usec</span><span class="p">,</span> <span class="k">enum</span> <span class="n">mrb_timezone</span> <span class="n">zone</span><span class="p">);</span> </code></pre></div></div> <hr /> <h2 id="reducing-memory-consumption">Reducing Memory Consumption</h2> <ul> <li> <p>Remove symbol hash table from <code class="language-plaintext highlighter-rouge">mrb_state</code> structure.<br /> Use linear search instead. Number of symbols is usually small (&lt;1K), so we don’t need performance boost from hash tables. In our benchmark measurement, hash tables consumes 790KB for <code class="language-plaintext highlighter-rouge">build/full-debug/mrbtest</code>.</p> </li> <li> <p>Implement inline packed symbols.<br /> Small symbols with all alphanumeric characters (&lt;5) are packed in 32bit symbol integer a la base64.<br /> This means those small symbols are not listed in <code class="language-plaintext highlighter-rouge">Symbol.all_symbols</code>.</p> </li> </ul> <hr /> <h2 id="breaking-changes">Breaking Changes</h2> <p>There are three major breaking changes from mruby 2.0.0</p> <h3 id="binary-mrb-format">Binary (MRB) format</h3> <ul> <li>Change compiled binary format version. (“0005” -&gt; “0006”)</li> </ul> <h3 id="add-rrange-api">Add RRange API</h3> <p>Developers must use following APIs for accessing attributes of RRange because RRange structure depends on boxing setting.</p> <ul> <li>mrb_range_beg</li> <li>mrb_range_end</li> <li>mrb_range_excl_p</li> </ul> <h3 id="remove-c-api">Remove C API</h3> <ul> <li>Functions to be made <code class="language-plaintext highlighter-rouge">static</code> (<code class="language-plaintext highlighter-rouge">MRB_API</code> was not needed):<br /> <code class="language-plaintext highlighter-rouge">mrb_mod_module_function()</code>, <code class="language-plaintext highlighter-rouge">mrb_obj_hash()</code>, <code class="language-plaintext highlighter-rouge">mrb_str_len_to_inum()</code>, <code class="language-plaintext highlighter-rouge">sym2name_len()</code></li> <li>Functions to remove <code class="language-plaintext highlighter-rouge">MRB_API</code> from definitions (referenced from within <code class="language-plaintext highlighter-rouge">libmruby</code>):<br /> <code class="language-plaintext highlighter-rouge">mrb_mod_cv_defined()</code>, <code class="language-plaintext highlighter-rouge">mrb_mod_cv_get()</code>, <code class="language-plaintext highlighter-rouge">mrb_f_send()</code></li> </ul> <h3 id="small-incompatible-changes-in-function-prototypes">Small incompatible changes in function prototypes</h3> <ul> <li><code class="language-plaintext highlighter-rouge">mrb_parser_get_filename</code>: return value changed to <code class="language-plaintext highlighter-rouge">mrb_sym</code>.</li> <li><code class="language-plaintext highlighter-rouge">mrb_debug_get_filename</code>: add <code class="language-plaintext highlighter-rouge">mrb_state*</code> as a first argument.</li> <li><code class="language-plaintext highlighter-rouge">mrb_debug_get_line</code>: ditto.</li> </ul> <h3 id="remove-methods">Remove methods</h3> <ul> <li>Remove <code class="language-plaintext highlighter-rouge">Kernel#class_defined?</code> which is not available in CRuby; <a href="https://github.com/mruby/mruby/issues/3829">#3829</a></li> </ul> <hr /> <h2 id="major-bug-fixes">Major bug fixes</h2> <ul> <li>Fixed a bug on platforms without <code class="language-plaintext highlighter-rouge">BYTE_ORDER</code>; fix <a href="https://github.com/mruby/mruby/issues/4190">#4190</a></li> <li>Fix 0.0 and -0.0 handling.</li> <li>Fix dump/load float literal evaluate to infinity.</li> <li>Fix <code class="language-plaintext highlighter-rouge">Symbol#size</code> for multi-byte characters with <code class="language-plaintext highlighter-rouge">MRB_UTF8_STRING</code>.</li> <li>Add <code class="language-plaintext highlighter-rouge">OP_ENTER</code> to blocks without parameters; fix <a href="https://github.com/mruby/mruby/issues/4175">#4175</a></li> <li>Should not check non-node value to <code class="language-plaintext highlighter-rouge">void_expr_error</code>; fix <a href="https://github.com/mruby/mruby/issues/4175">#4203</a> <a href="https://github.com/mruby/mruby/issues/4192">#4192</a></li> <li>Should not copy keys&amp;values when a hash table is empty; fix <a href="https://github.com/mruby/mruby/issues/4270">#4270</a></li> <li>Raise error on failed comparison in <code class="language-plaintext highlighter-rouge">sort</code>; ref <a href="https://github.com/mruby/mruby/issues/4307">#4307</a></li> <li>Fix memory leak in <code class="language-plaintext highlighter-rouge">time_update_datetime</code>; fix <a href="https://github.com/mruby/mruby/issues/4308">#4308</a></li> </ul> <hr /> <p>We have done 371 commits to 163 files, 2,397 lines were added, 1,570 lines removed since mruby 2.0.0. For more detail of the updates, <a href="https://github.com/mruby/mruby/compare/2.0.0...2.0.1">see Commit Log</a>.</p> <h2 id="evaluated-mrbgems-list-npo-mruby-forum">Evaluated mrbgems list (NPO mruby forum)</h2> <p><a href="http://forum.mruby.org/download/index201EN.html">See the list</a>.</p> <p>Let’s try <code class="language-plaintext highlighter-rouge">mruby 2.0.1</code>.</p> Thu, 04 Apr 2019 00:00:00 +0000 https://mruby.org/releases/2019/04/04/mruby-2.0.1-released.html https://mruby.org/releases/2019/04/04/mruby-2.0.1-released.html releases mruby 2.0.0 released <h1 id="mruby-200">mruby 2.0.0</h1> <p>We are proudly announcing the first stable release of mruby 2.0 series – mruby 2.0.0.</p> <p>This release includes the improvement of Ruby2.x compatibility and memory consumption.</p> <hr /> <h2 id="new-features">New Features</h2> <h3 id="core-language-features">Core Language Features</h3> <ul> <li>Keyword Arguments Implemented (Ruby 2.0 Compatible)</li> <li>Argument Deconstructing Implemented</li> </ul> <h3 id="core-libraries">Core Libraries</h3> <h4 id="mruby-kernel-ext">mruby-kernel-ext</h4> <ul> <li><code class="language-plaintext highlighter-rouge">Kernel#then</code> was added as <code class="language-plaintext highlighter-rouge">Kernel#yield_self</code> (Ruby 2.6 Compatible)</li> </ul> <h4 id="mruby-array-ext">mruby-array-ext</h4> <ul> <li><code class="language-plaintext highlighter-rouge">Array#to_h</code> can be called with a block (Ruby 2.6 Compatible)</li> <li><code class="language-plaintext highlighter-rouge">Array#union</code> was added (Ruby 2.6 Compatible)</li> </ul> <h4 id="mruby-string-ext">mruby-string-ext</h4> <ul> <li><code class="language-plaintext highlighter-rouge">String#lines</code> can be called with a block</li> <li>The following methods are added <code class="language-plaintext highlighter-rouge">String#tr</code>, <code class="language-plaintext highlighter-rouge">String#tr!</code>, <code class="language-plaintext highlighter-rouge">String#tr_s</code>, <code class="language-plaintext highlighter-rouge">String#tr_s!</code>, <code class="language-plaintext highlighter-rouge">String#squeeze</code>, <code class="language-plaintext highlighter-rouge">String#squeeze!</code>, <code class="language-plaintext highlighter-rouge">String#count</code>, <code class="language-plaintext highlighter-rouge">String#delete</code>, <code class="language-plaintext highlighter-rouge">String#delete!</code></li> </ul> <h4 id="mruby-pack">mruby-pack</h4> <ul> <li><code class="language-plaintext highlighter-rouge">String#unpack1</code> was added</li> </ul> <h4 id="mruby-metaprog">mruby-metaprog</h4> <p>Meta-programming features are separated as a mrbgem. You need to link <code class="language-plaintext highlighter-rouge">mruby-metaprog</code> to use meta-programming. (See <code class="language-plaintext highlighter-rouge">Breaking Changes</code> for more detail)</p> <h4 id="mruby-sleep">mruby-sleep</h4> <p><a href="https://github.com/matsumotory/mruby-sleep">matsumotory/mruby-sleep</a> was bundled as a core library. You can use <code class="language-plaintext highlighter-rouge">Kernel#sleep</code> and <code class="language-plaintext highlighter-rouge">Kernel#usleep</code> methods.</p> <h3 id="tools">Tools</h3> <h4 id="mruby-compiler-mrbc">mruby compiler (mrbc)</h4> <ul> <li><code class="language-plaintext highlighter-rouge">--remove-lv</code> option was added By specifying <code class="language-plaintext highlighter-rouge">--remove-lv</code>, 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.</li> </ul> <h4 id="mruby-interpreter-mruby">mruby interpreter (mruby)</h4> <ul> <li><code class="language-plaintext highlighter-rouge">-d</code> option was added By specifying <code class="language-plaintext highlighter-rouge">-d</code>, mruby execute the script in the debugging mode ($DEBUG=true).</li> <li><code class="language-plaintext highlighter-rouge">-r</code> option was added By specifying <code class="language-plaintext highlighter-rouge">-r library</code>, mruby loads the specified library before the execution.</li> </ul> <h4 id="interactive-mruby-mirb">interactive mruby (mirb)</h4> <ul> <li><code class="language-plaintext highlighter-rouge">-d</code> option was added (Behaves as <code class="language-plaintext highlighter-rouge">mruby -d</code>)</li> <li><code class="language-plaintext highlighter-rouge">-r</code> option was added (Behaves as <code class="language-plaintext highlighter-rouge">mruby -r</code>)</li> </ul> <hr /> <h2 id="reducing-memory-consumption">Reducing Memory Consumption</h2> <p>Several improvements were done in mruby 2.0.0 to reduce memory consumption:</p> <ul> <li>Instance variables are stored in segmented lists</li> <li>Hash implementation replaced from khash</li> <li><code class="language-plaintext highlighter-rouge">--remove-lv</code> option was added to mruby compiler(mrbc)</li> <li>And smaller improvements including VM stack and call frames.</li> </ul> <hr /> <h2 id="breaking-changes">Breaking Changes</h2> <p>There are two major breaking changes from mruby 1.4.1</p> <h3 id="1-bytecode-overhauled">1. Bytecode Overhauled</h3> <p>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.</p> <ul> <li>Binary Format Version: <code class="language-plaintext highlighter-rouge">0005</code></li> <li>VM Version: <code class="language-plaintext highlighter-rouge">0002</code></li> </ul> <h3 id="2-meta-programming-features-separated-as-mrbgem">2. Meta-programming features separated as mrbgem</h3> <p>From the assumption that meta-programming features are not frequently used in embedded system development, we separated meta-programming features as a mebgem (<code class="language-plaintext highlighter-rouge">mruby-metaprog</code>). The following methods have moved to <code class="language-plaintext highlighter-rouge">mruby-metaprog</code> gem.</p> <ul> <li> <p>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</p> </li> <li> <p>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</p> </li> <li> <p>Module class (Singleton Methods)<br /> constants, nesting</p> </li> </ul> <h3 id="3-no-implicit-conversion-by-to_int-and-to_str">3. No implicit conversion by <code class="language-plaintext highlighter-rouge">to_int</code> and <code class="language-plaintext highlighter-rouge">to_str</code>.</h3> <h2 id="the-objects-with-methods-to_int-or-to_str-are-no-longer-converted-to-integers-or-strings-respectively-those-implicit-conversions-cause-recursive-vm-calls-and-had-been-the-source-of-many-bugs">The objects with methods <code class="language-plaintext highlighter-rouge">to_int</code> or <code class="language-plaintext highlighter-rouge">to_str</code> are no longer converted to Integers or Strings respectively. Those implicit conversions cause recursive VM calls and had been the source of many bugs.</h2> <p>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 <a href="https://github.com/mruby/mruby/compare/1.4.1...2.0.0">Commit Log</a>.</p> <h2 id="evaluated-mrbgems-list-npo-mruby-forum">Evaluated mrbgems list (NPO mruby forum)</h2> <p><a href="http://forum.mruby.org/download/index2EN.html">See the list</a>.</p> Tue, 11 Dec 2018 00:00:00 +0000 https://mruby.org/releases/2018/12/11/mruby-2.0.0-released.html https://mruby.org/releases/2018/12/11/mruby-2.0.0-released.html releases mruby 1.4.1 released <h1 id="mruby-141-released">mruby 1.4.1 released</h1> <p>mruby 1.4.1 is released. Download <a href="https://github.com/mruby/mruby/archive/1.4.1.zip">mruby 1.4.1</a> now.</p> <h2 id="mruby-141-by-the-numbers">mruby 1.4.1 by the numbers</h2> <ul> <li>1,106 commits</li> <li>289 issues fixed</li> <li>104 pull requests merged</li> <li>18 <a href="https://github.com/mruby/mruby/graphs/contributors">contributors</a></li> <li>215 changed files</li> <li>15,199 additions(+)</li> <li>3,029 deletions(-)</li> </ul> <p><a href="https://github.com/mruby/mruby/compare/1.3.0...1.4.1">See the full diff</a>.</p> <h2 id="whats-new-in-mruby-141">What’s new in mruby 1.4.1</h2> <h3 id="-debugger-bug-and-lots-of-small-bug-fixes">* Debugger bug and lots of small bug fixes</h3> <h3 id="-new-mrbgems-merge-from-httpsgithubcomiij">* New mrbgems (merge from https://github.com/iij)</h3> <ul> <li>mruby-io</li> <li>mruby-socket</li> <li>mruby-pack</li> </ul> <h3 id="-supports-several-ruby-2x-methods">* Supports several Ruby 2.x methods</h3> <ul> <li>Comparable#clamp (Ruby 2.4)</li> <li>Comparable#uniq (Ruby 2.4)</li> <li>Hash#fetch_values (Ruby 2.3)</li> <li>Hash#slice (Ruby 2.5)</li> <li>Hash#to_proc (Ruby 2.3)</li> <li>Kernel#itself (Ruby 2.2)</li> <li>Kernel#yield_self (Ruby 2.5)</li> <li>Numeric#finite? (Ruby 2.4)</li> <li>Numeric#infinite? (Ruby 2.4)</li> <li>Numeric#negative? (Ruby 2.3)</li> <li>Numeric#positive? (Ruby 2.3)</li> <li>String#delete_prefix (Ruby 2.5)</li> <li>String#delete_prefix! (Ruby 2.5)</li> <li>String#delete_suffix (Ruby 2.5)</li> <li>String#delete_suffix! (Ruby 2.5)</li> <li>String#casecmp? (Ruby 2.4)</li> <li>Symbol#casecmp? (Ruby 2.4)</li> </ul> <h3 id="-supports-other-methods">* Supports other methods</h3> <ul> <li>Array#combination</li> <li>Array#permutation</li> <li>Hash#compact</li> <li>Hash#transform_keys</li> <li>Hash#transform_keys!</li> <li>Hash#trans_values</li> <li>Hash#trans_values!</li> <li>Method.nesting</li> <li>main.define_method</li> <li>#module_exec</li> <li>#class_exec</li> </ul> <h3 id="-new-compile-options">* New Compile options</h3> <ul> <li>MRB_WITHOUT_FLOAT</li> <li>MRB_METHOD_CACHE</li> <li>MRB_METHOD_TABLE_INLINE</li> </ul> <h2 id="evaluated-mrbgems-list-npo-mruby-forum">Evaluated mrbgems list (NPO mruby forum)</h2> <p><a href="http://forum.mruby.org/download/index141EN.html">See the list</a>.</p> Fri, 27 Apr 2018 09:15:00 +0000 https://mruby.org/releases/2018/04/27/mruby-1.4.1-released.html https://mruby.org/releases/2018/04/27/mruby-1.4.1-released.html releases mruby 1.3.0 released <h1 id="mruby-130-released">mruby 1.3.0 released</h1> <p>mruby 1.3.0 is released. Download <a href="https://github.com/mruby/mruby/archive/1.3.0.zip">mruby 1.3.0</a> now.</p> <h2 id="mruby-130-by-the-numbers">mruby 1.3.0 by the numbers</h2> <ul> <li>1,175 commits</li> <li>248 issues fixed</li> <li>262 pull requests merged</li> <li>14 <a href="https://github.com/mruby/mruby/graphs/contributors">contributors</a></li> <li>221 changed files</li> <li>12,760 additions(+)</li> <li>3,734 deletions(-)</li> </ul> <p><a href="https://github.com/mruby/mruby/compare/1.2.0...1.3.0">See the full diff</a>.</p> <h2 id="whats-new-in-mruby-130">What’s new in mruby 1.3.0</h2> <h3 id="the-safe-navigation-operator-">The safe navigation operator (<code class="language-plaintext highlighter-rouge">&amp;.</code>)</h3> <p>mruby 1.3 now supports the safe navigation operator (<code class="language-plaintext highlighter-rouge">&amp;.</code>) to help handle nil value returned from methods. This feature comes from Ruby 2.3.</p> <p>By using the safe navigation operator, you can simply write</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>account&amp;.owner&amp;.address </code></pre></div></div> <p>Instead of writing</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>account &amp;&amp; account.owner &amp;&amp; account.owner.address </code></pre></div></div> <p>Or (with ActiveSupport)</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>account.try(:owner).try(:address) </code></pre></div></div> <h3 id="arraydig-hashdig"><code class="language-plaintext highlighter-rouge">Array#dig</code>, <code class="language-plaintext highlighter-rouge">Hash#dig</code></h3> <p><code class="language-plaintext highlighter-rouge">#dig</code> is a method to retrieve a value from JSON-like nested Array/Hash structures.</p> <p>This feature also comes from Ruby 2.3.</p> <p>For example:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>params.dig(:account, :owner, :address) </code></pre></div></div> <p>Instead of</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>account = params[:account] owner = account[:owner] owner[:address] </code></pre></div></div> <h3 id="objectfreeze"><code class="language-plaintext highlighter-rouge">Object#freeze</code></h3> <p>You can now “freeze” an object by using Object#freeze.</p> <p>Frozen objects cannot be modified.</p> <h3 id="kernelcaller"><code class="language-plaintext highlighter-rouge">Kernel#caller</code></h3> <p>You can retrieve call frame information by using <code class="language-plaintext highlighter-rouge">Kernel#caller</code>.</p> <h2 id="remaining-bugs">Remaining Bugs</h2> <p>After the code-freeze of 1.3 release, following issues are filed and fixed in the master branch.</p> <ul> <li><a href="https://github.com/mruby/mruby/issues/3711">#3711</a></li> <li><a href="https://github.com/mruby/mruby/issues/3712">#3712</a></li> <li><a href="https://github.com/mruby/mruby/issues/3714">#3714</a></li> <li><a href="https://github.com/mruby/mruby/issues/3715">#3715</a></li> <li><a href="https://github.com/mruby/mruby/issues/3716">#3716</a></li> <li><a href="https://github.com/mruby/mruby/issues/3717">#3717</a></li> <li><a href="https://github.com/mruby/mruby/issues/3719">#3719</a></li> <li><a href="https://github.com/mruby/mruby/issues/3720">#3720</a></li> <li><a href="https://github.com/mruby/mruby/issues/3721">#3721</a></li> <li><a href="https://github.com/mruby/mruby/issues/3722">#3722</a></li> <li><a href="https://github.com/mruby/mruby/issues/3723">#3723</a></li> <li><a href="https://github.com/mruby/mruby/issues/3724">#3724</a></li> </ul> <p>The following issues are not yet fixed as of 2017-07-04.</p> <ul> <li><a href="https://github.com/mruby/mruby/issues/2720">#2720</a></li> <li><a href="https://github.com/mruby/mruby/issues/3629">#3629</a></li> <li><a href="https://github.com/mruby/mruby/issues/3710">#3710</a></li> </ul> Tue, 04 Jul 2017 09:15:00 +0000 https://mruby.org/releases/2017/07/04/mruby-1.3.0-released.html https://mruby.org/releases/2017/07/04/mruby-1.3.0-released.html releases mruby 1.2.0 released <h1 id="mruby-120-released">mruby 1.2.0 released</h1> <p>mruby 1.2.0 is released. Download <a href="https://github.com/mruby/mruby/archive/1.2.0.zip">mruby 1.2.0</a> now.</p> <h2 id="mruby-120-by-the-numbers">mruby 1.2.0 by the numbers</h2> <ul> <li>778 commits</li> <li>24 <a href="https://github.com/mruby/mruby/graphs/contributors">contributors</a></li> <li>202 changed files</li> <li>3,947 additions(+)</li> <li>3,903 deletions(-)</li> </ul> <p><a href="https://github.com/mruby/mruby/compare/1.1.0...1.2.0">See the full diff</a>.</p> <h2 id="whats-new-in-mruby-120">What’s new in MRuby 1.2.0</h2> <p>From here, you can see the outstanding changes that made this release.</p> <p>Each entry is kept brief with a link to reference the associated ticket for more information.</p> <h3 id="language-changes">Language changes</h3> <ul> <li>Module#prepend added <ul> <li><a href="https://github.com/mruby/mruby/pull/2885">#2885</a> by <a href="https://github.com/archSeer">@archSeer</a></li> </ul> </li> <li>String#freeze added <ul> <li><a href="https://github.com/mruby/mruby/commit/1a45447b">1a45447b</a> by <a href="https://github.com/matz">@matz</a></li> </ul> </li> <li>Array#index now with block form <ul> <li><a href="https://github.com/mruby/mruby/commit/fafe86d">fafe86d</a> by <a href="https://github.com/matz">@matz</a></li> </ul> </li> </ul> <h3 id="core-classes-changes">Core classes changes</h3> <ul> <li>UTF-8 String support <ul> <li><a href="https://github.com/mruby/mruby/commit/798ec3a">798ec3a</a> by <a href="https://github.com/matz">@matz</a></li> <li>Windows support in <a href="https://github.com/mruby/mruby/pull/1822">#1822</a> by <a href="https://github.com/mattn">@mattn</a></li> </ul> </li> </ul> <h3 id="stdlib-updates">Stdlib updates</h3> <ul> <li>Add <code class="language-plaintext highlighter-rouge">mruby-error</code> mrbgem for exception handling library <ul> <li><a href="https://github.com/mruby/mruby/pull/2845">#2845</a> by <a href="https://github.com/take-cheeze">@take-cheeze</a></li> </ul> </li> <li><code class="language-plaintext highlighter-rouge">mrbtest</code> binary extracted to <code class="language-plaintext highlighter-rouge">mruby-test</code> mrbgem <ul> <li><a href="https://github.com/mruby/mruby/pull/2924">#2924</a> by <a href="https://github.com/zzak">@zzak</a></li> <li>Use <code class="language-plaintext highlighter-rouge">conf.enable_test</code> in <code class="language-plaintext highlighter-rouge">build_config.rb</code> to run tests</li> </ul> </li> <li><code class="language-plaintext highlighter-rouge">Fiber.yield</code> is now public under <code class="language-plaintext highlighter-rouge">mruby-fiber</code> mrbgem <ul> <li><a href="https://github.com/mruby/mruby/commit/28e735e">28e735e</a> by <a href="https://github.com/matz">@matz</a></li> </ul> </li> <li><code class="language-plaintext highlighter-rouge">mrbc</code> extracted as <code class="language-plaintext highlighter-rouge">mruby-bin-mrbc</code> mrbgem <ul> <li><a href="https://github.com/mruby/mruby/pull/2760">#2760</a> by <a href="https://github.com/take-cheeze">@take-cheeze</a></li> <li>Includes <code class="language-plaintext highlighter-rouge">mruby-compiler</code> mrbgem extraction</li> </ul> </li> <li>Add Hash comparison methods <ul> <li><a href="https://github.com/mruby/mruby/pull/3010">#3010</a> by <a href="https://github.com/nobu">@nobu</a></li> <li>Moved to <code class="language-plaintext highlighter-rouge">mruby-hash-ext</code> mrbgem in <a href="https://github.com/mruby/mruby/commit/fa86026">fa86026</a> by <a href="https://github.com/matz">@matz</a></li> </ul> </li> <li>Add String#prepend to <code class="language-plaintext highlighter-rouge">mruby-string-ext</code> mrbgem <ul> <li><a href="https://github.com/mruby/mruby/pull/2674">#2674</a> by <a href="https://github.com/suzukaze">@suzukaze</a></li> </ul> </li> <li>Add String#insert to <code class="language-plaintext highlighter-rouge">mruby-string-ext</code> mrbgem <ul> <li><a href="https://github.com/mruby/mruby/pull/2669">#2669</a> by <a href="https://github.com/suzukaze">@suzukaze</a></li> </ul> </li> <li>Add String#ljust to <code class="language-plaintext highlighter-rouge">mruby-string-ext</code> mrbgem <ul> <li><a href="https://github.com/mruby/mruby/pull/2700">#2700</a> by <a href="https://github.com/takahashim">@takahashim</a></li> </ul> </li> <li>Add String#upto to <code class="language-plaintext highlighter-rouge">mruby-string-ext</code> mrbgem <ul> <li><a href="https://github.com/mruby/mruby/pull/2701">#2701</a> by <a href="https://github.com/suzukaze">@suzukaze</a></li> </ul> </li> <li>Add String#setbyte and String#byteslice to <code class="language-plaintext highlighter-rouge">mruby-string-ext</code> mrbgem <ul> <li><a href="https://github.com/mruby/mruby/commit/4fdf492">4fdf492</a> by <a href="https://github.com/matz">@matz</a></li> </ul> </li> </ul> <h3 id="c-api-updates">C API updates</h3> <ul> <li>Rename <code class="language-plaintext highlighter-rouge">DISABLE_STDIO</code> -&gt; <code class="language-plaintext highlighter-rouge">MRB_DISABLE_STDIO</code> <ul> <li>Also renamed <code class="language-plaintext highlighter-rouge">ENABLE_DEBUG</code> -&gt; <code class="language-plaintext highlighter-rouge">MRB_ENABLE_DEBUG_HOOK</code></li> <li><a href="https://github.com/mruby/mruby/pull/3014">#3014</a> by <a href="https://github.com/cremno">@cremno</a></li> </ul> </li> <li>Allow specify endian in big/little and native when dumping and loading mrbc <ul> <li><a href="https://github.com/mruby/mruby/commit/bc9c47d">bc9c47d</a> by <a href="https://github.com/matz">@matz</a></li> </ul> </li> </ul> <h3 id="build-system-updates">Build system updates</h3> <ul> <li>Add <code class="language-plaintext highlighter-rouge">:mgem</code> option for loading gems from <code class="language-plaintext highlighter-rouge">mgem-list</code> <ul> <li><a href="https://github.com/mruby/mruby/pull/2846">#2846</a> by <a href="https://github.com/take-cheeze">@take-cheeze</a></li> </ul> </li> <li>Allow <code class="language-plaintext highlighter-rouge">mrblib</code> and <code class="language-plaintext highlighter-rouge">test</code> directories to have subdirs. <ul> <li><a href="https://github.com/mruby/mruby/pull/2943">#2943</a> by <a href="https://github.com/zzak">@zzak</a></li> </ul> </li> <li>Allow <code class="language-plaintext highlighter-rouge">bintest</code> to have subdirs <ul> <li><a href="https://github.com/mruby/mruby/pull/2927">#2927</a> by <a href="https://github.com/hone">@hone</a></li> </ul> </li> <li>Able to source mrbgems using <code class="language-plaintext highlighter-rouge">:path</code> option <ul> <li><a href="https://github.com/mruby/mruby/pull/2907">#2907</a> by <a href="https://github.com/hone">@hone</a></li> </ul> </li> <li>Add <code class="language-plaintext highlighter-rouge">host_target</code> and <code class="language-plaintext highlighter-rouge">build_target</code> param to <code class="language-plaintext highlighter-rouge">MRuby::CrossBuild</code> instance <ul> <li>Useful for cross-compiling native extension</li> <li><a href="https://github.com/mruby/mruby/pull/2857">#2857</a> by <a href="https://github.com/hone">@hone</a></li> </ul> </li> <li>Allow customize bin install path using <code class="language-plaintext highlighter-rouge">INSTALL_DIR</code> environment variable <ul> <li><a href="https://github.com/mruby/mruby/pull/2949">#2949</a> by <a href="https://github.com/tatsuhiro-t">@tatsuhiro-t</a></li> </ul> </li> <li>Docs changed to yard-mruby and extracted to website <ul> <li><a href="https://github.com/mruby/mruby/pull/2984">#2984</a> by <a href="https://github.com/sagmor">@sagmor</a></li> </ul> </li> <li>Distribute MRuby’s source as a Ruby gem <ul> <li><a href="https://github.com/mruby/mruby/pull/2937">#2937</a> by <a href="https://github.com/sagmor">@sagmor</a></li> </ul> </li> </ul> Wed, 18 Nov 2015 12:13:55 +0000 https://mruby.org/releases/2015/11/18/mruby-1.2.0-released.html https://mruby.org/releases/2015/11/18/mruby-1.2.0-released.html releases mruby 1.1.0 released <h1 id="mruby-110-released">mruby 1.1.0 released</h1> <p>mruby 1.1.0 is released. Download <a href="https://github.com/mruby/mruby/archive/1.1.0.zip">mruby 1.1.0</a> now.</p> <h1 id="whats-new-in-mruby-110">what’s new in mruby 1.1.0</h1> <ul> <li>CUI debugger gem (mruby-bin-debugger)</li> <li>lot of small bug fixes</li> </ul> Wed, 19 Nov 2014 12:13:55 +0000 https://mruby.org/releases/2014/11/19/mruby-1.1.0-released.html https://mruby.org/releases/2014/11/19/mruby-1.1.0-released.html releases mruby 1.0.0 released <h1 id="mruby-100-released">mruby 1.0.0 released</h1> <p>The first release of mruby is now available. Download <a href="https://github.com/mruby/mruby/archive/1.0.0.zip">mruby 1.0.0</a> now.</p> Sun, 09 Feb 2014 10:13:55 +0000 https://mruby.org/releases/2014/02/09/mruby-1.0.0-released.html https://mruby.org/releases/2014/02/09/mruby-1.0.0-released.html releases