Slide 1

Slide 1 text

Rubyͷ ͍··Ͱͱ͜Ε͔Β sugamasao [email protected] iCARE Dev Meetup #14(2020/10/21)

Slide 2

Slide 2 text

Rubyͷ ͍··Ͱͱ͜Ε͔Β RubyͰϫΫϫΫ͠ ͖ͯͨ࿩Λ͠·͢

Slide 3

Slide 3 text

※ݸਓͷײ૝

Slide 4

Slide 4 text

HN:sugamasao PN:͕͢ΘΒ ·͞ͷΓ Rubyྺ : 14೥͘Β͍ Railsྺ : 10೥͘Β͍ • ຊۀ • WebΞϓϦέʔγϣϯϓϩάϥϚʔ ʢגࣜձࣾSmartHRʣ • झຯ • Rubyʹؔ͢Δॻ੶ͷࣥච׆ಈ ͩΕʁ

Slide 5

Slide 5 text

झຯͷ׆ಈ ྦྷܭ5࡭ʢ2࡭͸վగ൛͋Γʣ

Slide 6

Slide 6 text

Ruby ָ͠ΜͰ·͔͢ʁ

Slide 7

Slide 7 text

ָ͠͞ʁ

Slide 8

Slide 8 text

ॻ͖ຯ ΤίγεςϜ ίϛϡχςΟ ਓͷ਺ָ͚ͩ͠Έํ͸͋Γ·͢Ͷ

Slide 9

Slide 9 text

ਓͧΕͧΕ ͍Ζ͍Ζ͋Δ

Slide 10

Slide 10 text

ʢࢲ͸ʣ ৽͍͠όʔδϣϯʹ௥ Ճ͞ΕͨػೳΛݟΔͱ ڵฃͯ͠͠·͏

Slide 11

Slide 11 text

⚠⚠⚠ ͔͜͜Βઌ͸ಠࣗݚڀɾ ಠࣗղऍͰ͢ ⚠⚠⚠

Slide 12

Slide 12 text

Rubyͷͬ͘͟Γͨ͠όʔδϣϯͷ ྺ࢙ 1.0 1996 2000 1.6 2005 1.8.4 2010 1.9.2 2015 2020 2.3.0 3.0.0 ※Rubyͷ”࢝·Γ”Λ͍͔ͭΒͱଊ͑Δ͔͸ॾઆ͋Γ·͢

Slide 13

Slide 13 text

1996ʙ2004͘Β͍ 1.0 1996 2000 1.6 2005 1.8.4 2010 1.9.2 2015 2020 2.3.0 3.0.0

Slide 14

Slide 14 text

͝ΊΜͳ͍͞ɺ͋·Γ ஌Βͳ͍Ͱ͢

Slide 15

Slide 15 text

1996ʙ2004͘Β͍ 1.0 1996 2000 1.6 1998 1.2 1999 1.4 2004 1.8.2 2003 1.8.0 ʙ C MagazineͰ࿈ࡌ RubyGemsҎલɺϥΠϒϥϦͳͲ͸RAAͱ͍͏ αΠτʹࡌͤΔ/ࡌͬͯΔͷΛ୳࣌͢୅ͩͬͨΑ͏ͳʢهԱũƄūŘʣ RubyGemsެ։

Slide 16

Slide 16 text

2005ʙ2009͘Β͍ 1.0 1996 2000 1.6 2010 1.9.2 2015 2020 2.3.0 3.0.0 2005 1.8.4

Slide 17

Slide 17 text

2005ʙ2009͘Β͍ 2005 1.8.4 2009 2007 1.9.0 1.9.1 Ruby 1.8·Ͱ͸1.X͕ۮ਺ = ҆ఆ൛ͱ͍͏Ґஔ͚ͮ 3VCZͷόʔδϣϯʹ͍ͭͯ Ruby 1.9.0͸։ൃ൛ Ruby 1.9.1͸ࢸߴͷ2.0.0΁޲͚ͯͷ҆ఆ൛ 2008 1.8.4 2005 1.8.7 2007 1.8.6 2007 1.8.5

Slide 18

Slide 18 text

2005ʙ2009͘Β͍ 2005 1.8.4 Rails 1.0ϦϦʔε 2009 2007 1.9.0 1.9.1 Rails 2.0ϦϦʔε(RESTfulϕʔεʹ) Rails 2.3ϦϦʔε(Rackϕʔεʹ) ೔ຊRubyΧϯϑΝϨϯε ʢͷͪͷ೔ຊRubyձٞʣ ։࠵ Rubyͷιʔείʔυ͕SVN؅ཧʹ Rails Conf 2006։࠵

Slide 19

Slide 19 text

