Slide 1

Slide 1 text

ErlangͱElixir͕ಥ͖෇͚Δ΋ͷ ͋Δ͍͸ੑೳͱ҆શͷऴΘΓͳ͖ઓ͍ʹ͍ͭͯ Erlang/OTPͱͷ͜ͷ10೥ΛৼΓฦΓͭͭߟ͑Δ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 1

Slide 2

Slide 2 text

ྗ෢ ݈࣍ Γ͖͚ͨ ͚Μ͡ 2018೥6݄16೔ Erlang and Elixir Fest 2018 ळ༿ݪίϯϕϯγϣϯϗʔϧ @jj1bdx Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 2

Slide 3

Slide 3 text

[PR] ͓࢓ࣄืूதͰ͢ 53ࡀ / ϓϩάϥϛϯάྺ44೥ ιϑτ΢ΣΞΤϯδχΞྺ28೥໨ Erlang/OTPྺ11೥໨ ྗ෢݈ٕ࣍ज़࢜ࣄ຿ॴ ॴ௕ ϖύϘݚڀॴ ٬һݚڀһ ઌ݄·Ͱ7ϲ݄C++ͱC#ͱsvnͱVisual Studioͷ࢓ࣄͯ͠·ͨ͠ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 3

Slide 4

Slide 4 text

͜ͷ10೥ΛৼΓฦΔ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 4

Slide 5

Slide 5 text

Erlang/OTPͱͷग़ձ͍ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 5

Slide 6

Slide 6 text

2008೥2݄ Cݴޠʹઈ๬͍ͯͨ͠ ౦ژ ೔ຊڮ ؙળ खʹͱͬͯΈͨ ໘ന͍ ͙͢ʹ௨ൢͰങͬͯಡΜͩ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 6

Slide 7

Slide 7 text

Erlang/OTPίϛϡχςΟ΁ ࠷ॳ͸FreeBSDͰͷ͏Δ͏ඵύον͔Β ͦͷ͏ͪWindowsͱࠞͥͨΓ͍Ζ͍Ζ࣮ݧ ౰࣌͸ηΩϡϦςΟؔ࿈ͷݚڀΛ͍ͯͨ͠ SSHͷRPCͱ͔ࢥ͍ͭ͘ …ൃදͰ͖ͦ͏ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 7

Slide 8

Slide 8 text

2010೥3݄ Erlang Factory SF Bay 2010 Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 8

Slide 9

Slide 9 text

௕͍෇͖߹͍͕࢝·Δ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 9

Slide 10

Slide 10 text

2011೥9݄ ౦ژͰ Erlang Workshop ࣮ߦҕһ௕Λ΍Γ੾Δ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 10

Slide 11

Slide 11 text

࣮͸2011೥ʹ ͍͢͝Eຊ ͦͯ͠ Erlang In Anger …ͷݪయͱͳΔϓϨθϯ͕ αϯϑϥϯγείͰߦΘΕͨ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 11

Slide 12

Slide 12 text

໘ന͘ͳ͖ͬͯͨ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 12

Slide 13

Slide 13 text

Elixirͱͷग़ձ͍ * * Elixirͷϩΰ͸PlataformatecͰ঎ඪొ࿥࡞ۀதͷͨΊڐՄͳ͘࢖͏͜ͱ͸Ͱ͖·ͤΜɻ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 13

Slide 14

Slide 14 text

2014೥3݄ Erlang Factory SF Bay 2014 Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 14

Slide 15

Slide 15 text

José Valim Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 15

Slide 16

Slide 16 text

Dave Thomas Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 16

Slide 17

Slide 17 text

িܸతͳߨԋ ݁ߏͳ෺ٞΛৢͯ͠େมͩͬͨΈ͍ͨͰ͕͢ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 17

Slide 18

Slide 18 text

Catalyze changes มԽͷ৮ഔͱͳΕ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 18

Slide 19

Slide 19 text

ߨԋ಺༰ʢͷཁࢫʣ Erlang͸ಡΈʹ͍͘! Ϩίʔυ͕೉͍͠! υΩϡϝϯτ͕ͳ͍! ͳΜͱ͔͠Α͏ͥ! Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 19

Slide 20

Slide 20 text

