Better Ruby
NaCl
OSS Vision
Ruby Association

まつもとゆきひろ
Yukihiro "Matz" Matsumoto@yukihiro_matz

Powered by Rabbit 3.0.1

Rubyをもっと良くしたいPowered by Rabbit 3.0.1

３０年間ずっと考えてきたこと

Powered by Rabbit 3.0.1

文法・機能的にはほぼ満足

Powered by Rabbit 3.0.1

あと、欲しいのは「ネームスペース」

Powered by Rabbit 3.0.1

Namespace

Powered by Rabbit 3.0.1

独立した名前空間

Powered by Rabbit 3.0.1

バージョン依存からの解放(？)

Powered by Rabbit 3.0.1

しかし、実現できていないのには理由がPowered by Rabbit 3.0.1

いまだ検討中Powered by Rabbit 3.0.1

長期的な課題

Powered by Rabbit 3.0.1

それとは別にやりたいことPowered by Rabbit 3.0.1

言語を変えない変更

Powered by Rabbit 3.0.1

パフォーマンス
ツール

Powered by Rabbit 3.0.1

パフォーマンスPowered by Rabbit 3.0.1

高速化Powered by Rabbit 3.0.1

理論的限界よりはいつも遅い

Powered by Rabbit 3.0.1

速くて文句を言う人はいない

Powered by Rabbit 3.0.1

Ruby3x3

Powered by Rabbit 3.0.1

Ruby3.0はRuby2.0の３倍高速

Powered by Rabbit 3.0.1

(ある種のベンチマークで)Powered by Rabbit 3.0.1

JITコンパイラによって実現Powered by Rabbit 3.0.1

ただし、Railsアプリを除く

Powered by Rabbit 3.0.1

最初の一歩だが期待以下

Powered by Rabbit 3.0.1

理論的限界よりはいつも遅い

Powered by Rabbit 3.0.1

速くて文句を言う人はいない

Powered by Rabbit 3.0.1

RUby3.0以降もさらなる改善Powered by Rabbit 3.0.1

YJIT

Powered by Rabbit 3.0.1

日々高速化Powered by Rabbit 3.0.1

Ruby3.3ではRailsアプリも20%以上高速化

Powered by Rabbit 3.0.1

20%高速化≒20%コスト削減

Powered by Rabbit 3.0.1

Railsも正式採用(デフォルトでYJITオン)

Powered by Rabbit 3.0.1

素晴らしいPowered by Rabbit 3.0.1

その他の改善Powered by Rabbit 3.0.1

メモリ管理の改善

Powered by Rabbit 3.0.1

VWA
Variable Width Allocation

Powered by Rabbit 3.0.1

メモリ割当て効率化

Powered by Rabbit 3.0.1

GCの改善Powered by Rabbit 3.0.1

日々高速化Powered by Rabbit 3.0.1

素晴らしいPowered by Rabbit 3.0.1

しかし、安泰ではない

Powered by Rabbit 3.0.1

JavaScriptの速度Powered by Rabbit 3.0.1

PythonのJIT採用

Powered by Rabbit 3.0.1

「現状維持には全力疾走」

Powered by Rabbit 3.0.1

今後も継続して改善する

Powered by Rabbit 3.0.1

ツールPowered by Rabbit 3.0.1

現代の高生産性は言語から来ない

Powered by Rabbit 3.0.1

開発環境

Powered by Rabbit 3.0.1

統合開発環境Powered by Rabbit 3.0.1

VSCodePowered by Rabbit 3.0.1

昔
良い言語
良いエディタ(Emacs, Vi)Powered by Rabbit 3.0.1

今そこそこの言語
良い開発環境Language Server Protocol

Powered by Rabbit 3.0.1

補完
動的エラーチェック
リファクタリング支援

Powered by Rabbit 3.0.1

ツールの重要性向上

Powered by Rabbit 3.0.1

Prism / parse.yPowered by Rabbit 3.0.1

Ruby3.3 / 大構文解析時代

Powered by Rabbit 3.0.1

ステッカー

Powered by Rabbit 3.0.1

開発支援ツールと構文解析

Powered by Rabbit 3.0.1

RuboCop
ruby-lsp
Steep / Sorbet

Powered by Rabbit 3.0.1

構文解析が必要

Powered by Rabbit 3.0.1

メンテナンス性
独立性
エラー許容性Powered by Rabbit 3.0.1

メンテナンス性Powered by Rabbit 3.0.1

Bisonの限界

Powered by Rabbit 3.0.1

状態付き字句解析機

Powered by Rabbit 3.0.1

Prismとparse.yPowered by Rabbit 3.0.1

それぞれ異なるアプローチ

Powered by Rabbit 3.0.1

PrismPowered by Rabbit 3.0.1

Prism手書き再起下降構文解析
実は最近の流行高速・省メモリ

Powered by Rabbit 3.0.1

PrismCRubyから独立したAPI
JRubyなどで採用

エラー許容性を実装
RubyCopなどで採用

Powered by Rabbit 3.0.1

parse.yPowered by Rabbit 3.0.1

Bisonの限界

Powered by Rabbit 3.0.1

バージョン問題
機能問題

Powered by Rabbit 3.0.1

「Bisonを捨てれば」

Powered by Rabbit 3.0.1

新規開発構文解析機ジェネレーター

Powered by Rabbit 3.0.1

LramaPowered by Rabbit 3.0.1

Bison互換
より高機能
エラー許容性自動生成

Powered by Rabbit 3.0.1

メリットPowered by Rabbit 3.0.1

Lramaのメリット
BNFで文法が書けるBisonよりも記述が簡単
状態付き字句解析機の問題回避(予定)
エラー許容性自動生成

Powered by Rabbit 3.0.1

よりメンテナンス性が高い(予定)Powered by Rabbit 3.0.1

競争関係

Powered by Rabbit 3.0.1

未来はどっちだ

Powered by Rabbit 3.0.1

ニコイチ案Powered by Rabbit 3.0.1

API(独立性)はPrism

Powered by Rabbit 3.0.1

コア(構文解析機)はparse.yPowered by Rabbit 3.0.1

サポートツール案

Powered by Rabbit 3.0.1

Prismを本採用

Powered by Rabbit 3.0.1

parse.yで文法サポートツール

Powered by Rabbit 3.0.1

２年後くらいに判断(か？)Powered by Rabbit 3.0.1

いずれにしてもツールを支援Powered by Rabbit 3.0.1

良いツールが充実

Powered by Rabbit 3.0.1

irb
AIプログラミングツールなどなど

Powered by Rabbit 3.0.1

より高い生産性

Powered by Rabbit 3.0.1

より良いプログラミング体験

Powered by Rabbit 3.0.1

より良いRuby

Powered by Rabbit 3.0.1

提供
NaCl
OSS Vision
GitHub Sponsors
Ruby Community

Powered by Rabbit 3.0.1

Thank you

Powered by Rabbit 3.0.1