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
190
Narrative of Ruby & Rust
udzura
0
170
開発者生産性指標の可視化 / pepabo-four-keys
udzura
3
1.6k
Talk of RBS
udzura
0
390
Re: みなさん最近どうですか? / FGN tech meetup in 2021
udzura
0
710
Dockerとやわらかい仮想化 - ProSec-IT/SECKUN 2021 edition -
udzura
2
670
Device access filtering in cgroup v2
udzura
1
770
"Story of Rucy" on RubyKaigi takeout 2021
udzura
0
720
Other Decks in Technology
See All in Technology
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
Amazon Personalizeのレコメンドシステム構築、実際何するの?〜大体10分で具体的なイメージをつかむ〜
kniino
1
100
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
590
SREによる隣接領域への越境とその先の信頼性
shonansurvivors
2
520
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
130
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
Engineer Career Talk
lycorp_recruit_jp
0
150
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
130
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
2
300
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
334
57k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Code Reviewing Like a Champion
maltzj
520
39k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
How GitHub (no longer) Works
holman
310
140k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Being A Developer After 40
akosma
86
590k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Agile that works and the tools we love
rasmusluckow
327
21k
Thoughts on Productivity
jonyablonski
67
4.3k
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/