Ruby 1.8ʙ1.9໰୊ Ruby 1.8ͱ1.9ʢ㲈2.0Ҏ߱ʣ͸େ͖ͳมԽ͕͋Γ·ͨ͠ • YARVͱݺ͹Ε͍ͯͨRubyͷιʔείʔυΛ όΠτίʔυʹม׵࣮ͯ͠ߦ͢ΔVMΛ౥ࡌ • จࣈྻͷଟݴޠԽʢM17NʣରԠ • R.I.P $KCODE • จࣈྻͷѻ͍ํ͸େ͖͘มΘΓɺASCIIҎ֎ͷ ΤϯίʔσΟϯάΛ࢖͏৔߹͸Ϛδίϝඞਢ • ࡉ͔͍ߏจղऍͷมߋ • RubyGems/Rake͕ඪ४ఴ෇ʹ

Slide 20

Slide 20 text

Ruby 1.8ʙ1.9໰୊ • VMͷ౥ࡌʢ଎͘ͳͬͨʂʣ΍RubyGemsͷඪ४ ఴ෇ʹΑΔศར͞ • ΤϯίʔσΟϯάͷѻ͍΍ߏจͷඍົͳඇޓ׵ʹ ΑΓʮRubyͬͯόʔδϣϯ͋͛Δͱ͙͢յΕΔ ͶʯΈ͍ͨͳΠϝʔδΛ΋ͨΕͨΓ ※ͪͳΈʹɺObjectSpace΍ripper΋1.9͔Β ಋೖɾಉࠝ͞ΕΔΑ͏ʹͳΓ·ͨ͠

Slide 21

Slide 21 text

2010ʙ2014͘Β͍ 1.0 1996 2000 1.6 2015 2020 2.3.0 3.0.0 2005 1.8.4 2010 1.9.2 ݸਓͷײ૝ɿ͜͜Βล͔ΒRubyΛ࢓ࣄͰ࢖͏ձ͕ࣾ૿͖͑ͯͨ

Slide 22

Slide 22 text

2010ʙ2014͘Β͍ 2010 1.9.2 2014 2.2.0 2013/12 2.1.0 2013/2 2.0.0 2011 1.9.3 Rails 3.0ϦϦʔε Merbͱ౷߹͞Εͨ……!! Bundlerͷಋೖ Rails 3.1ϦϦʔε AssetPipelineͷಋೖ CoffeeScriptͷ࣌୅ʢJS͸ίϯύΠϧ͢Ε͹ྑ͍ͱ͍͏ੈք؍ʣ “The Final RubyKaigi” ARelͷಋೖ reboot “RubyKaigi” Rails 3.2ϦϦʔε Rails 4.0ϦϦʔε (Ruby 1.9, 2.0Ҏ͕߱ λʔήοτʹ) Ruby 20प೥Πϕϯτ։࠵

Slide 23

Slide 23 text

͍ͭʹϦϦʔε͞ΕͨRuby 2.0 • Ruby 1.9.1ʙ1.9.3Λܦͯ଴๬ͷ2.0 • σϑΥϧτΤϯίʔσΟϯά͕UTF-8ʹͳͬͯ ʢଟ͘ͷ৔߹͸ʣϚδίϝෆཁʹ • ΈΜͳେ޷͖Refinements͕࣮ݧతػೳͱͯ͠ಋ ೖ • Karnel#requireͷੑೳվળͰRails͕ૣ͘ͳΔ • GCʹBitmapMarkingΛಋೖ(CoWͱͷ૬ੑ͕ྑ͘ͳͬͨ) • ϦϦʔεαΠΫϧ΍όʔδϣχϯάํ਑ͷมߋ

Slide 24

Slide 24 text

2015ʙ2019͘Β͍ 1.0 1996 2000 1.6 2005 1.8.4 2010 1.9.2 2015 2020 2.3.0 3.0.0 ݸਓͷײ૝ɿ͜͜Βล͔ΒRubyϑϧλΠϜίϛολʔ৬͕ͪΒ΄Βʁ

Slide 25

Slide 25 text

2015ʙ2019͘Β͍ 2015 2.3.0 2019 2.7.0 2016 2017 2018 2.4.0 2.5.0 2.6.0 RubyKaigi͕ ஍ํͰ։࠵͞ΕΔΑ͏ʹ ΦϯϥΠϯ։࠵ͷRubyKaigi APIϞʔυͷಋೖ Ruby 2.2.2Ҏ߱Λαϙʔτ Yarn/Webpackerαϙʔτ Rails 5.0ϦϦʔε Rails 5.1ϦϦʔε Rails 5.2ϦϦʔε Rails 6.0 ϦϦʔε ※࠷ۙͷग़དྷࣄͳͷͰলུύRailsങͬͯ͘Ε!!! RubyϦϙδτϦ͕git΁

Slide 26

Slide 26 text

