Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review a draft of mruby 2.0.1 release note #4359

Closed
mimaki opened this issue Apr 5, 2019 · 9 comments

Comments

Projects
None yet
4 participants
@mimaki
Copy link
Contributor

commented Apr 5, 2019

I made a draft of mruby 2.0.1 release note.
Please review.


mruby 2.0.1

We are proudly annoucing the stable release of mruby 2.0 series - mruby 2.0.1.


New Features

Core Language Features

  • Support string literal concatenation.

Core Libraries

Ruby 2.6 Features

  • Add Enumerator::Chain, Enumerable#chain and Enumerator#+.
  • Add function composition operators << and >> to Proc and Method.

Compatibility

  • Recover methods removed in mruby 2.0.0.
    String#to_str, Integer#to_int, Float#to_int
  • Improve compatibility to CRuby for Float#to_s #4225

mruby-class-ext

  • Add methods.
    Module#<, Module<=, Module>, Module>=, Module<=>

mruby-pack

  • Support Big-endian platform.

Tools

mruby debugger (mrdb)

  • Add info locals command.

New C APIs

mruby core

MRB_API mrb_value mrb_ary_splice(mrb_state *mrb, mrb_value self, mrb_int head, mrb_int len, mrb_value rpl);
MRB_API void mrb_notimplement(mrb_state*);
MRB_API mrb_value mrb_vformat(mrb_state *mrb, const char *format, va_list ap);

String class

MRB_API double mrb_cstr_to_dbl(mrb_state *mrb, const char *s, mrb_bool badcheck);
MRB_API mrb_value mrb_cstr_to_inum(mrb_state *mrb, const char *s, mrb_int base, mrb_bool badcheck);

Hash class

MRB_API void mrb_hash_foreach(mrb_state *mrb, struct RHash *hash, mrb_hash_foreach_func *func, void *p);
MRB_API mrb_int mrb_hash_size(mrb_state *mrb, mrb_value hash);

Object class

MRB_API void mrb_iv_foreach(mrb_state *mrb, mrb_value obj, mrb_iv_foreach_func *func, void *p);

Time class

MRB_API mrb_time_at(mrb_state *mrb, double sec, double usec, enum mrb_timezone zone);

Reducing Memory Consumption

  • Remove symbol hash table from mrb_state structure.
    Use linear search instead. Number of symbols is usually small (<1K), so we don't need performance boost from hash tables. In our benchmark measurement, hash tables consumes 790KB for build/full-debug/mrbtest.

  • Implement inline packed symbols.
    Small symbols with all alphanumeric characters (<5) are packed in 32bit symbol integer a la base64.
    This means those small symbols are not listed in Symbol.all_symbols.


Breaking Changes

There are three major breaking changes from mruby 2.0.0

Binary (MRB) format

  • Change compiled binary format version. ("0005" -> "0006")

Add RRange API

Developers must use following APIs for accessing attributes of RRange because RRange structure depends on boxing setting.

  • mrb_range_beg
  • mrb_range_end
  • mrb_range_excl_p

Remove C API

  • Functions to be made static (MRB_API was not needed):
    mrb_mod_module_function(), mrb_obj_hash(), mrb_str_len_to_inum(), sym2name_len()
  • Functions to remove MRB_API from definitions (referenced from within libmruby):
    mrb_mod_cv_defined(), mrb_mod_cv_get(), mrb_f_send()

Small incompatible changes in function prototypes

  • mrb_parser_get_filename: return value changed to mrb_sym.
  • mrb_debug_get_filename: add mrb_state* as a first argument.
  • mrb_debug_get_line: ditto.

Remove methods

  • Remove Kernel#class_defined? which is not available in CRuby; #3829

Major bug fixes

  • Fixed a bug on platforms without BYTE_ORDER; fix #4190
  • Fix 0.0 and -0.0 handling.
  • Fix dump/load float leteral evaluate to infinity.
  • Fix Symbol#size for multi-byte characters with MRB_UTF8_STRING.
  • Add OP_ENTER to blocks without parameters; fix #4175
  • Should not check non-node value to void_expr_error; fix #4203 #4192
  • Should not copy keys&values when a hash table is empty; fix #4270
  • Raise error on failed comparison in sort; ref #4307
  • Fix memory leak in time_update_datetime; fix #4308

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, see Commit Log.

Let's try mruby 2.0.1.

@matz

This comment has been minimized.

Copy link
Member

commented Apr 5, 2019

LGTM

@shuujii

This comment has been minimized.

Copy link
Contributor

commented Apr 5, 2019

Description about #4209 might be needed because it includes breaking changes.

@shuujii

This comment has been minimized.

Copy link
Contributor

commented Apr 5, 2019

  • It might be better to describe about #4225 because previously we couldn't
    distinguish between Integer and Float.

  • Description about #4340 seems unneeded because it's a bug related to a new
    feature.

@matz

This comment has been minimized.

Copy link
Member

commented Apr 5, 2019

@shuujii Agreed for both of your points.

@dearblue

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2019

I think that it is better to include in "Breaking Changes" that mruby-bin-mruby-config has been changed to mruby-bin-config (#4238).

It may also be helpful if you have written that mruby-bin-config can be spec.add_dependency from other gems (#4273).

@shuujii

This comment has been minimized.

Copy link
Contributor

commented Apr 6, 2019

That reminds me, how did "Maybe we should drop 1.8 support soon" go?

@matz

This comment has been minimized.

Copy link
Member

commented Apr 6, 2019

After 2.0.1. We don't want a big change before the minor release.

@mimaki

This comment has been minimized.

Copy link
Contributor Author

commented Apr 8, 2019

I modified release note.

@matz

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

2.0.1 released

@matz matz closed this Apr 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.