Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby 3.0.0 コネタ集
Search
Kazuhiro NISHIYAMA
March 24, 2021
Programming
0
370
Ruby 3.0.0 コネタ集
[Fukuoka.rb 200回 LT大会 (#202) - connpass](
https://fukuokarb.connpass.com/event/206956/)での発表資料です
。
Kazuhiro NISHIYAMA
March 24, 2021
Tweet
Share
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Ruby on Rails と私
znz
0
35
riscv64.rubyci.org internal
znz
0
32
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
72
devise-two-factorを4.xから5.xに上げた話
znz
0
360
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
88
Ubuntuのriscv64版をqemuで動かした
znz
0
110
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
110
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
100
Ruby リファレンスマニュアル改善計画 2022 進捗報告
znz
0
160
Other Decks in Programming
See All in Programming
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
110
NUMA環境とコンテナランタイム ― youki における Linux Memory Policy 実装
n4mlz
1
200
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
10
11k
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
480
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
150
開発に寄りそう自動テストの実現
goyoki
1
670
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
5
1.8k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
110
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
1
310
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
19k
Google Antigravity and Vibe Coding: Agentic Development Guide
mickey_kubo
2
150
愛される翻訳の秘訣
kishikawakatsumi
1
260
Featured
See All Featured
Code Review Best Practice
trishagee
73
19k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
How to Ace a Technical Interview
jacobian
280
24k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Producing Creativity
orderedlist
PRO
348
40k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How to train your dragon (web standard)
notwaldorf
97
6.4k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Transcript
Ruby 3.0.0 コネタ集 Kazuhiro NISHIYAMA Fukuoka.rb 200回 LT大会 (#202) 2021-03-24
株式会社Ruby開発 Powered by Rabbit 2.2.1
自己紹介 西山 和広 Ruby のコミッター twitter, github など: @znz 株式会社Ruby開発
www.ruby-dev.jp 1/14
はじめに LT なので内容はコネタ集です 2/14
Ractor 関連
Ractor で SEGV 3.0.0 では SEGV コア実装の experimental な機能は SEGV
バグがみつけやすいかも? % ruby -e Ractor.current.dup -e:1:in `dup': allocator undefined for Ractor (TypeError) from -e:1:in `<main>' 4/14
Ractor をまたぐ Thread Ractor 終了時なら Thread がそのまま 別 Ractor に移動可能
他の制限にひっかかって問題が起きる可 能性は未発見 % ruby -W0 -e 'r=Ractor.new{p Thread.new{loop{}}}; p r.take' #<Thread:0x00007fcf2586bfb8 -e:1 run> #<Thread:0x00007fcf2586bfb8 -e:1 run> 5/14
Ractor as global Queue main Ractor を Queue 代わりに使えるかも? %
ruby -e 'Ractor.current.send("foo"); p Ractor.receive' "foo" 6/14
shareable の影響あり ただし shareable ではないオブジェクトはコ ピーされてしまうので Queue 代わりには使いに くい %
ruby -e 'Ractor.current.send("foo".tap{|x|p x.object_id}); p Ractor.receive.tap{|x|p x.object_id}' 60 80 "foo" 7/14
互換性関連 のコネタ
frozen_string_literal frozen_string_literal: true magic comment 対応を 3.0.0 以降のみで確認すると対 応漏れする可能性あり %
ruby --enable=frozen_string_literal -e 'p "#{}".frozen?' false string interpolation (文字列補間) があると frozen にならなくなった 9/14
Warning[:deprecated] ruby -w や ruby -v で $VERBOSE = true
に すると Warning[:deprecated] も true にな るが、プログラム中で $VERBOSE = true にし ても Warning[:deprecated] は false のま ま % ruby -e 'p Warning[:deprecated]' false % ruby -w -e 'p Warning[:deprecated]' true % ruby -e '$VERBOSE=true; p Warning[:deprecated]' false 10/14
ruby -T $SAFE 関連が消えて -T オプションが消えた ruby 3.0: % ruby
-T0 -e 0 ruby: invalid option -T (-h will show valid options) (RuntimeError) ruby 2.7: % ruby -T0 -e 0 ruby: warning: ruby -T will be removed in Ruby 3.0 将来何か他の意味に使われるかも? 11/14
$SAFE / $KCODE 普通のグローバル変数になった (これも普通は使 わない) % ruby -e '$KCODE
= "foo"; p $KCODE' "foo" 12/14
TRUE / FALSE / NIL ついに消えたので普通の定数として利用可能 (普 通は使わない) % ruby
-e 'NIL = :dummy; p NIL.nil?' false 13/14
おわり Ractor はまだバグがありそうなので探 すと面白いかも 気付きにくい非互換もあるので複数 ruby バージョン対応するときには注意 長い間残っていて 3.0 で消えているもの
があります 14/14 Powered by Rabbit 2.2.1