{"id":84195,"date":"2020-12-21T09:47:50","date_gmt":"2020-12-21T00:47:50","guid":{"rendered":"https:\/\/www.softantenna.com\/wp\/?p=84195"},"modified":"2020-12-21T09:47:50","modified_gmt":"2020-12-21T00:47:50","slug":"ruby-3-0-0-rc1","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/ruby-3-0-0-rc1\/","title":{"rendered":"Ruby 3.0.0 RC1\u304c\u30ea\u30ea\u30fc\u30b9 - 12\u670825\u65e5\u516c\u958b\u4e88\u5b9a\u306eRuby 3.0\u306b\u5411\u3051\u305f\u30ea\u30ea\u30fc\u30b9\u5019\u88dc"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2020\/12\/s_20201221_93926.jpg\" alt=\"S 20201221 93926\" title=\"s_20201221_93926.jpg\" border=\"0\" width=\"928\" height=\"536\" \/><\/p>\n<p>Ruby\u958b\u767a\u30c1\u30fc\u30e0\u306f12\u670820\u65e5\u3001Ruby 3.0\u30b7\u30ea\u30fc\u30ba\u521d\u306e\u30ea\u30ea\u30fc\u30b9\u5019\u88dc\u300cRuby 3.0.0 RC1\u300d\u3092\u516c\u958b\u3057\u307e\u3057\u305f(<a href=\"https:\/\/www.ruby-lang.org\/ja\/news\/2020\/12\/20\/ruby-3-0-0-rc1-released\/\">ruby-lang.org<\/a>)\u300212\u670825\u65e5\u516c\u958b\u4e88\u5b9a\u306eRuby 3.0\u306b\u5411\u3051\u3001\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u5f97\u308b\u305f\u3081\u306e\u30ea\u30ea\u30fc\u30b9\u3068\u4f4d\u7f6e\u3065\u3051\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Ruby 3.0\u306b\u306f\u3001\u591a\u304f\u306e\u65b0\u6a5f\u80fd\u3084\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6539\u826f\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001Ruby\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u578b\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308bRBS\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3001\u30af\u30e9\u30b9\u3084\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5b9a\u7fa9\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u3001RBS\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u30bf\u30a4\u30d7\u30d7\u30ed\u30d5\u30a1\u30a4\u30e9\u3084\u305d\u306e\u4ed6\u30c4\u30fc\u30eb\u304b\u3089\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002Ruby 3.0\u306b\u306f\u3001RBS\u8a00\u8a9e\u3067\u66f8\u304b\u308c\u305f\u578b\u5b9a\u7fa9\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3042\u308b<a href=\"https:\/\/github.com\/ruby\/rbs\">rbs gem<\/a>\u304c\u540c\u68b1\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>module ChatApp\n  VERSION: String\n  class Channel\n    attr_reader name: String\n    attr_reader messages: Array[Message]\n    attr_reader users: Array[User | Bot]              # `|` \u306f `User` \u304b `Bot` \u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8868\u73fe\u3059\u308b\u300c\u30e6\u30cb\u30aa\u30f3\u578b\u300d\u3067\u3059\n    def initialize: (String) -> void\n    def post: (String, from: User | Bot) -> Message   # \u30e1\u30bd\u30c3\u30c9\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\n            | (File, from: User | Bot) -> Message\n  end\nend<\/pre>\n<p>\u307e\u305f\u3001\u5b9f\u9a13\u7684\u306a\u6a5f\u80fd\u3068\u3057\u3066TypeProf\u3068\u547c\u3070\u308c\u308b\u578b\u89e3\u6790\u30c4\u30fc\u30eb\u304c\u540c\u68b1\u3055\u308c\u3066\u3044\u307e\u3059\u3002TypeProf\u3092\u4f7f\u7528\u3057\u3001\u578b\u6ce8\u91c8\u306e\u7121\u3044\u666e\u901a\u306eRuby\u30b3\u30fc\u30c9\u304b\u3089\u3001\u578b\u30b7\u30b0\u30cd\u30c1\u30e3\u306e\u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u3092RBS\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b\u3001\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u3092\u8003\u616e\u3059\u308b\u3053\u3068\u306a\u304f\u4e26\u5217\u5b9f\u884c\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u305f\u3001\u30a2\u30af\u30bf\u30fc\u30e2\u30c7\u30eb\u306e\u3088\u3046\u306a\u4e26\u5217\u62bd\u8c61\u5316\u6a5f\u80fd\u3067\u3042\u308bRactor\u304c\u8a66\u9a13\u7684\u6a5f\u80fd\u3068\u3057\u3066\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u958b\u767a\u8005\u306f\u8907\u6570\u306eRactor\u3092\u4f5c\u6210\u3057\u3066\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u901a\u5e38\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u306a\u4e26\u5217\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7c21\u5358\u306b\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Ractor\u9593\u306e\u901a\u4fe1\u306b\u306f\u30e1\u30c3\u30bb\u30fc\u30b8\u30d1\u30c3\u30b7\u30f3\u30b0\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>require 'prime'\n\n# n.prime? with sent integers in r1, r2 run in parallel\nr1, r2 = *(1..2).map do\n  Ractor.new do\n    n = Ractor.recv\n    n.prime?\n  end\nend\n\n# send parameters\nr1.send 2**61 - 1\nr2.send 2**61 + 15\n\n# wait for the results of expr1, expr2\np r1.take #=> true\np r2.take #=> true<\/pre>\n<p>\u305d\u306e\u4ed6\u3001\u30d6\u30ed\u30c3\u30ad\u30f3\u30b0\u64cd\u4f5c\u3092\u30a4\u30f3\u30bf\u30fc\u30bb\u30d7\u30c8\u3059\u308b\u305f\u3081\u306eThread#scheduler\u306e\u5c0e\u5165\u3084\u30011\u884c\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u306e\u300cin\u300d\u304b\u3089\u300c=>\u300d\u3078\u306e\u5909\u66f4\u3001\u4e00\u884c\u30e1\u30bd\u30c3\u30c9\u5b9a\u7fa9\u300cdef square(x) = x * x\u300d\u306e\u8ffd\u52a0\u3001find\u30d1\u30bf\u30fc\u30f3\u306e\u8ffd\u52a0\u3001Hash#except\u306e\u7d44\u307f\u8fbc\u307f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6539\u826f\u306a\u3069\u3055\u307e\u3056\u307e\u306a\u65b0\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>2.7\u304b\u3089\u306e\u5909\u66f4\u70b9\u3092\u542b\u3081\u8a73\u7d30\u306f<a href=\"https:\/\/github.com\/ruby\/ruby\/compare\/v2_7_0...v3_0_0_rc1\">\u3053\u3061\u3089<\/a>\u3067\u78ba\u8a8d\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<table>\n<tr>\n<th rowspan='4' style='white-space: nowrap;'><img decoding=\"async\" style=\"max-width: 52px; height: auto;\" src=\"\/assets\/pc-301b359275e3cfd18baf480ee6dd6d484a27fdc417431ff7dd5cd26d895260b0.png\" alt=\"Pc\" \/><\/th>\n<th style='white-space: nowrap;'>\u30bf\u30a4\u30c8\u30eb<\/th>\n<td>Ruby<\/td>\n<\/tr>\n<tr>\n<th style='white-space: nowrap;'>\u516c\u5f0f\u30b5\u30a4\u30c8<\/th>\n<td><a href=\"http:\/\/www.ruby-lang.org\/ja\/\">http:\/\/www.ruby-lang.org\/ja\/<\/a><\/td>\n<\/tr>\n<tr>\n<th style='white-space: nowrap;'>\u30bd\u30d5\u30c8\u30a2\u30f3\u30c6\u30ca<\/th>\n<td><a href=\"https:\/\/softantenna.com\/softwares\/1964-ruby\">https:\/\/softantenna.com\/softwares\/1964-ruby<\/a><\/td>\n<\/tr>\n<tr>\n<th style='white-space: nowrap;'>\u8aac\u660e<\/th>\n<td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30b9\u30af\u30ea\u30d7\u30c8\u8a00\u8a9e\u3002<\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Ruby\u958b\u767a\u30c1\u30fc\u30e0\u306f12\u670820\u65e5\u3001Ruby 3.0\u30b7\u30ea\u30fc\u30ba\u521d\u306e\u30ea\u30ea\u30fc\u30b9\u5019\u88dc\u300cRuby 3.0.0 RC1\u300d\u3092\u516c\u958b\u3057\u307e\u3057\u305f(ruby-lang.org)\u300212\u670825\u65e5\u516c\u958b\u4e88\u5b9a\u306eRuby 3.0\u306b\u5411\u3051\u3001\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u5f97\u308b\u305f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":84196,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[154],"class_list":["post-84195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-ruby"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/84195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=84195"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/84195\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/84196"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=84195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=84195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=84195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}