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.1k
Ruby x BPF in Action / RubyKaigi 2022
udzura
0
120
Narrative of Ruby & Rust
udzura
0
140
開発者生産性指標の可視化 / pepabo-four-keys
udzura
3
1.4k
Talk of RBS
udzura
0
310
Re: みなさん最近どうですか? / FGN tech meetup in 2021
udzura
0
640
Dockerとやわらかい仮想化 - ProSec-IT/SECKUN 2021 edition -
udzura
2
580
Device access filtering in cgroup v2
udzura
1
670
"Story of Rucy" on RubyKaigi takeout 2021
udzura
0
560
Other Decks in Technology
See All in Technology
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
4
4.7k
検証を通して見えてきたTiDBの性能特性
lycorptech_jp
PRO
6
3.7k
長期運用プロジェクトでのMySQLからTiDB移行の検証
colopl
2
840
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
120
Meta Quest 3 で動く桜マシマシ WebXR アプリを IBM Cloud Code Engine と Babylon.js で作った話
1ftseabass
PRO
0
120
地理空間データ可視化・解析・活用ソリューション Pacific Spatial Solutions (PSS)
pacificspatialsolutions
0
140
よく聞くけど使ったことないソフトウェアNo.1 KafkaとSnowflake
foursue
4
350
日本におけるデータエンジニアリングのこれまでとこれから
foursue
16
4.2k
VSCodeの拡張機能を作っている話
ebarakazuhiro
1
320
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
500
Janus
bkuhlmann
1
490
20240416_devopsdaystokyo
kzkmaeda
1
220
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
78
42k
Typedesign – Prime Four
hannesfritz
36
2.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
The MySQL Ecosystem @ GitHub 2015
samlambert
243
12k
GraphQLとの向き合い方2022年版
quramy
32
12k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
116
18k
The Language of Interfaces
destraynor
151
23k
10 Git Anti Patterns You Should be Aware of
lemiorhan
648
58k
A better future with KSS
kneath
231
16k
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/