༗ݴ࣮ߦ Dave Thomas͸ Elixirͱؔ࿈ٕज़ͷ ϓϩϞʔγϣϯʹ ਚྗ ࣗ෼Ͱ1࡭ PragProgͰ7࡭ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 20

Slide 21

Slide 21 text

2016೥ ϓϩάϥϛϯά Elixir೔ຊޠ൛ొ৔ RubyίϛϡχςΟ ͷਓୡΛͪ´ ͱݟ͔͚ΔΑ͏ʹ ͳͬͨ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 21

Slide 22

Slide 22 text

2018೥ 2݄ʹେࣄ݅ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 22

Slide 23

Slide 23 text

erlang-questions ϝʔϦϯάϦετʹͯ ͜ͱ΋͋Ζ͏ʹࠩผ༻ޠΛ ࣗ෼ͷϨϙδτϦʹ෇͚ͯ ͠·ͬͨਓ͕͍ͨ ͍͢͝EຊͱErlang In Angerͷ ஶऀ͕߅ٞ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 23

Slide 24

Slide 24 text

େ࿦૪ ऩर͢Δͷ͕େมͩͬͨΒ͍͠Ͱ͢ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 24

Slide 25

Slide 25 text

2018೥5݄31೔ʙ6݄1೔ ε΢ΣʔσϯͷετοΫϗϧϜʹͯ Code BEAM STO 2018 Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 25

Slide 26

Slide 26 text

ձٞͷςʔϚʢͷҰ෦ʣ Open Erlang 20प೥ BEAMίϛϡχςΟͷ༥߹ ೔ৗͱͯ͠ͷμΠόʔγςΟ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 26

Slide 27

Slide 27 text

௕͍લৼΓΛऴΘΓ·͢ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 27

Slide 28

Slide 28 text

ErlangͱElixir ͦͯͦ͠ͷଞͷLFE, efene, Alpaca, clojerl, luerl, etc. Ͳ͕͓͍͍͜͠ͷ? Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 28

Slide 29

Slide 29 text

ྗ෢ͷߟ͑ΔϝϦοτ Immutability σΟʔϓίϐʔ ࢀরΛ࢖Θͳ͍ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 29

Slide 30

Slide 30 text

ैདྷͷݴޠ ม਺͸࠶ར༻ ࢀর͔͠ίϐʔ͠ͳ͍ Ͱ͖ΔݶΓ࣮ମΛڞ༗ ↑͢΂ͯόάͷݩ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 30

Slide 31

Slide 31 text

ैདྷͷݴޠͷݪଇ ۃྗίϐʔͨ͘͠ͳ͍ ۃྗϝϞϦΛઅ໿͍ͨ͠ ҆શΑΓ΋ޮ཰ ୅ೖͷཤྺΛऔΕͳ͍ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 31

Slide 32

Slide 32 text

C++Ͱࠔͬͨ͜ͱ ม਺͸஋? ࢀর? const෇͖? ͳ͠? ίϯετϥΫλ͸͍ͭಈ͘? std::unique_ptr<> ͋Δ͍͸ shared_ptr<> →ෳ਺ͷໃ६͢ΔηϚϯςΟΫε͕ಉ࣌ʹଘࡏ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 32

Slide 33

Slide 33 text

Erlang΍ElixirͰ͸ࠔΓ·ͤΜ ม਺͸͢΂࣮ͯମ Ұ౓֬ఆ࣮ͨ͠ମ͸ෆม ୅ೖ͸ඞͣ৽͍࣮͠ମΛ࡞Δ ࢀরΛߟ͑ͳ͍͍͔ͯ͘Βָ ʢETSͱ͔ϓϩηεࣙॻͱ͔࢖͏ͱେมͰ͕͢ʣ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 33

Slide 34

Slide 34 text

Erlang΍Elixirͷݪଇ ඞཁͳΒͲΜͲΜίϐʔ ϝϞϦઅ໿͸GCͰ ޮ཰ΑΓ΋҆શ ୅ೖͷཤྺΛऔΕΔ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 34

Slide 35

Slide 35 text

