Skip to content

Commit d6c3037

Browse files
authored
Merge pull request #2045 from nurse/ruby-2-7-0-preview1-released
Ruby 2.7.0-preview1 Released
2 parents ad783e5 + d3a81db commit d6c3037

File tree

5 files changed

+277
-0
lines changed

5 files changed

+277
-0
lines changed

_data/branches.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
# date: date of first stable release (YYYY-MM-DD)
99
# eol_date: date of EOL (YYYY-MM-DD)
1010

11+
- name: 2.7
12+
status: preview
13+
date:
14+
eol_date:
15+
1116
- name: 2.6
1217
status: normal maintenance
1318
date: 2018-12-25

_data/downloads.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# optional
55
preview:
66

7+
- 2.7.0-preview1
78

89
stable:
910

_data/releases.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919
# In order to get the release listed on the downloads page,
2020
# you also need to add an entry to `_data/downloads.yml'.
2121

22+
# 2.7 series
23+
24+
- version: 2.7.0-preview1
25+
date: 2019-05-30
26+
post: /en/news/2019/05/30/ruby-2-7-0-preview1-released/
27+
url:
28+
gz: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.tar.gz
29+
zip: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.zip
30+
bz2: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.tar.bz2
31+
xz: https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.tar.xz
32+
sha256:
33+
gz: b61dba9ed01e855000111964363fbd691219ab3c567455434717ecba962747ea
34+
zip: 59da2314822add396f68ce3e8e43e98843d41f4eab2354edc7f793a1ec3f3359
35+
bz2: b20c80adc1324c0ec87bf3f4a66b837771d7a30fc876d83e68e519c623cf0369
36+
xz: 540f11753f5805c1bf560c54a44d1ea04414217c7d319cac165de964e269399f
37+
2238
# 2.6 series
2339

