Skip to content

Commit da95fa0

Browse files
authored
Merge pull request #1870 from ruby/ruby-2-6-0-preview3-released
Ruby 2.6.0-preview3 Released
2 parents cd44e1f + d8b54ea commit da95fa0

File tree

4 files changed

+261
-1
lines changed

4 files changed

+261
-1
lines changed

_data/downloads.yml

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

7-
- 2.6.0-preview2
7+
- 2.6.0-preview3
88

99
stable:
1010

_data/releases.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@
2121

2222
# 2.6 series
2323

24+
- version: 2.6.0-preview3
25+
date: 2018-11-06
26+
post: /en/news/2018/11/06/ruby-2-6-0-preview3-released/
27+
url:
28+
gz: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.tar.gz
29+
zip: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.zip
30+
bz2: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.tar.bz2
31+
xz: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.tar.xz
32+
sha256:
33+
gz: 60243e3bd9661e37675009ab66ba63beacf5dec748885b9b93916909f965f27a
34+
zip: 9152af9e700349dcfa2eec196dd91587d42d70a6837fa2c415ebba1167587be1
35+
bz2: 1f09a2ac1ab26721923cbf4b9302a66d36bb302dc45e72112b41d6fccc5b5931
36+
xz: 9856d9e0e32df9e5cdf01928eec363d037f1a76dab2abbf828170647beaf64fe
37+
2438
- version: 2.6.0-preview2
2539
date: 2018-05-31
2640
post: /en/news/2018/05/31/ruby-2-6-0-preview2-released/
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.6.0-preview3 Released"
4+
author: "naruse"
5+
translator:
6+
date: 2018-11-06 00:00:00 +0000
7+
lang: en
8+
---
9+
10+
We are pleased to announce the release of Ruby 2.6.0-preview3.
11+
12+
Ruby 2.6.0-preview3 is the third preview toward Ruby 2.6.0.
13+
This preview3 is released to test new features before coming Release Candidate.
14+
15+
## JIT
16+
17+
Ruby 2.6 introduces an initial implementation of JIT (Just-in-time) compiler.
18+
19+
JIT compiler aims to improve performance of any Ruby program execution.
20+
Unlike ordinary JIT compilers for other languages, Ruby's JIT compiler does JIT compilation in a unique way, which prints C code to a disk and spawns common C compiler process to generate native code.
21+
See also: [MJIT organization by Vladimir Makarov](https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#mjit-organization).
22+
23+
How to use: Just specify `--jit` in command line or `$RUBYOPT` environment variable.
24+
Specifying `--jit-verbose=1` allows to print basic information of ongoing JIT compilation. See `ruby --help` for other options.
25+
26+
The main purpose of this JIT release is to provide a chance to check if it works for your platform and to find out security risks before the 2.6 release.
27+
JIT compiler is supported when Ruby is built by GCC, Clang, or Microsoft VC++, which needs to be available on runtime. Otherwise you can't use it for now.
28+
29+
As of Ruby 2.6.0 preview3, we achieved 1.7x faster performance than Ruby 2.5 on CPU-intensive non-trivial benchmark workload called Optcarrot https://gist.github.com/k0kubun/d7f54d96f8e501bbbc78b927640f4208. We're going to improve the performance on memory-intensive workload like Rails application as well.
30+
31+
Stay tuned for the new age of Ruby's performance.
32+
33+
## RubyVM::AST [Experimental]
34+
35+
Ruby 2.6 introduces `RubyVM::AST` module.
36+
37+
This module has `parse` method which parses a given ruby code of string and returns AST (Abstract Syntax Tree) nodes, and `parse_file` method which parses a given ruby code file and returns AST nodes.
38+
`RubyVM::AST::Node` class is also introduced. You can get location information and children nodes from `Node` objects. This feature is experimental. Compatibility of the structure of AST nodes are not guaranteed.
39+
40+
## New Features
41+
42+
* Add a new alias `then` to `Kernel#yield_self`. [[Feature #14594]](https://bugs.ruby-lang.org/issues/14594)
43+
44+
* `else` without `rescue` now causes a syntax error. [EXPERIMENTAL]
45+
46+
* constant names may start with a non-ASCII capital letter. [[Feature #13770]](https://bugs.ruby-lang.org/issues/13770)
47+
48+
* endless range [[Feature #12912]](https://bugs.ruby-lang.org/issues/12912)
49+
50+
An endless range, `(1..)`, is introduced. It works as it has no end. This shows typical use cases:
51+
52+
ary[1..] # identical to ary[1..-1] without magical -1
53+
(1..).each {|index| ... } # inifinite loop from index 1
54+
ary.zip(1..) {|elem, index| ... } # ary.each.with_index(1) { ... }
55+
56+
* Add `Binding#source_location`. [[Feature #14230]](https://bugs.ruby-lang.org/issues/14230)
57+
58+
This method returns the source location of binding, a 2-element array of `__FILE__` and `__LINE__`. Traditionally, the same information could be retrieved by `eval("[__FILE__, __LINE__]", binding)`, but we are planning to change this behavior so that `Kernel#eval` ignores binding's source location [[Bug #4352]](https://bugs.ruby-lang.org/issues/4352). So, users should use this newly-introduced method instead of `Kernel#eval`.
59+
60+
* Add `:exception` option to let `Kernel.#system` raise error instead of returning `false`. [[Feature #14386]](https://bugs.ruby-lang.org/issues/14386)
61+
62+
## Performance improvements
63+
64+
* Speedup `Proc#call` because we don't need to care about `$SAFE` any more.
65+
[[Feature #14318]](https://bugs.ruby-lang.org/issues/14318)
66+
67+
With `lc_fizzbuzz` benchmark which uses `Proc#call` so many times we can measure
68+
x1.4 improvements [[Bug #10212]](https://bugs.ruby-lang.org/issues/10212).
69+
70+
* Speedup `block.call` where `block` is passed block parameter. [[Feature #14330]](https://bugs.ruby-lang.org/issues/14330)
71+
72+
Ruby 2.5 improves block passing performance. [[Feature #14045]](https://bugs.ruby-lang.org/issues/14045)
73+
Additionally, Ruby 2.6 improves the performance of passed block calling.
74+
With micro-benchmark we can observe x2.6 improvement.
75+
76+
* Transient Heap (theap) is introduced. [Bug #14858] [Feature #14989]
77+
theap is managed heap for short-living memory objects which are pointed by
78+
specific classes (Array, Hash, Object, and Struct). For example, making small
79+
and short-living Hash object is x2 faster. With rdoc benchmark, we observed
80+
6-7% performance improvement.
81+
82+
## Other notable changes since 2.5
83+
84+
* `$SAFE` is a process global state and we can set `0` again. [[Feature #14250]](https://bugs.ruby-lang.org/issues/14250)
85+
86+
* Passing `safe_level` to `ERB.new` is deprecated. `trim_mode` and `eoutvar` arguments are changed to keyword arguments. [[Feature #14256]](https://bugs.ruby-lang.org/issues/14256)
87+
88+
* Merge RubyGems 3.0.0.beta2. `--ri` and `--rdoc` options was removed. Please use `--document` and `--no-document` options instead of them.
89+
90+
* Merge [Bundler](https://github.com/bundler/bundler) as Default gems.
91+
92+
See [NEWS](https://github.com/ruby/ruby/blob/v2_6_0_preview3/NEWS)
93+
or [commit logs](https://github.com/ruby/ruby/compare/v2_5_0...v2_6_0_preview3)
94+
for details.
95+
96+
With those changes,
97+
[6474 files changed, 171888 insertions(+), 46617 deletions(-)](https://github.com/ruby/ruby/compare/v2_5_0...v2_6_0_preview3)
98+
since Ruby 2.5.0!
99+
100+
Enjoy programming with Ruby 2.6.0-preview3!
101+
102+
## Download
103+
104+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.tar.gz>
105+
106+
SIZE: 17071670 bytes
107+
SHA1: 67836fda11fa91e0b988a6cc07989fbceda025b4
108+
SHA256: 60243e3bd9661e37675009ab66ba63beacf5dec748885b9b93916909f965f27a
109+
SHA512: 877278cd6e9b947f5bb6ed78136efb232dcc9c5c218b7236576171e7c3cd7f6b7d10d07d8402014a14aba1fcd1913a4370f0725c561ead41d8a3fe92029f7f76
110+
111+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.zip>
112+
113+
SIZE: 21537655 bytes
114+
SHA1: 45f3c90dfffe03b746f21f24152666e361cbb41a
115+
SHA256: 9152af9e700349dcfa2eec196dd91587d42d70a6837fa2c415ebba1167587be1
116+
SHA512: 335de36cf56706326f4acc4bbd35be01e0ac5fff30d0a69b2e1630ba4c78f0e711822d1623d0099a517c824b154917d2f60be192dfb143a422cf1d17b38e1183
117+
118+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.tar.bz2>
119+
120+
SIZE: 14973451 bytes
121+
SHA1: 5f2df5d8c5a3888ccb915d36a3532ba32cda8791
122+
SHA256: 1f09a2ac1ab26721923cbf4b9302a66d36bb302dc45e72112b41d6fccc5b5931
123+
SHA512: d1693625723796e8902f3e4c4fae444f2912af9173489f7cf18c99db2a217afc971b082fce7089e39f8edd54d762d2b4e72843c8306ed29b05ccb15ac03dbb5b
124+
125+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.tar.xz>
126+
127+
SIZE: 12291692 bytes
128+
SHA1: 7f8216247745215e9645568e7a02140f9a029b31
129+
SHA256: 9856d9e0e32df9e5cdf01928eec363d037f1a76dab2abbf828170647beaf64fe
130+
SHA512: b4d3b17ecf96272c43cd7518c0b54dee63fc1150ad143e1d9c9d708506fe78676c80eb96cc47b8d46d1128bd483a53f16c944963a03d1f99f00131b74714df7b
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
layout: news_post
3+
title: "Ruby 2.6.0-preview3 Released"
4+
author: "naruse"
5+
translator:
6+
date: 2018-11-06 00:00:00 +0000
7+
lang: ja
8+
---
9+
10+
Ruby 2.6.0に向けた3つ目のプレビューである、Ruby 2.6.0-preview3がリリースされました。
11+
12+
Ruby 2.6.0-preview3は、リリース前に出されるRelease Candidateに向けて最新の機能を試せるようにするためリリースされています。
13+
14+
## JIT
15+
16+
Ruby 2.6ではJIT (Just-in-time) コンパイラが導入されました。
17+
18+
JITコンパイラはあらゆるRubyプログラムの実行を高速化することを目的としています。
19+
他言語の一般的なJITコンパイラと異なり、RubyのJITコンパイラはC言語のソースコードをファイルとしてディスクに書き、通常のCコンパイラを用いてネイティブコードに変換することでJITコンパイルを行うという手法を用いています。(参考: [MJIT organization by Vladimir Makarov](https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#mjit-organization))
20+
21+
JITコンパイルを有効にするには `--jit` オプションをコマンドラインまたは$RUBYOPT環境変数を指定します。`--jit-verbose=1`を指定すれば指定すれば実行中のJITコンパイルの基本的な情報を表示します。その他のオプションについては `ruby --help` を参照ください。
22+
23+
今回のリリースはこのJITコンパイル機能を皆さんの環境で動作を確認して頂くとともに、セキュリティ上の問題が無いかを早期に確認するために行っています。
24+
現在のJITコンパイラを利用するためには、GCC、Clang、あるいはMicrosoft VC++によってビルドされたRubyでかつ、そのコンパイラが実行時に利用可能である必要があります。
25+
26+
Ruby 2.6.0-preview3の時点で、OptcarrotというCPU負荷中心のベンチマークにおいてRuby 2.5の約1.7倍の性能向上を達成しました。 https://gist.github.com/k0kubun/d7f54d96f8e501bbbc78b927640f4208
27+
Railsアプリケーションなどのメモリ負荷の高い環境における性能は現在改善中です。
28+
29+
引き続き新時代のRubyの実効性能にご期待ください。
30+
31+
## RubyVM::AST [Experimental]
32+
33+
Ruby 2.6では `RubyVM::AST` モジュールが導入されました。
34+
35+
このモジュールには、文字列をパースしてAST(抽象構文木)のNodeを返す`parse`メソッド、ファイルをパースする`parse_file`メソッドが実装されています。
36+
`RubyVM::AST::Node` も導入されました。このクラスのインスタンスから位置情報や子ノードを取得することができます。この機能はexperimentalです。また、ASTの構造に関する互換性は保証されていません。
37+
38+
## 新機能
39+
40+
* `Kernel#yield_self` の別名として `then` が追加されました [[Feature #14594]](https://bugs.ruby-lang.org/issues/14594)
41+
42+
* `rescue` 無しの `else` が文法エラーとなるようになりました [EXPERIMENTAL]
43+
44+
* ASCII以外の大文字でも定数を定義出来るようになりました [[Feature #13770]](https://bugs.ruby-lang.org/issues/13770)
45+
46+
* 終端なしRange [[Feature #12912]](https://bugs.ruby-lang.org/issues/12912)
47+
48+
終端なしRange `(1..)` が導入されました。これは終端を持ちません。これが典型的な用途です:
49+
50+
ary[1..] # マジックナンバー -1 なしで ary[1..-1] と同じ意味
51+
(1..).each {|index| ... } # index が 1 から始まる無限ループ
52+
ary.zip(1..) {|elem, index| ... } # ary.each.with_index(1) { ... }
53+
54+
* Binding#source_location の追加 [[Feature #14230]](https://bugs.ruby-lang.org/issues/14230)
55+
* `binding`のソースコード上の位置を `__FILE__``__LINE__` の二要素配列として返します。従来でも `eval("[__FILE__, __LINE__]", binding)` とすることでこれらの情報は得られましたが、将来的に `Kernel#eval` はbindingのソースコード行を無視する変更を予定しているため [[Bug #4352]](https://bugs.ruby-lang.org/issues/4352)、この新しいメソッドを用いることが今後は推奨されます。
56+
* Kernel#system の失敗時に、falseを返す代わりに例外を上げさせる :exception オプションを追加 [[Feature #14386]](https://bugs.ruby-lang.org/issues/14386)
57+
58+
* Coverage の oneshot_lines モードの追加 [Feature#15022]
59+
* This mode checks "whether each line was executed at least once or not", instead of "how many times each line was executed". A hook for each line is fired at most once, and after it is fired the hook flag is removed, i.e., it runs with zero overhead.
60+
* Add +:oneshot_lines+ keyword argument to Coverage.start.
61+
* Add +:stop+ and +:clear+ keyword arguments to Coverage.result. If +clear+ is true, it clears the counters to zero. If +stop+ is true, it disables coverage measurement.
62+
* Coverage.line_stub, which is a simple helper function that creates the "stub" of line coverage from a given source code.
63+
64+
* FileUtils#cp_lr. [Feature #4189]
65+
66+
## パフォーマンスの改善
67+
68+
* transient heap(メモ)
69+
* 後述の$SAFEの変更に伴って考慮すべきことが減ったため、`Proc#call`が高速化されました [[Feature #14318]](https://bugs.ruby-lang.org/issues/14318)
70+
`Proc#call` を大量に呼び出す `lc_fizzbuzz` ベンチマークにおいては、1.4倍高速化されています [[Bug #10212]](https://bugs.ruby-lang.org/issues/10212)
71+
* `block` がブロックパラメータである時、`block.call`が高速化されました [[Feature #14330]](https://bugs.ruby-lang.org/issues/14330)
72+
Ruby 2.5ではブロック渡しの性能が改善されましたが [[Feature #14045]](https://bugs.ruby-lang.org/issues/14045)、加えてRuby 2.6では渡されたブロックの呼び出しも改善されました。
73+
マイクロベンチマークにおいては2.6倍高速化されています。
74+
75+
## その他の注目すべき 2.5 からの変更点
76+
77+
* $SAFE はプロセスグローバルで扱われることになると共に、0以外を設定した後に0に戻せるようになりました [[Feature #14250]](https://bugs.ruby-lang.org/issues/14250)
78+
* `ERB.new``safe_level`を渡すのは非推奨になりました。また、`trim_mode``eoutvar`はキーワード引数に変更されました。 [[Feature #14256]](https://bugs.ruby-lang.org/issues/14256)
79+
* RubyGems 3.0.0.beta2 をマージしました。 `--ri``--rdoc` オプションは使えなくなりました。`--document` または `--no-document` を利用してください。
80+
* [Bundler](https://github.com/bundler/bundler) を Default gems として標準添付しました。
81+
82+
その他詳細については、[NEWS](https://github.com/ruby/ruby/blob/v2_6_0_preview3/NEWS) ファイルまたは[コミットログ](https://github.com/ruby/ruby/compare/v2_5_0...v2_6_0_preview3)を参照してください。
83+
84+
なお、こうした変更により、Ruby 2.5.0 以降では [6474 個のファイルに変更が加えられ、171888 行の追加と 46617 行の削除が行われました](https://github.com/ruby/ruby/compare/v2_5_0...v2_6_0_preview3) !
85+
86+
みなさんもRuby 2.6.0-preview3で楽しいプログラミングを!
87+
88+
## Download
89+
90+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.tar.gz>
91+
92+
SIZE: 17071670 bytes
93+
SHA1: 67836fda11fa91e0b988a6cc07989fbceda025b4
94+
SHA256: 60243e3bd9661e37675009ab66ba63beacf5dec748885b9b93916909f965f27a
95+
SHA512: 877278cd6e9b947f5bb6ed78136efb232dcc9c5c218b7236576171e7c3cd7f6b7d10d07d8402014a14aba1fcd1913a4370f0725c561ead41d8a3fe92029f7f76
96+
97+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.zip>
98+
99+
SIZE: 21537655 bytes
100+
SHA1: 45f3c90dfffe03b746f21f24152666e361cbb41a
101+
SHA256: 9152af9e700349dcfa2eec196dd91587d42d70a6837fa2c415ebba1167587be1
102+
SHA512: 335de36cf56706326f4acc4bbd35be01e0ac5fff30d0a69b2e1630ba4c78f0e711822d1623d0099a517c824b154917d2f60be192dfb143a422cf1d17b38e1183
103+
104+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.tar.bz2>
105+
106+
SIZE: 14973451 bytes
107+
SHA1: 5f2df5d8c5a3888ccb915d36a3532ba32cda8791
108+
SHA256: 1f09a2ac1ab26721923cbf4b9302a66d36bb302dc45e72112b41d6fccc5b5931
109+
SHA512: d1693625723796e8902f3e4c4fae444f2912af9173489f7cf18c99db2a217afc971b082fce7089e39f8edd54d762d2b4e72843c8306ed29b05ccb15ac03dbb5b
110+
111+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview3.tar.xz>
112+
113+
SIZE: 12291692 bytes
114+
SHA1: 7f8216247745215e9645568e7a02140f9a029b31
115+
SHA256: 9856d9e0e32df9e5cdf01928eec363d037f1a76dab2abbf828170647beaf64fe
116+
SHA512: b4d3b17ecf96272c43cd7518c0b54dee63fc1150ad143e1d9c9d708506fe78676c80eb96cc47b8d46d1128bd483a53f16c944963a03d1f99f00131b74714df7b

0 commit comments

Comments
 (0)