JavaScriptͷྫ // var a = {first: 1, second: 2} // b = a // ࢀরͷΈͷڞ༗ { first: 1, second: 2 } // a.second = 3 3 // b // ཁૉͷ࣮ମ͸ڞ༗ { first: 1, second: 3 } // b == { first: 1, second: 3 } false // ͳͥ? // ӈଆ͸ίϯετϥΫλͳͷͰҰக͠ͳ͍ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 35

Slide 36

Slide 36 text

Erlang/OTPͷྫ %%% ୅ೖ͢Δ࣮ମ͸ৗʹ৽ͭ͘͘͠ΒΕΔ %%% ࠶୅ೖ͸ͦ΋ͦ΋Ͱ͖ͳ͍ % A1 = {1,2,3}. {1,2,3} % B1 = A1. {1,2,3} % ίϐʔ͕Ͱ͖Δ % A2 = setelement(3,A1,4). {1,2,4} % B1 =:= {1,2,3}. true Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 36

Slide 37

Slide 37 text

Erlang΍ElixirͷσϝϦοτ ͱͯ΋஗͍ ൃ૝ͷస׵͕ඞཁ Ruby΍PHPͷΑ͏ʹ͸ॻ͚·ͤΜ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 37

Slide 38

Slide 38 text

Erlangͷ։ൃऀͷҰਓ Joe Armstrong͸ Ͳ͏ߟ͍͑ͯΔͷ͔ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 38

Slide 39

Slide 39 text

Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 39

Slide 40

Slide 40 text

Erlang/ElixirͰେࣄͳ͜ͱ ܰྔฒߦϓϩηε ΤϥʔϋϯυϦϯά ʢͱɺimmutabilityͩͱɺྗ෢͸ࢥ͍ͬͯ·͢ʣ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 40

Slide 41

Slide 41 text

ܰྔฒߦϓϩηε 1 ॲཧաఔ͸ͦΕͧΕϓϩηεʹׂΓ౰ͯΒΕͯฒߦʹॲཧ ೖྗ ॲཧ ग़ྗ ೖྗ1 → ॲཧ1 → ग़ྗ1 ೖྗ2 → ॲཧ2 → ग़ྗ2 ೖྗ3 → ॲཧ3 → ग़ྗ3 ೖྗ4 → ॲཧ4 → ग़ྗ4 1 Francesco Cesarini, Simon Thompson, "Erlang Programming", O'Reilly Media, 2009, p. 112, Figure 4-14 ΑΓྗ෢݈࣍ʹΑͬͯ࠶ߏ੒ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 41

Slide 42

Slide 42 text

ܰྔϓϩηεͷίϯτϩʔϧ 2 ࡞Δͷ͸spawnҰൃ མͱ͢ͷ͸link΍monitorͰOK ͖Ε͍ʹམͱ͢ͷ͸େม ϓϩηεΩϡʔ͕٧·Δͱऴྃ ॲཧ͕஗͍ͷͰ஫ҙ 2 ࡢ೥ͷElixir Conf Japan 2017ͷ@voluntasʹΑΔߨԋʮͳͥ Erlang/OTP Λ࢖͍ଓ͚Δͷ ͔ʯΛࢀর Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 42

Slide 43

Slide 43 text

ErlangͷΤϥʔϋϯυϦϯά ϦϯΫ (link) Ϟχλʔ (monitor) Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 43

Slide 44

Slide 44 text

Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 44

Slide 45

Slide 45 text

Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 45

Slide 46

Slide 46 text

Erlang/Elixirͷࠓޙ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 46

Slide 47

Slide 47 text

جຊཧ೦ Lagom är bäst ΄Ͳ΄Ͳͳͷ͕Ұ൪ྑ͍ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 47

Slide 48

Slide 48 text

΄Ͳ΄Ͳɺͱ͸ ҆શ͸ߴ଎Խʹ༏ઌ खΛൈ͔ͣʹߴ଎Խ έϯΧ͠ͳ͍/ͤ͞ͳ͍ίϛϡχςΟ ٸ͕ͣͰ͖Δ͜ͱΛண࣮ʹ΍͍ͬͯ͘ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 48

Slide 49

Slide 49 text

૊ΈࠐΈ෼໺΁ͷԠ༻ GRiSP / Nerves / ֤छ૊ΈࠐΈϘʔυͰͷ࣮ߦ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 49

Slide 50

Slide 50 text

