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
200
Narrative of Ruby & Rust
udzura
0
180
開発者生産性指標の可視化 / pepabo-four-keys
udzura
3
1.6k
Talk of RBS
udzura
0
400
Re: みなさん最近どうですか? / FGN tech meetup in 2021
udzura
0
720
Dockerとやわらかい仮想化 - ProSec-IT/SECKUN 2021 edition -
udzura
2
680
Device access filtering in cgroup v2
udzura
1
790
"Story of Rucy" on RubyKaigi takeout 2021
udzura
0
740
Other Decks in Technology
See All in Technology
5分でわかるDuckDB
chanyou0311
10
3.3k
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
18
5.5k
JVM(JavaVM)の性能分析者観点で探るInstanaの可能性
instanautsjp
0
120
React Routerで実現する型安全なSPAルーティング
sansantech
PRO
2
280
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
340
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
0
120
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
150
OCI技術資料 : ファイル・ストレージ 概要
ocise
3
11k
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
32k
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
500
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
180
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
280
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Faster Mobile Websites
deanohume
305
30k
A Tale of Four Properties
chriscoyier
157
23k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Git: the NoSQL Database
bkeepers
PRO
427
64k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Adopting Sorbet at Scale
ufuk
73
9.1k
Designing for Performance
lara
604
68k
RailsConf 2023
tenderlove
29
940
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
910
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/