Ruby 2.3ʙ2.7 • 2.3.0 • “Frozen String Literal”΍”&.”΍”did you mean”ͷಋೖ • 2.4.0 • “binding.irb”ͰσόοάՄೳʹ • Hashͷߴ଎Խ • 2.5.0 • ERB͕ΊͬͪΌૣ͘ͳΔ • ppͷࣗಈrequire

Slide 27

Slide 27 text

Ruby 2.3ʙ2.7 • 2.6.0 • Jitͷ࣮ݧతಋೖ • Bundler͕σϑΥϧτgemͱͯ͠ಉࠝ͞ΕΔΑ͏ʹ • 2.7.0 • irb͕relineʹΑΔ࣮૷ʹͳͬͯ͘͢͝ͳΔ • “ྩ࿨”ʹରԠ(UnicodeରԠ) • Pattern Matchingͷ࣮ݧతಋೖ • default gemsԽͷਪਐ • ΩʔϫʔυҾ਺ͷܯࠂൃੜʢ2.7.2Ͱ཈੍͞Εͨʣ

Slide 28

Slide 28 text

Ruby 3.0 1.0 1996 2000 1.6 2005 1.8.4 2010 1.9.2 2015 2020 2.3.0 3.0.0

Slide 29

Slide 29 text

Ruby 3.0 “ੑೳͷվળͱ ੜ࢈ੑͷվળ" Ruby Kaigi Takeout Matz KeynoteΑΓ

Slide 30

Slide 30 text

Ruby 3.0 • Fast • Concurrent • Correct ͘Θ͘͠͸Ruby Kaigi Takeout Matz KeynoteݟͯͶʢURL͸ࢀߟจݙʹࡌͤͯ·͢ʣ ʢଞʹ΋ͨ͘͞Μʂʣ

Slide 31

Slide 31 text

Fast • JITίϯύΠϥͷಋೖ • GCͷվળ

Slide 32

Slide 32 text

Concurrent • Async I/O Fiber • Ractor ϚϧνίΞ࣌୅ʹϦιʔεΛ༗ޮ׆༻͢Δ ͨΊʹ͸ฒߦ(CPU)࣮ߦͷखஈ͕ཉ͍͠

Slide 33

Slide 33 text

Correct • RBS(Ruby Signature) • Type Profiler(RBS Generations) • Static Type Checker(Third-Party) ࣮ߦલʹෆ੔߹Λݕ஌Ͱ͖ΔΑ͏ʹ͢ΔͨΊͷ Static Type Checksػߏ ※TypeProfͱ͍͏໊લʹมΘΓ·ͨ͠

Slide 34

Slide 34 text

(ຖ೥ࢮΜͰΔͬͯݴΘΕΔ͚Ͳ) ͜Ε͔Β΋RubyͰίʔυॻ͍͍ͯͧ͘ʂʂʂ̍

Slide 35

Slide 35 text

ࢀߟจݙ - ΦϒδΣΫτࢦ޲εΫϦϓτݴޠ Ruby - https://www.amazon.co.jp/dp/4756132545 - ϓϩάϥϛϯάRuby―ୡਓϓϩάϥϚʔΨΠυ - https://www.amazon.co.jp/dp/4894714531 - Ruby ιʔείʔυ׬શղઆ - https://book.impress.co.jp/books/1721 - ʮRuby on Rails 1.0ʯ͕ਖ਼ࣜϦϦʔε - https://www.itmedia.co.jp/enterprise/articles/0512/15/news098.html - “RESTful”ͳRuby on Rails 2.0ϦϦʔε - https://www.itmedia.co.jp/enterprise/articles/0712/11/news027.html - Rack౷߹ʮRuby on Rails 2.3ʯਖ਼ࣜ൛͕ϦϦʔε - https://mag.osdn.jp/09/03/18/0152252 - rails 3.0 - https://weblog.rubyonrails.org/2010/8/29/rails-3-0-it-s-done/ - Ruby 20प೥ - https://ruby20th.herokuapp.com/ - Ruby 2.3.0 - https://www.ruby-lang.org/ja/news/2015/12/25/ruby-2-3-0-released/ - Ruby 2.4.0 - https://www.ruby-lang.org/ja/news/2016/12/25/ruby-2-4-0-released/ - Ruby 2.5.0 - https://www.ruby-lang.org/ja/news/2017/12/25/ruby-2-5-0-released/ - Ruby 2.6.0 - https://www.ruby-lang.org/ja/news/2018/12/25/ruby-2-6-0-released/ - Ruby 2.7.0 - https://www.ruby-lang.org/ja/news/2019/12/25/ruby-2-7-0-released/ - RubyKaigi Takeout Matz Keynote - https://www.youtube.com/watch?v=wVrJZReHlM8