ࠓޙͷൃలͷ༧૝ େن໛(>1000ϊʔυ)Ϋϥελ ϒϩοΫνΣʔϯ (Aeternity) Erlang/ElixirҎ֎ͷ֤छݴޠ Gradual Type System Language Server Protocol Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 50

Slide 51

Slide 51 text

Erlang/ElixirίϛϡχςΟ ଞͷݴޠʹ͘Β΂Δͱখ͞ͳίϛϡχςΟͰ͢ ͍͢͝ਓͩΒ͚ͰษڧͰ͖·͢ Elixirͷ͓͔͛Ͱ৽͍͠ਓ΋૿͑·ͨ͠ ೉͍͠ݴޠγεςϜͳͷͰϨϕϧ͕ߴ͍Ͱ͢ ඈͼࠐΜͰ͍͘ͱ਌੾ʹͯ͘͠Ε·͢ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 51

Slide 52

Slide 52 text

ੑೳΑΓ΋҆શΛ ༏ઌͰ͖ΔਓͳΒ͹ Erlang΍Elixirʹ ޲͍͍ͯΔͱࢥ͍·͢ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 52

Slide 53

Slide 53 text

࠷ޙʹࡢ೥ʹҾ͖ଓ͖ ͓ئ͍ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 53

Slide 54

Slide 54 text

ίϛϡχςΟʹ ೔ຊͷਓ͕ ͍·ͤΜ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 54

Slide 55

Slide 55 text

೔ຊࠃ֎Ͱ ӳޠͷ ੒ՌൃදΛ! Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 55

Slide 56

Slide 56 text

ΑΖ͘͠ ͓ئ͍͠·͢! Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 56

Slide 57

Slide 57 text

ँࣙ ͜ͷߨԋ͸ GMOϖύϘגࣜձࣾ ϖύϘݚڀॴͷ ͝ࢧԉͰ࣮ݱ͠·ͨ͠ ͋Γ͕ͱ͏͍͟͝·͢ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 57

Slide 58

Slide 58 text

[PR] ྗ෢݈ٕ࣍ज़࢜ࣄ຿ॴͰ͸ ͓࢓ࣄืूதͰ͢ ͝૬ஊ׻ܴக͠·͢ ͥͻ࠙਌ձͰ͓੠͕͚͍ͩ͘͞ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 58

Slide 59

Slide 59 text

͓͠·͍ ͋Γ͕ͱ͏͍͟͝·ͨ͠ ࣭͝໰ΛͲ͏ͧ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 59

Slide 60

Slide 60 text

ࣸਅ౳ΫϨδοτ • Title: Samuel Wong on Unsplash.com • José Valim: By Augie De Blieck from USA (elixirconf-47), CC BY 2.0, via Wikimedia Commons • Dave Thomas: By James Davidson (Flickr: Dave Thomas) CC BY 2.0, via Wikimedia Commons • Pragmatic Bookshelf Elixir/OTP/Phoenix books page • ϦϯΫʹΑΔྫ֎γάφϧૹ৴ྫ • ϞχλʔʹΑΔྫ֎ϝοηʔδૹ৴ྫ: ྗ෢݈࣍ɺʮErlangͰֶͿฒߦϓϩάϥϛϯάୈ8ճʯɺ Software Design 2015೥11݄߸ɺٕज़ධ࿦ࣾɺp. 124ͷਤΛ࠶ߏ੒ɻ • ε΢Σʔσϯࠃض: By Jon Harald Søby and others. Public domain, via Wikimedia Commons • ϖύϘݚڀॴϩΰ: GMOϖύϘגࣜձࣾ • εϥΠυதͷॻ੶ͷදࢴͱதදࢴʹ͍ͭͯ͸ΦʔϜࣾɺNo Starch Press, Pragmatic Bookshelfͷ ॻ੶৘ใΛઐΒॻ੶঺հͷ໨తͰ࢖༻͍ͯ͠·͢ɻ • ্هʹ஫ऍͷͳ͍ࣸਅɺਤɺֆʹ͍ͭͯ͸ྗ෢݈͕࣍ࡱӨɺฤूɺ੍࡞͍ͯ͠·͢ɻ Kenji Rikitake / Erlang and Elixir Fest 2018 16-JUN-2018 60