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
760
Other Decks in Technology
See All in Technology
Share my, our lessons from the road to re:Invent
naospon
0
120
2024.02.19 W&B AIエージェントLT会 / AIエージェントが業務を代行するための計画と実行 / Algomatic 宮脇
smiyawaki0820
15
4.1k
コンピュータビジョンの社会実装について考えていたらゲームを作っていた話
takmin
1
530
IAMポリシーのAllow/Denyについて、改めて理解する
smt7174
2
170
ビジネスモデリング道場 目的と背景
masuda220
PRO
9
680
N=1から解き明かすAWS ソリューションアーキテクトの魅力
kiiwami
0
140
ユーザーストーリーマッピングから始めるアジャイルチームと並走するQA / Starting QA with User Story Mapping
katawara
0
280
ソフトウェアエンジニアと仕事するときに知っておいたほうが良いこと / Key points for working with software engineers
pinkumohikan
1
130
転生CISOサバイバル・ガイド / CISO Career Transition Survival Guide
kanny
3
1.1k
オブザーバビリティの観点でみるAWS / AWS from observability perspective
ymotongpoo
9
1.7k
Helm , Kustomize に代わる !? 次世代 k8s パッケージマネージャー Glasskube 入門 / glasskube-entry
parupappa2929
0
280
Developers Summit 2025 浅野卓也(13-B-7 LegalOn Technologies)
legalontechnologies
PRO
1
1.4k
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Typedesign – Prime Four
hannesfritz
40
2.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
980
The Pragmatic Product Professional
lauravandoore
32
6.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
Docker and Python
trallard
44
3.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
Navigating Team Friction
lara
183
15k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Mobile First: as difficult as doing things right
swwweet
223
9.4k
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/