Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby in 2019

Ruby in 2019

@Developers Summit 2019 Fukuoka

Sample codes: https://github.com/udzura/ruby-2.7.0-samples

KONDO Uchio

August 29, 2019
Tweet

More Decks by KONDO Uchio

Other Decks in Technology

Transcript

  1. Engineer @ GMO Pepabo, Inc. Uchio Kondo / @udzura https://blog.udzura.jp/

    * ɹɹɹɹɹɹɹɹ ϩʔΧϧΦʔΨφΠβʔ/ొஃऀ * CloudNative Days Fukuoka 2019 νΣΞΦʔΨφΠβʔ * ίϛϡχςΟ: Fukuoka.rb ɺ #;͘͹Ͷͯ͢ * Duolingo Ruby Leaguer
  2. 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) ΋؆୯ʹར༻Ͱ͖Δ
  3. RubyϦϙδτϦGitԽ • ௕Β͘ Subversion ͕ϝΠϯϦϙδτϦ͕ͩͬͨGitʹҠߦ • GitHub ͳͲͰϛϥʔ͍͕ͨ͠ git-svn ͸ͱͯ΋໘౗

    • ύονΛૹͬͯ͘Εͨਓͷ৘ใͳͲΛ͏·͘ࡌ͍ͤͨ • https://k0kubun.hatenablog.com/entry/ruby-core-2019 • https://www.hsbt.org/diary/20190423.html
  4. ͪͳΈʹ • ඪ४ϥΠϒϥϦ͸ gem Խ͕΄΅ऴΘ͍ͬͯΔ • https://stdgems.org/ • GitHub ্Ͱɺ

    Ruby ίΞͱ͸ผͷϦϙδτϦʹͳ͍ͬͯΔ
 ʢRubyίΞࣗମ͸ɺgitwebʹ͋Δʣ • https://github.com/ruby/
  5. ͪͳΈʹ • ඪ४ϥΠϒϥϦͰ͋ͬͯ΋ɺʮ࠷৽൛ʯΛΠϯετʔϧͯ͠ར༻͕Մೳ $ 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).
  6. ruby-jp • ೔ຊޠΛ࿩ͤΔRubyistʹΑΔڊେSlack͕Ͱ͖ͨ • https://ruby-jp.github.io/ • > ruby-jp ͸ Ruby

    ϓϩάϥϚʔಉ࢜ͷަྲྀΛ໨తͱͨ͠ Slack ϫʔΫε ϖʔεͰ͢ɻ
 > ࢀՃऀͷٕज़ϨϕϧʹؔΘΒͣɺ࣭໰ɾ૬ஊɾ৘ใަ׵ΛؾܰʹͰ͖Δ ৔Λ໨ࢦ͍ͯ͠·͢ɻ
  7. Where Ruby is used • Web Application Framework: Ruby on

    Rails • 6.0 released @ 2019-08-15
  8. Where Ruby is used • Logging middleware: Fluentd • A

    member project of Cloud Native Computing Foundation
  9. ͓·͚: mruby • ʮ૊ΈࠐΈʯ޲͚ mruby • ಛ௃: • CRuby ͱൺ΂όΠφϦ͕খ͔ͬͨ͞ΓলϝϞϦ


    ʮશ෦ೖΓʯmrubyόΠφϦ/static libΛ࡞Γ΍͍͢
 C API͕੔උ͞Ε͍ͯΔ • ͨͩ͠ɺࠓ೔͸CRubyͷ࿩Λத৺ʹ͠·͢...
  10. 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...
  11. Ruby 2.3.0 • Frozen String Literal ϓϥάϚ • did_you_mean gem

    ͷόϯυϧ • ʮ&.ʯΦϖϨʔλͷಋೖɻnilͰ΋ͳΔ΂҆͘શʹϝιουݺͼग़͠ • ύϑΥʔϚϯεͷվળʢProc#call ͷ࠷దԽͳͲʣ
  12. Ruby 2.6.0 • JITͷಋೖ • RubyVM::AST ͷಋೖ • ऴ୺ͳ͠Rangeͷಋೖ •

    ύϑΥʔϚϯεͷվળ
 ʢϒϩοΫݺͼग़͠ͷվળɺίϧʔνϯͷωΠςΟϒԽʣ
  13. Pattern matching • case ... in ... ͱ͍͏จ๏Λಋೖ • ෳࡶͳߏ଄ͷϚονϯάͷधཁʹԠ࣮͑ͯ૷ɻ


    ΨʔυઅͳͲ΋͋Δ • Duck TypingΛར༻ͯ͠Ϛονϯά͢ΔΫϥεΛ֦ுͰ͖Δ http://blog.akanumahiroaki.com/entry/2019/05/02/200000
  14. Changed! (edited after presentation) • @1, @2, @3 -> _1,

    _2, _3 • _1, _2, _3 ͱ͍͏ϩʔΧϧม਺͕͋ͬͨΒܯࠂ͕ग़ΔΑ͏ʹͳΓ·͢
  15. reverted... (edited after presentation) > Maybe we would revisit the

    idea in the future (with different operator appearance)
  16. Concurrency (Guild) • Many presentations by Koichi Sasada • "Guild

    Prototype" in RubyKaigi “2018” https://www.slideshare.net/KoichiSasada/guild-prototype