|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "mruby 2.1.2 released" |
| 4 | +date: 2020-08-06 00:00:00 |
| 5 | +categories: releases |
| 6 | +--- |
| 7 | + |
| 8 | +# mruby 2.1.2 |
| 9 | + |
| 10 | +We are announcing the stable release of mruby 2.1 series - [mruby 2.1.2](https://github.com/mruby/mruby/releases/tag/2.1.2). |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +# New Features |
| 15 | + |
| 16 | +## Core Language Features |
| 17 | + |
| 18 | +- Support for `Argument Forwarding`, which allows you to forward argyments in the form `def foo(...)`. |
| 19 | + |
| 20 | +## mruby VM and bytecode |
| 21 | + |
| 22 | +- Add `OP_LOADI16` instruction that loads a 16-bit integer into a register. |
| 23 | +- Remove endian information/flags from compiled binary format. |
| 24 | +- The version of the mruby binary has changed from `0006` to `0007`. |
| 25 | + |
| 26 | +## for mruby Developer |
| 27 | + |
| 28 | +- Add new C APIs. |
| 29 | + - `mrb_float_to_cstr()` - Convert Float to C String. |
| 30 | + - `mrb_singleton_class_ptr()` - Get pointer of Singleton class. [#4973](https://github.com/mruby/mruby/pull/4973) |
| 31 | + - `mrb_utf8len()` - Get size of UTF-8 string. [#4712](https://github.com/mruby/mruby/pull/4712) |
| 32 | + - `mrb_utf8_strlen()` - Get length of UTF-8 string. [#4712](https://github.com/mruby/mruby/pull/4712) |
| 33 | + - `mrb_get_arg1()` - Retrieve the first and only argument from mrb_state. |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +# Update Features |
| 38 | + |
| 39 | +## Core Libraries |
| 40 | + |
| 41 | +- Add to the libraries included by default in the mruby VM. |
| 42 | + - `mruby-eval` |
| 43 | + - `mruby-complex` |
| 44 | + - `mruby-rational` |
| 45 | +- Support `MRB_DISABLE_STDIO` for `mruby-pack` and `mruby-sprintf`. [#4954](https://github.com/mruby/mruby/pull/4954) |
| 46 | +- Support `IO#pread` and `IO#pwrite` on macOS. |
| 47 | +- Improve `Kernel.#eval` to call method with the same name as a variable name without any arguments. |
| 48 | +- `IO#readchar` supports UTF-8 characters. |
| 49 | + |
| 50 | +## Tools |
| 51 | + |
| 52 | +- Remove `-e` / `-E` options from `mrbc`. |
| 53 | + |
| 54 | +## for mruby Developer |
| 55 | + |
| 56 | +- Support width specifier with `mrb_float_to_str()`. |
| 57 | +- Support integer and float combination in `mrb_equal()`. |
| 58 | + |
| 59 | +## Improve mruby build |
| 60 | + |
| 61 | +- A mruby can be built without GNU Bison. ([a3ec6ede](https://github.com/mruby/mruby/commit/a3ec6ede)) |
| 62 | +- Supports GitHub Actions. [#4903](https://github.com/mruby/mruby/pull/4903) |
| 63 | + Execute CI of the following platforms updating the repository. |
| 64 | + - Ubuntu 16.04 |
| 65 | + - Ubuntu 18.04 (gcc) |
| 66 | + - Ubuntu 18.04 (clang) |
| 67 | + - macOS |
| 68 | + - Windows (MinGW) |
| 69 | + - Windows (Cygwin) |
| 70 | + - Windows (MSVC) |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +# Breaking Changes |
| 75 | + |
| 76 | +- `IO#readchar` returns a UTF-8 character fragment instead of `EOFError` if EOF is reached in the middle of UTF-8 characters. ([86271572]((https://github.com/mruby/mruby/commit/86271572))) |
| 77 | + This behavior is different from CRuby, but it is a mruby specification that supports either ASCII or UTF-8 exclusively. |
| 78 | +- Remove `mrb_run()` from C APIs. |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +# Major bug fixes |
| 83 | + |
| 84 | +- Segmentation fault at `mrb_io_s_select`. [#4966](https://github.com/mruby/mruby/issues/4966) |
| 85 | +- Segmentation fault at `mrb_vm_exec`. [#4973](https://github.com/mruby/mruby/issues/4973) |
| 86 | +- Some `Hash` methods are inconsistent with `values` when hash has duplicate key. [181f7b97](https://github.com/mruby/mruby/commit/181f7b97) |
| 87 | +- Get local variable names from orphan block. [#5014](https://github.com/mruby/mruby/issues/5014) |
| 88 | +- Memory leaks in some places when out of memory. [f1523d24](https://github.com/mruby/mruby/commit/f1523d24) |
| 89 | +- Heap buffer overflow in mruby interpreter. [#5042](https://github.com/mruby/mruby/issues/5042) |
| 90 | +- Type tag not used when calculating hash code. [#5049](https://github.com/mruby/mruby/issues/5049) |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +We have done 185 commits to 99 files with 14,883 addtions and 1,653 deletions since mruby 2.1.1. For more detail of the updates, [see Commit Log](https://github.com/mruby/mruby/compare/2.1.1...2.1.2). |
| 95 | + |
| 96 | +Thanks all the contributors who have worked on bug fix and improvements in the release of `mruby 2.1.2`. |
0 commit comments