2440
- version: 2.6.3
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
layout: news_post
3+
title: "Ruby 2.7.0-preview1 Released"
4+
author: "naruse"
5+
translator:
6+
date: 2019-04-20 00:00:00 +0000
7+
lang: en
8+
---
9+
10+
We are pleased to announce the release of Ruby 2.7.0-preview1.
11+
12+
A preview version is released to gather feedback for the final release planed to release on December. It introduces a number of new features and performance improvements, most notably:
13+
14+
* Compaction GC
15+
* Pattern Matching
16+
* REPL improvement
17+
18+
## Compaction GC
19+
20+
This release introduces Compaction GC which can defragment a fragmented memory space.
21+
22+
Some multithread Ruby programs may cause memory fragmentation, leading to high memory usage and degraded speed.
23+
24+
The `GC.compact` method is introduced for compacting the heap. This function compacts live objects in the heap so that fewer pages may be used, and the heap may be more CoW friendly. [#15626](https://bugs.ruby-lang.org/issues/15626)
25+
26+
## Pattern Matching [Experimental]
27+
28+
Pattern matching, widely used feature in functional programming languages, is introduced as an experimental feature. [#14912](https://bugs.ruby-lang.org/issues/14912)
29+
It can traverse a given object and assign its value if it matches a pattern.
30+
31+
```ruby
32+
case JSON.parse('{...}', symbolize_names: true)
33+
in {name: "Alice", children: [{name: "Bob", age: age}]}
34+
p age
35+
...
36+
end
37+
```
38+
39+
For more details, please see https://speakerdeck.com/k_tsj/pattern-matching-new-feature-in-ruby-2-dot-7.
40+
41+
## REPL improvement
42+
43+
`irb`, bundled interactive environment (REPL; Read-Eval-Print-Loop), now supports multi-line editing. It's powered by `reline`, `readline` compatible pure Ruby implementation.
44+
It also provides rdoc integration. In `irb` you can display the reference for a given class, module, or method. [#14683](https://bugs.ruby-lang.org/issues/14683), [#14787](https://bugs.ruby-lang.org/issues/14787), [#14918](https://bugs.ruby-lang.org/issues/14918)
45+
Besides, source lines shown at `binding.irb` and inspect results for core-class objects are now colorized.
46+
47+
<video autoplay="autoplay" loop="loop" width="478" height="202">
48+
<source src="https://cache.ruby-lang.org/pub/media/irb_improved_with_key_take2.mp4" type="video/mp4">
49+
</video>
50+
51+
## Other Notable New Features
52+
53+
* A method reference operator, <code>.:</code>, is introduced as an experimental feature. [#12125]( https://bugs.ruby-lang.org/issues/12125), [#13581]( https://bugs.ruby-lang.org/issues/13581)
54+
55+
* Numbered parameter as the default block parameter is introduced as an experimental feature. [#4475](https://bugs.ruby-lang.org/issues/4475)
56+
57+
* A beginless range is experimentally introduced. It might not be as useful
58+
as an endless range, but would be good for DSL purpose. [#14799](https://bugs.ruby-lang.org/issues/14799)
59+
60+
ary[..3] # identical to ary[0..3]
61+
rel.where(sales: ..100)
62+
63+
* `Enumerable#tally` is added. It counts the occurrence of each element.
64+
65+
["a", "b", "c", "b"].tally
66+
#=> {"a"=>1, "b"=>2, "c"=>1}
67+
68+
## Performance improvements
69+
70+
* JIT [Experimental]
71+
72+
* JIT-ed code is recompiled to less-optimized code when an optimization assumption is invalidated.
73+
74+
* Method inlining is performed when a method is considered as pure. This optimization is still experimental and many methods are NOT considered as pure yet.
75+
76+
* Default value of `--jit-min-calls` is changed from 5 to 10,000
77+
78+
* Default value of `--jit-max-cache` is changed from 1,000 to 100
79+
80+
## Other notable changes since 2.6
81+
82+
* `Proc.new` and `proc` with no block in a method called with a block is warned now.
83+
84+
* `lambda` with no block in a method called with a block errs.
85+
86+
* Update Unicode version and Emoji version from 11.0.0 to 12.0.0. [[Feature #15321]](https://bugs.ruby-lang.org/issues/15321)
87+
88+
* Update Unicode version to 12.1.0, adding support for U+32FF SQUARE ERA NAME REIWA. [[Feature #15195]](https://bugs.ruby-lang.org/issues/15195)
89+
90+
* `Date.jisx0301`, `Date#jisx0301`, and `Date.parse` provisionally support the new Japanese era as an informal extension, until the new JIS X 0301 is issued. [[Feature #15742]](https://bugs.ruby-lang.org/issues/15742)
91+
92+
* Require compilers to support C99 [[Misc #15347]](https://bugs.ruby-lang.org/issues/15347)
93+
* Details of our dialect: <https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/C99>
94+
95+
See [NEWS](https://github.com/ruby/ruby/blob/v2_7_0_preview1/NEWS) or [commit logs](https://github.com/ruby/ruby/compare/v2_6_0...v2_7_0_preview1) for more details.
96+
97+
With those changes, [6376 files changed, 227364 insertions(+), 51599 deletions(-)](https://github.com/ruby/ruby/compare/v2_6_0...v2_7_0_preview1) since Ruby 2.6.0!
98+
99+
Enjoy programming with Ruby 2.7!
100+
101+
## Download
102+
103+
* <https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.tar.gz>
104+
105+
SIZE: 16020966 bytes
106+
SHA1: f968d0c6117a7767af0b354458195de1df628b93
107+
SHA256: b61dba9ed01e855000111964363fbd691219ab3c567455434717ecba962747ea
108+
SHA512: 820ac03c08fd6e8283275a0d37caac9787afb85426bbb27e2105d8007bbc7ad6a35b2b40c8af81cdbb7a00347d44e92b5ff9b6e7f48f22d05584cedb85578409
109+
* <https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.zip>
110+
111+
SIZE: 20283209 bytes
112+
SHA1: fc31cb0620962f0aa73c902edfc8523ec5b2a2ec
113+
SHA256: 59da2314822add396f68ce3e8e43e98843d41f4eab2354edc7f793a1ec3f3359
114+
SHA512: e6726f21dc5e90f42e762a81cbf88caef325fe2d589d75a81d82663652695ed94b3be6e12fe238fc82e5caebb16e626456d9e9dfa4ecc6a55e532ba372b2d4de
115+
* <https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.tar.bz2>
116+
117+
SIZE: 14040553 bytes
118+
SHA1: 0a03aa856d87110e14a621d5bf7378de59a9d682
119+
SHA256: b20c80adc1324c0ec87bf3f4a66b837771d7a30fc876d83e68e519c623cf0369
120+
SHA512: 282d51ab6a76f40014e7c1738a1a02484e12bd52057db953e356b300974f5a1603a14dc23e436587870767213816c5adda335e6f8716de02c8fd853c85447250
121+
* <https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.tar.xz>
122+
123+
SIZE: 11440260 bytes
124+
SHA1: c7297e4a9e81657a9c8731da8de2e2aa4d4879c3
125+
SHA256: 540f11753f5805c1bf560c54a44d1ea04414217c7d319cac165de964e269399f
126+
SHA512: 78afd2b167658d0edb368a3f5f91446a5f6f63b451bfc1966af8964579bc74f6c6a2d227c8715ab742e97c6895ce4006b56ba0eed97b6effcd93555b43d90313
127+
128+
## What is Ruby
129+
130+
Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993, and is now developed as Open Source. It runs on multiple platforms and is used all over the world especially for web development.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
layout: news_post
3+
title: "Ruby 2.7.0-preview1 リリース"
4+
author: "naruse"
5+
translator:
6+
date: 2019-04-20 00:00:00 +0000
7+
lang: ja
8+
---
9+
10+
Ruby 2.7シリーズの最初のプレビュー版である、Ruby 2.7.0-preview1をリリースします。
11+
12+
プレビュー版は、年末の正式リリースに向け、新たな機能を試し、フィードバックを集めるために提供されています。
13+
Ruby 2.7.0-preview1では、多くの新しい機能やパフォーマンスの改善が含まれています。 その一部を以下に紹介します。
14+
15+
## Compaction GC
16+
17+
断片化したメモリをデフラグするCompaction GCが導入されました。
18+
19+
一部のマルチスレッドなRubyプログラムを長期間動かし、マーク&スイープ型GCを何度も実行していると、メモリが断片化してメモリ使用量の増大や性能の劣化を招くことが知られています。
20+
21+
Ruby 2.7では`GC.compact` というメソッドを導入し、ヒープをコンパクションすることが出来るようになります。ヒープ内の生存しているオブジェクトを他のページに移動し、不要なページを解放できるようになるとともに、ヒープをCoW (Copy on Write) フレンドリーにすることが出来ます。 [#15626](https://bugs.ruby-lang.org/issues/15626)
22+
23+
## Pattern Matching [Experimental]
24+
25+
関数型言語で広く使われているパターンマッチという機能が実験的に導入されました。
26+
渡されたオブジェクトの構造がパターンと一致するかどうかを調べ、一致した場合にその値を変数に代入するといったことができるようになります。 [#14912](https://bugs.ruby-lang.org/issues/14912)
27+
28+
```ruby
29+
case JSON.parse('{...}', symbolize_names: true)
30+
in {name: "Alice", children: [{name: "Bob", age: age}]}
31+
p age
32+
...
33+
end
34+
```
35+
36+
詳細については https://speakerdeck.com/k_tsj/pattern-matching-new-feature-in-ruby-2-dot-7 を参照してください。
37+
38+
## REPL improvement
39+
40+
Ruby に添付されている REPL (Read-Eval-Print-Loop) である `irb` で、複数行編集がサポートされました。これは `reline` という `readline` 互換のピュア Ruby 実装によるものです。
41+
また、rdoc 連携も提供されるようになっています。`irb` 内で、クラス、モジュール、メソッドのリファレンスをその場で確認できるようになりました。 [#14683](https://bugs.ruby-lang.org/issues/14683), [#14787](https://bugs.ruby-lang.org/issues/14787), [#14918](https://bugs.ruby-lang.org/issues/14918)
42+
これに加え、`binding.irb`で表示される周辺のコードや、コアクラスのオブジェクトのinspect結果に色がつくようになっています。
43+
44+
<video autoplay="autoplay" loop="loop" width="478" height="202">
45+
<source src="https://cache.ruby-lang.org/pub/media/irb_improved_with_key_take2.mp4" type="video/mp4">
46+
</video>
47+
48+
## 主要な新機能
49+
50+
* メソッド参照演算子 <code>.:</code> が試験的に導入されました。[#12125](https://bugs.ruby-lang.org/issues/12125), [#13581](https://bugs.ruby-lang.org/issues/13581)
51+
52+
* デフォルトのブロックの仮引数として番号指定パラメータが試験的に導入されました。[#4475](https://bugs.ruby-lang.org/issues/4475)
53+
54+
* 開始値省略範囲式が試験的に導入されました。これは終了値省略範囲式ほど有用ではないと思われますが、しかし DSL のような目的には役立つかもしれません。 [#14799](https://bugs.ruby-lang.org/issues/14799)
55+
56+
ary[..3] # identical to ary[0..3]
57+
rel.where(sales: ..100)
58+
59+
* `Enumerable#tally` が追加されました。各要素の出現回数を数えます。
60+
61+
["a", "b", "c", "b"].tally
62+
#=> {"a"=>1, "b"=>2, "c"=>1}
63+
64+
## パフォーマンスの改善
65+
66+
* JIT [Experimental]
67+
68+
* 最適化の際の仮定が無効とされた場合、JIT 化されていたコードがより最適化度が低いコードに再コンパイルされるようになりました。
69+
70+
* あるメソッドが「純粋」であると判定された場合、メソッドのインライン化が行われるようになりました。この最適化はまだ実験的であり、また多数のメソッドが今はまだ「純粋」と判定されないままです。
71+
72+
* `--jit-min-calls` オプションのデフォルト値が 5 から 10,000 に変更されました。
73+
74+
* `--jit-max-cache` オプションのデフォルト値が 1,000 から 100 に変更されました。
75+
76+
77+
## その他の注目すべき 2.6 からの変更点
78+
79+
* ブロックを渡すメソッド呼び出し中の、ブロックを伴わない `Proc.new``proc` が警告されるようになりました。
80+
81+
* ブロックを渡すメソッド呼び出し中の、ブロックを伴わない `lambda` はエラーとなるようになりました。
82+
83+
* Unicode および Emoji のバージョンが 11.0.0 から 12.0.0 になりました。[[Feature #15321]](https://bugs.ruby-lang.org/issues/15321)
84+
85+
* Unicode のバージョンが 12.1.0 となり、新元号「令和」を表す合字 U+32FF がサポートされました。[[Feature #15195]](https://bugs.ruby-lang.org/issues/15195)
86+
87+
* `Date.jisx0301`, `Date#jisx0301`, および `Date.parse` で非公式に新元号に仮対応しました。これは JIS X 0301 の新しい版で正式な仕様が決定されるまでの暫定的なものです。[[Feature #15742]](https://bugs.ruby-lang.org/issues/15742)
88+
89+
* Ruby のビルドに C99 に対応したコンパイラが必要になりました。[[Misc #15347]](https://bugs.ruby-lang.org/issues/15347)
90+
* 本件についての詳細: <https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/C99>
91+
92+
なお、こうした変更により、Ruby 2.6.0 以降では [6376 個のファイルに変更が加えられ、227364 行の追加と 51599 行の削除が行われました](https://github.com/ruby/ruby/compare/v2_6_0...v2_7_0_preview1) !
93+
94+
Ruby 2.7 でプログラミングをお楽しみください!
95+
96+
## Download
97+
98+
* <https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.tar.gz>
99+
100+
SIZE: 16020966 bytes
101+
SHA1: f968d0c6117a7767af0b354458195de1df628b93
102+
SHA256: b61dba9ed01e855000111964363fbd691219ab3c567455434717ecba962747ea
103+
SHA512: 820ac03c08fd6e8283275a0d37caac9787afb85426bbb27e2105d8007bbc7ad6a35b2b40c8af81cdbb7a00347d44e92b5ff9b6e7f48f22d05584cedb85578409
104+
* <https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.zip>
105+
106+
SIZE: 20283209 bytes
107+
SHA1: fc31cb0620962f0aa73c902edfc8523ec5b2a2ec
108+
SHA256: 59da2314822add396f68ce3e8e43e98843d41f4eab2354edc7f793a1ec3f3359
109+
SHA512: e6726f21dc5e90f42e762a81cbf88caef325fe2d589d75a81d82663652695ed94b3be6e12fe238fc82e5caebb16e626456d9e9dfa4ecc6a55e532ba372b2d4de
110+
* <https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.tar.bz2>
111+
112+
SIZE: 14040553 bytes
113+
SHA1: 0a03aa856d87110e14a621d5bf7378de59a9d682
114+
SHA256: b20c80adc1324c0ec87bf3f4a66b837771d7a30fc876d83e68e519c623cf0369
115+
SHA512: 282d51ab6a76f40014e7c1738a1a02484e12bd52057db953e356b300974f5a1603a14dc23e436587870767213816c5adda335e6f8716de02c8fd853c85447250
116+
* <https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0-preview1.tar.xz>
117+
118+
SIZE: 11440260 bytes
119+
SHA1: c7297e4a9e81657a9c8731da8de2e2aa4d4879c3
120+
SHA256: 540f11753f5805c1bf560c54a44d1ea04414217c7d319cac165de964e269399f
121+
SHA512: 78afd2b167658d0edb368a3f5f91446a5f6f63b451bfc1966af8964579bc74f6c6a2d227c8715ab742e97c6895ce4006b56ba0eed97b6effcd93555b43d90313
122+
123+
## Ruby とは
124+
125+
Rubyはまつもとゆきひろ (Matz) によって1993年に開発が始められ、今もオープンソースソフトウェアとして開発が続けられています。Rubyは様々なプラットフォームで動き、世界中で、特にWebアプリケーション開発のために使われています。

0 commit comments

Comments
 (0)