Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby in 2019
Search
KONDO Uchio
August 29, 2019
Technology
3
12k
Ruby in 2019
@Developers Summit 2019 Fukuoka
Sample codes:
https://github.com/udzura/ruby-2.7.0-samples
KONDO Uchio
August 29, 2019
Tweet
Share
More Decks by KONDO Uchio
See All by KONDO Uchio
大規模レガシーテストを 倒すための CI基盤の作り方 / #CICD2023
udzura
5
2.3k
Ruby x BPF in Action / RubyKaigi 2022
udzura
0
220
Narrative of Ruby & Rust
udzura
0
190
開発者生産性指標の可視化 / pepabo-four-keys
udzura
3
1.6k
Talk of RBS
udzura
0
410
Re: みなさん最近どうですか? / FGN tech meetup in 2021
udzura
0
740
Dockerとやわらかい仮想化 - ProSec-IT/SECKUN 2021 edition -
udzura
2
700
Device access filtering in cgroup v2
udzura
1
820
"Story of Rucy" on RubyKaigi takeout 2021
udzura
0
770
Other Decks in Technology
See All in Technology
Windows の新しい管理者保護モード
murachiakira
0
200
Share my, our lessons from the road to re:Invent
naospon
0
140
Active Directory攻防
cryptopeg
PRO
8
5.4k
脳波を用いた嗜好マッチングシステム
hokkey621
0
280
1行のコードから社会課題の解決へ: EMの探究、事業・技術・組織を紡ぐ実践知 / EM Conf 2025
9ma3r
10
3.7k
いまからでも遅くない!コンテナでWebアプリを動かしてみよう!コンテナハンズオン編
nomu
0
150
NFV基盤のOpenStack更新 ~9世代バージョンアップへの挑戦~
vtj
0
340
偏光画像処理ライブラリを作った話
elerac
1
170
Perlの生きのこり - エンジニアがこの先生きのこるためのカンファレンス2025
kfly8
2
270
「正しく」失敗できる チームの作り方 〜リアルな事例から紐解く失敗を恐れない組織とは〜 / A team that can fail correctly
i35_267
5
850
設計を積み重ねてシステムを刷新する
sansantech
PRO
0
160
組織におけるCCoEの役割とAWS活用事例
nrinetcom
PRO
4
120
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
521
39k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
A Tale of Four Properties
chriscoyier
158
23k
Six Lessons from altMBA
skipperchong
27
3.6k
Building Your Own Lightsaber
phodgson
104
6.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
For a Future-Friendly Web
brad_frost
176
9.6k
Unsuck your backbone
ammeep
669
57k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Java REST API Framework Comparison - PWX 2021
mraible
29
8.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Transcript
All About Ruby in 2019 2019ɺվΊͯ͢ΔRuby―RubyKaigi͔ΒݟΔRuby 3.0ͷՄೳੑ Presentation by Uchio
Kondo @Developers Summit 2019 Fukuoka
Engineer @ GMO Pepabo, Inc. Uchio Kondo / @udzura https://blog.udzura.jp/
* ɹɹɹɹɹɹɹɹ ϩʔΧϧΦʔΨφΠβʔ/ొஃऀ * CloudNative Days Fukuoka 2019 νΣΞΦʔΨφΠβʔ * ίϛϡχςΟ: Fukuoka.rb ɺ #;͘Ͷͯ͢ * Duolingo Ruby Leaguer
Ruby Language
࣭Ͱ͢ • ͓ࣄͰRuby͍ͬͯ·͔͢ʁ • ͓ࣄͰRails͡Όͳ͍RubyΛ͍ͬͯ·͔͢ʁ • RubyKaigi 2019 in Fukuokaɺߦ͖·͔ͨ͠ʁ
Ruby in 2019
Ruby • ͘ΘΕ͍ͯΔϓϩάϥϛϯάݴޠͰ།Ұɺຊਓ͕։ൃͨ͠ͷ • εΫϦϓτݴޠɺΦϒδΣΫτࢦɺಈతܕ͚ • ࠷৽൛: 2.6.4 @ 2019-08-28
• ։ൃ൛: 2.7.0-preview1 @ 2019-05-31
TryRuby! • https://ruby.github.io/TryRuby/
Ruby on Dockerhub • Docker community͕४උͨ͠RubyҎ֎ʹɺRuby core teamͷϏϧυͯ͠ ͍ΔΠϝʔδ͕ଘࡏ͢Δɻ߹ʹΑͬͯͪ͜ΒΛͬͨํ͕͍͍͔ •
Docker community൛: ruby:2.6.3-* • Ruby core team൛: rubylang/ruby:2.6.3-* • trunk(एऀͷ͍͏master) ؆୯ʹར༻Ͱ͖Δ
diff • ઃఆ͞Ε͍ͯΔڥม͕ҧ͏ɻDocker community ެࣜͷͷบ͕͋ Δҹ... ٯʹ bionic Ҏ֎ͷbase imageDocker൛ʹ͔͠ͳ͍
RubyϦϙδτϦGitԽ • Β͘ Subversion ͕ϝΠϯϦϙδτϦ͕ͩͬͨGitʹҠߦ • GitHub ͳͲͰϛϥʔ͍͕ͨ͠ git-svn ͱͯ໘
• ύονΛૹͬͯ͘ΕͨਓͷใͳͲΛ͏·͘ࡌ͍ͤͨ • https://k0kubun.hatenablog.com/entry/ruby-core-2019 • https://www.hsbt.org/diary/20190423.html
git.ruby-lang.org • ެࣜͷϦϙδτϦcgitͰίϛϡχςΟ͕ϗετ͍ͯ͠Δ • ʮGitHubԽʯ͍ͯ͠ͳ͍ • ͱ͍͑clone͍ͨ͠ࡍGitHubͷϛϥʔਪ • GitHubʹPRΛग़ͤөͯ͘͠ΕΔ͠ɺίϯτϦϏϡʔλʹܝࡌ͞Ε Δʢʂʂʣ
• Git ͷࢄϦϙδτϦͰ͋Δͱ͜ΖͷϝϦοτ https://git.ruby-lang.org/ruby.git/
ͪͳΈʹ • ඪ४ϥΠϒϥϦ gem Խ͕΄΅ऴΘ͍ͬͯΔ • https://stdgems.org/ • GitHub ্Ͱɺ
Ruby ίΞͱผͷϦϙδτϦʹͳ͍ͬͯΔ ʢRubyίΞࣗମɺgitwebʹ͋Δʣ • https://github.com/ruby/
ͪͳΈʹ • ඪ४ϥΠϒϥϦͰ͋ͬͯɺʮ࠷৽൛ʯΛΠϯετʔϧͯ͠ར༻͕Մೳ $ gem install specific_install $ gem specific_install
http://github.com/ruby/irb $ gem list -d irb *** LOCAL GEMS *** irb (1.1.0.pre.2, 1.0.0) Author: Keiju ISHITSUKA Homepage: https://github.com/ruby/irb License: BSD-2-Clause Installed at (1.1.0.pre.2): /Users/udzura/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0 (1.0.0, default): /Users/udzura/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0 Interactive Ruby command-line tool for REPL (Read Eval Print Loop).
ruby-jp • ຊޠΛͤΔRubyistʹΑΔڊେSlack͕Ͱ͖ͨ • https://ruby-jp.github.io/ • > ruby-jp Ruby
ϓϩάϥϚʔಉ࢜ͷަྲྀΛతͱͨ͠ Slack ϫʔΫε ϖʔεͰ͢ɻ > ࢀՃऀͷٕज़ϨϕϧʹؔΘΒͣɺ࣭ɾ૬ஊɾใަΛؾܰʹͰ͖Δ Λࢦ͍ͯ͠·͢ɻ
Where Ruby is used • Web Application Framework: Ruby on
Rails • 6.0 released @ 2019-08-15
Where Ruby is used • Logging middleware: Fluentd • A
member project of Cloud Native Computing Foundation
Where Ruby is used • Infrastructure as Software: • Chef/Itamae
• Vagrant • Serverspec
Where Ruby will be used? • Frontend!!! • Opal •
Data Science • Red Data Tools
͓·͚: mruby • ʮΈࠐΈʯ͚ mruby • ಛ: • CRuby ͱൺόΠφϦ͕খ͔ͬͨ͞ΓলϝϞϦ
ʮશ෦ೖΓʯmrubyόΠφϦ/static libΛ࡞Γ͍͢ C API͕උ͞Ε͍ͯΔ • ͨͩ͠ɺࠓCRubyͷΛத৺ʹ͠·͢...
RubyKaigi in 2019 https://rubykaigi.org/2019
Venue • Ԭࠃࡍձٞ @ 2019-04-18 ~ 20
ϥϯν
࠙ձ
Talks
Topics • Keynotes: • About Ruby 3 and its future
by Matz • Branch Maintainer’s Life by nagachika • Extreme optimization tech for Ruby by Jeremy • Talks: • C-level Ruby optimization / specification details • Ecosystems such as bundler, RSpec, Typings, Homebrew... • JRuby / TruffleRuby / mruby... / serverless, containers, cloudnative...
Ruby committers vs the world • Photo from: https://tech.drecom.co.jp/rubykaigi-2019-day3-report/
Ruby updates in (2.3..2.6)
Ruby 2.3.0 • Frozen String Literal ϓϥάϚ • did_you_mean gem
ͷόϯυϧ • ʮ&.ʯΦϖϨʔλͷಋೖɻnilͰͳΔ҆͘શʹϝιουݺͼग़͠ • ύϑΥʔϚϯεͷվળʢProc#call ͷ࠷దԽͳͲʣ
Ruby 2.4.0 • Fixnum/Bignumͷ౷߹ • binding.irb ͱॻ͚ΔΑ͏ʹͳΔ • ύϑΥʔϚϯεվળʢHashͷ෦σʔλߏมߋͳͲʣ
Ruby 2.5.0 • rescue/else/ensure Λ do/end ϒϩοΫʹॻ͚ΔΑ͏ʹ • ΧόϨοδͷڧԽʢذΧόϨοδͱϝιουΧόϨοδͷαϙʔτʣ •
ύϑΥʔϚϯεͷվળʢVMͰͷtrace໋ྩͷཧɺϒϩοΫ͠ͷํࣜม ߋɺERBͷվળʣ
Ruby 2.6.0 • JITͷಋೖ • RubyVM::AST ͷಋೖ • ऴͳ͠Rangeͷಋೖ •
ύϑΥʔϚϯεͷվળ ʢϒϩοΫݺͼग़͠ͷվળɺίϧʔνϯͷωΠςΟϒԽʣ
None
Six Years of Ruby Performance • From RubyKaigi 2019 https://rubykaigi.org/2019/presentations/codefolio.html
What’s new in Ruby 2.7.0 !!
Caveats • ਖ਼ࣜϦϦʔεલͷόʔδϣϯͷ༷ͳͷͰมߋ͢Δ͜ͱ͕͋Γ·͢ • ࣮ࡍൃදޙʹ2ՕॴมΘ͍ͬͯ·͢ʼʻ • ൃද࣌ʢ2019-08-29 17:00ʣͰͷใͱͳΓ·͢
Pattern matching • case ... in ... ͱ͍͏จ๏Λಋೖ • ෳࡶͳߏͷϚονϯάͷधཁʹԠ࣮͑ͯɻ
ΨʔυઅͳͲ͋Δ • Duck TypingΛར༻ͯ͠Ϛονϯά͢ΔΫϥεΛ֦ுͰ͖Δ http://blog.akanumahiroaki.com/entry/2019/05/02/200000
Pattern matching: demo
Numbered parameter in block https://autopp-tech.hatenablog.com/entry/2019/03/19/095500
Changed! (edited after presentation) • @1, @2, @3 -> _1,
_2, _3 • _1, _2, _3 ͱ͍͏ϩʔΧϧม͕͋ͬͨΒܯࠂ͕ग़ΔΑ͏ʹͳΓ·͢
Beginless range https://blog.saeloun.com/2019/08/19/ruby-2-7-adds-beginless-range.html
Pipeline operator https://dev.to/baweaver/ruby-2-7-the-pipeline-operator-1b2d ※ ͜Ε preview-1 ʹؚ·Εͣɺdev൛ͷΈͰ͢
reverted... (edited after presentation) > Maybe we would revisit the
idea in the future (with different operator appearance)
.: operator
IRB improvement Syntax highlight ϝιουิ࣌ʹ υΩϡϝϯτ͕ग़Δ
More next generation features in Ruby
Typing • Current implementations: • Sorbet • ίʔυͷܕΞϊςʔγϣϯ • Steep
• Gradual TypingɺܕఆٛϑΝΠϧ(.rbi) • ...
Sorbet demo:
Sorbet demo:
Steep demo:
Concurrency (Guild) • Many presentations by Koichi Sasada • "Guild
Prototype" in RubyKaigi “2018” https://www.slideshare.net/KoichiSasada/guild-prototype
Guild Idea • Thread/FiberΛ͞ΒʹแΉͷͱͯ͠GuildʢԾ໊ʣΛಋೖ • Guildʹॴଐ͍ͯ͠ΔΦϒδΣΫτɺଞͷGuild͔Β৮Εͳ͍ • Guildಉ࢜ͰΠϛϡʔλϒϧͳΦϒδΣΫτ͚ͩΛɺνϟϯωϧͰڞ༗
Concurrency (AutoFiber) • Switch Fibers by I/O operations • ʮ໊લʯ...
https://bugs.ruby-lang.org/issues/13618
Is Ruby dead??
What is being dead? • ୭Θͳ͘ͳͬͨΒʁ • ։ൃ͕ఀࢭͨ͠Βʁ/׆ൃͰͳ͘ͳͬͨΒʁ • ʹͳΒͳ͘ͳͬͨΒʁ
Hype Cycles https://www.gartner.com/jp/research/methodologies/gartner-hype-cycle
Conclusion
The future • Ruby ࠓΞΫςΟϒʹ։ൃ͕͞Ε͍ͯΔ • Ϣʔβ͕ଟ͍ݴޠͰ͋Δʹ͔͔ΘΒͣɺະདྷͷͨΊʹେ͖ͳมߋ͕ ೖ͍ͬͯΔͱ͜Ζ • ܕ҆શੑɺฒߦੑɺύλʔϯϚονͳͲͷ࠷ۙͷݴޠͷՌΛऔΓೖΕ
Α͏ͱ͍ͯ͠Δ • ͏·͍͚͘ɺΑΓݱతͳݴޠͱͯ͠࠶͕ू·Δ͔
มԽΛָ͠͏ Enjoy Programming, Enjoy Changes
[PR]
Fukuoka.rb #150 #149 @ 9/18(Wed) https://fukuokarb.connpass.com/event/144604/