mruby v1.3 ããªãªã¼ã¹ããã¾ãããã
趣å³mrubyã¦ã©ããã£ã¼ã¨ãã¦v1.2ããv1.3ã§ä½ãå¤ãã£ãã®ãããå人çã«ã¾ã¨ãã¦ã¿ããã¨æãã¾ãã
注ç®ãã¹ãã¯ããã¯ãmatzã®commitæ°ã
ãã¡ããmerge commitãå«ã¿ã¾ãããç´åæ°ã®commitãmatzã®commitã«ãªã£ã¦ãã¾ãã
ãªãmatzãããã¾ã§mrubyã«åãå ¥ããã®ãèãã¦ã¿ããã¨ããã§ããã
ããã§ã¯mruby v1.2 ããv1.3ã¸ã®å¤æ´ã§ä½ãå¤ãã£ãã®ããã¶ãã¯ãªè¦ã¦ãããã¨æãã¾ãã
ãªãªã¼ã¹ãã¼ã
http://mruby.org/releases/2017/07/04/mruby-1.3.0-released.html
1年以ä¸ãã£ãå²ã«ã¯ã表åãã«ã¯ããã¾ã§å¤åã¯ãªãæãï¼ ããã¨ææ°ã®CRubyã®ææ³ãã¡ã½ãããå ¥ã£ã¦ããããã¾ããã
Contributions
https://github.com/mruby/mruby/graphs/contributors?from=2015-11-17&to=2017-07-04
v1.2ãåºãæ¥ããv1.3ãåºãæ¥ã«ãã¦ããã®ã§è¥å¹²æ£ç¢ºã§ã¯ãªãã®ã§ããããã¯ãmatzã®commitæ°ã¯ãã³ããã§ããã
Many bug fixes
ãã¯ã注ç®ãã¹ãã¯Shopifyããã®å¤§éã®bugå ±åã¨ããããå ¨ã¦ãä¸å¯§ã«å¯¾å¿ãããmatzã®ä¿®æ£ã®å¿é ¬ã§ãããã
https://github.com/mruby/mruby/issues?q=is%3Aissue+author%3Aclayton-shopify
SEGVã®å ±åãfreeå¾ã®ã¡ã¢ãªãã確ä¿ããé åå¤ã®ã¡ã¢ãªãªã©ã触ãã¦ã¯ãããªãã¡ã¢ãªã触ãã¦ãã¾ã£ã¦ããé¨åã®ä¿®æ£ãGCã®ãã°ä¿®æ£ãæå³ããªãç¡éã«ã¼ãã®ä¿®æ£ã諸ã å«ãã¦ç´200ã®issueãä¸ããããéãããã¦ãã¾ãã
shopifyã¨mrubyã®é¢ä¿ã¯boviæ°ã®blogã詳ããã
The 500.000$ release - mruby.sh
ãã¡ãããã®ç®ç·ã§ã®å°è±¡ã¨ãã¦ã¯ãæ£ç´ããããªéç®±ã®é ã¾ã§â¦â¦ããã¨ããã±ã¼ã¹ããã£ãã®ã§ããã ã¦ã¼ã¶ã¼ã«ã³ã¼ããæ¸ãã¦ããã£ã¦å®è¡ãããããªã·ã¹ãã ã ã¨ããã¦ã¼ã¶ã¼ã«ã·ã¹ãã ãæ¢ãããããããªã³ã¼ãæ¸ãããã¨å°ããã¨ããã®ã¯åãã話ã
ãããã§mrubyæ¬ä½ãåå ã§SEGVãèµ·ãããããªã±ã¼ã¹ã¯ãéç®±ã®é ãå«ãã¦ãããæ» å¤ãªãã¨ã§ã¯èµ·ãããªãããã«ãªã£ãããããªãã§ããããã
mrb_yieldã§breakã§ããªãåé¡
æè§ãªã®ã§ã©ãããbug fixããã£ãã®ãã²ã¨ã¤æãåºãã¦ã¿ã¾ãããã
ãã®åé¡ãä¿®æ£ãããã®ã¯1.3ãåºãç´åã®ãã¨ã§ããã
v1.2ã§ã¯ãå®ã¯ä»¥ä¸ã®ãããªã³ã¼ãã¯ãã¾ãåãã¾ããã breakãã¦ããã®ã«ãã«ã¼ããçµãããªãã®ã§ããã£ã¦ãããSEGVãã¾ãã
$ mruby-1.2.0 "aaa\nbbb\nccc\n".lines do |line| p line break end #=> "aaa\n" #=> "bbb\n" #=> "ccc\n" [2] 72458 segmentation fault mruby-1.2.0
ããã¯ãCã§å®è£
ãããã¡ã½ããã§mrb_yield
ç³»ã使ããã¦ããå ´åã«break
ãå©ç¨ããã¨çºçãã¦ãã¾ããã
break
ãreturn
ã¨ã»ã¼åãæ±ãã«ãã¦ããã®ã§ãrubyã§æ¸ããããããã¯ãªãbreak
ã§ä»¥éã®ã³ã¼ãã¯é£ã°ããã®ã§ããã
Cå´ã®ã³ã¼ãã¯å¼ãç¶ãå®è¡ãã¦ãã¾ãã®ã§ã«ã¼ããæ¢ããããªãã¨ããåé¡ããã£ãããã§ãã
Rubyã³ã¼ãä¸ã¯break
ãã¦ããã®ã«ãCå´ã®ã³ã¼ãã¯æ¢ããããªãã®ã§ä¸æ´åãèµ·ãããSEGVãã¦ãããã®ã¨æããã¾ãã
ãã®åé¡ã¯break
ãä¾å¤æ±ããããã¨ã§longjumpããCã®ã¬ãã«ã§ãã¡ã½ããã®ã³ã¼ããé£ã°ããããã«ä¿®æ£ããã¦ãã¾ãã
Allow `break` from a block called by `mrb_yield`; close #3359 · mruby/mruby@d4d99dd · GitHub
ããã©ã¼ãã³ã¹
ãããã©ã¼ãã³ã¹ã¯æ©ããªã£ãã®ï¼ã
ã¨ãããã¨ã§ãmrubyã«æ·»ä»ããã¦ããbenchmarkã¹ã¯ãªããã§è¨æ¸¬ãã¦ã¿ã¾ããã
buildã®è¨å®ã¯full-coreã«ããã ãã§ãã®ä»ã¯åæå¤ã§ãã(OSX 10.12.5 clang v8.1.0)
$ time mruby-1.2.0 benchmark/bm_ao_render.rb > /dev/null mruby-1.2.0 benchmark/bm_ao_render.rb > /dev/null 20.22s user 1.44s system 98% cpu 21.942 total $ time mruby-1.3.0 benchmark/bm_ao_render.rb > /dev/null mruby-1.3.0 benchmark/bm_ao_render.rb > /dev/null 19.74s user 0.11s system 98% cpu 20.134 total $ time mruby-1.2.0 benchmark/bm_fib.rb > /dev/null mruby-1.2.0 benchmark/bm_fib.rb > /dev/null 12.32s user 0.03s system 99% cpu 12.387 total $ time mruby-1.3.0 benchmark/bm_fib.rb > /dev/null mruby-1.3.0 benchmark/bm_fib.rb > /dev/null 13.33s user 0.05s system 98% cpu 13.529 total $ time mruby-1.2.0 benchmark/bm_app_lc_fizzbuzz.rb > /dev/null mruby-1.2.0 benchmark/bm_app_lc_fizzbuzz.rb > /dev/null 37.46s user 0.45s system 98% cpu 38.559 total $ time mruby-1.3.0 benchmark/bm_app_lc_fizzbuzz.rb > /dev/null mruby-1.3.0 benchmark/bm_app_lc_fizzbuzz.rb > /dev/null 41.14s user 0.37s system 99% cpu 41.850 total $ time mruby-1.2.0 benchmark/bm_so_lists.rb > /dev/null mruby-1.2.0 benchmark/bm_so_lists.rb > /dev/null 5.90s user 0.17s system 97% cpu 6.197 total $ time mruby-1.3.0 benchmark/bm_so_lists.rb > /dev/null mruby-1.3.0 benchmark/bm_so_lists.rb > /dev/null 48.57s user 0.53s system 99% cpu 49.492 total
ãã¼ããããã¾ã§åçãªå¤åã¯ãªãããã§ããã
ãã¯ããmruby v1.3ã®ç®çã¯å¤§éã®bug fixã¨ãããã¨ã§ããããã
bm_so_lists.rbã¯CRubyã ã¨1sã¨ããªã®ã§ããã¯â¦â¦è¦ã¤ãã¡ãã£ããããããªãã§ããâ¦â¦ã
ä¸å¿å ±åãã¦ããã¾ãããã
Performance regression for benchmark/bm_so_lists.rb · Issue #3737 · mruby/mruby · GitHub
[追è¨]ãªããã¾ããã
Should only check frozen fix #3737 by ksss · Pull Request #3739 · mruby/mruby · GitHub
v1.4â¦â¦ï¼
keyword arguments
https://github.com/mruby/mruby/pull/3629
å®ã¯keyword argumentsã«å¯¾å¿ããPRã¯æ¢ã«æ¥ã¦ãã¾ãã
ããv1.3ã«ã¯åãè¾¼ã¾ãã¾ããã§ããã
ãªãªã¼ã¹ãã¼ãã«ãRemaining Bugsã¨ãã¦ãã£ããå«ã¾ãã¦ããã®ã§ããããã対å¿ãããã®ã§ã¯ãªãã§ããããã
â»ããã¯å人ã®ããã°ã§ã
å人ã®ããã°ãªã®ã§ãããããã¯èªåããã£ããã¨ãã¾ã¨ãã¾ãã
Kernel#caller
æ¸ããã®ãªã¬ãªã¬
Cã¬ãã«ã§ã¯ã»ã¼åãæ©è½ããã£ãã®ã§ããããRubyã®ä¸çã§ã使ããããã«ããã ãã
å¼æ°ã®æ±ããæå¤ã¨ããã©ãããã£ãããã¾ããã
ããã§ãããã°ã楽ã«ãªãå ´é¢ãå¢ããã¯ãâ¦â¦ï¼
Proc#initialize
æ¶ããã®ãªã¬ãªã¬
ããã¾ã§ã¯ãProc#initialize
ã§Procãªãã¸ã§ã¯ãã®åæåãè¡ã£ã¦ããã®ã§ãããProc.remove_method(:initialize)
ã¨å¶æªãªãã¨ãããã¨ãProcãªãã¸ã§ã¯ãã«å¿
è¦ãªå¤ãæºåãããããããããªé¨åã§SEGVãçºçããããã«ãªãã¾ãã
ããã§ã¯Cã¬ãã«ã®ã¡ã½ããã§Procãªãã¸ã§ã¯ããæ±ãéã«ã常ã«Proc.remove_method(:initialize)
ããããã¨ãèæ
®ããªãã¨ãããªããªã£ã¦ãã¾ãã¾ãã
ã¨ããã§CRubyãè¦ã¦ã¿ãã¨ããªãã¨Proc#initialize
ã¯å®ç¾©ããã¦ããªãã§ã¯ããã¾ãããã
ã¤ã¾ãããããåé¡ã¯ãCRubyã§ã¯Proc.remove_method(:initialize)
ã«ã¯Proc#initialize
ãå®ç¾©ããªããã¨ã«ãã£ã¦å¯¾çãã¦ããã¨å¤æã
mrubyã§ãProc#initialize
ãåé¤ãã¦ãProc.new
ã¡ã½ãããç¬èªã«å®ç¾©ããããã«ãã¾ããã*1
Proc.new
ã§åæåããããã«ããã°ããã¨ãProc.new
ãæ¶ãããã¨ãã¦ãProcãªãã¸ã§ã¯ããä½ããªãã®ã ããªã®ã§åé¡ããã¾ããã
Contributionsã®äºçªç®ã«ããã®ãªã¬ãªã¬
https://github.com/mruby/mruby/graphs/contributors?from=2015-11-17&to=2017-07-04
mruby-specã使ã£ã¦ãmrubyã¨CRubyã®æåã®ä¸æ´åãã²ãããç´ãã¨ãããã¨ããã¦ã¾ããã ã¾ããã®éã«ã¿ã¤ãã£ããã°ãªã©ãç´ããããé£ãããã¦ç´ããªããã®ã¯issueã§å ±åãªã©ã®æ´»åããã¦ãã¾ããã
åºç¤ã®æ´»åã¯ããã°ã«æ¸ãã¦ãã¾ãããã
- mrubyでruby/specを走らせることに成功した - スペクトラム
- mruby-specの成果報告 - スペクトラム
- mruby-spec進捗日記〜第二話〜 - スペクトラム
- 第三回mruby-spec進捗確認 - スペクトラム
çµæ§Rubyã®ç´°ããæåãç¥ããããã¦åå¼·ã«ããªãã¾ããã
shopifyã®ãã¤ãã¡ããã£ã¨ã ãæä¼ã£ã
Make string embad from shared by ksss · Pull Request #3657 · mruby/mruby · GitHub
ä¾ãã°ãã¡ãã®ã¨ã³ããªã¼ã§ã¯ãshopify issueã® https://github.com/mruby/mruby/issues/3651 ã解決ãã¦ãã¾ãã
åç¥èã¨ãã¦Stringãªãã¸ã§ã¯ãã¯ãshared, no-free, embed, normalãªã©ã®ç¶æ ãåå¨ããä»ã©ã®ç¶æ ãã«ãã£ã¦é©åã«å¦çãåå²ããªãã¨ãææªSEGVããã±ã¼ã¹ãããã¾ã(大æµã¯ç ´å£çãªæä½)ã
sharedãªStringãå¤æ´ãã¦sharedã®é¢ä¿ããããã¨ãã«ãããã¾ã§ã¯normalãªStringã¨ãã¦ããã®ã§ããã issueã«ãããããªä¸é¨ã®ã³ã¼ãã§ã¯æååã®é·ãã§embedãã©ããå¤æãã¦ãã¾ããã
ããããããé©åã«å ´ååããã¦â¦â¦ã¨ãæã£ãã®ã§ãããnormalãªã®ã«é·ãã¯embedå¯è½ãªæååãçæã§ãã¦ãã¾ãããã§ãåé¡ãèµ·ãã£ã¦ããã¨å¤æãsharedãªStringãå¤æ´ããã¨ãã«ãé·ããçãå ´åã¯embedãªStringã«ãã¦ãã¾ãã°ãåé¡ãæ²»ããã¡ã¢ãªæ¶è²»ãè¥å¹²æãããããã§ä¸ç³äºé³¥ã§ãã
bugãä¸ã¤åãè¾¼ãã§ãã¾ã£ã
ã§å ±åããã¦ããã¨ãããmruby-string-ext
gemãMRB_DISABLE_STDIO
ã§buildã§ããªããã¦ãã¾ãã¾ããããã
MRB_DISABLE_STDIO
ã¯ãã®åã®éãæ¨æºå
¥åºåãè¡ãé¢æ°ãä¸åç¦æ¢ããã ãã¶ãªã½ã¼ã¹ãå³ããç°å¢åãã®ãªãã·ã§ã³ã
ãããªå³ããç°å¢ã§ã¯æ¨æºæ·»ä»ã©ã¤ãã©ãªãªãã¦ä½¿ããªãããâ¦â¦ããâ¦â¦ããã§å°ã人ã許ãã¦ããããã
mruby v1.3
ã¿ããªä½¿ã£ã¦ãï¼
*1:ã¡ãªã¿ã«å®è£ ã¯ã渡ããããããã¯ã®ã³ãã¼ãä½ã£ã¦ããã ãã