Slide 1

Slide 1 text

Elixir/NervesӴ੕Λଧ্ͪ͛Δ೔ ๺۝भࢢཱେֶ ࢁ࡚ ਐ 1 © 2022 Susumu Yamazaki

Slide 2

Slide 2 text

ࣗݾ঺հ • ࢁ࡚ ਐ (ZACKY) • ๺۝भࢢཱେֶ ࠃࡍ؀ڥ޻ֶ෦ ।ڭत • ओͳݚڀςʔϚ • Elixir, Phoenix, Nerves, NxΛ࢖ͬͨγεςϜ࣮ ૷ɾࣾձ࣮૷ • Elixirϕʔεͷਓ޻Ӵ੕ը૾ॲཧγεςϜ • ຊ೔͸෱Ԭݝ๺۝भࢢ಺ΑΓΦϯϥΠϯͰൃද ͍ͯ͠·͢ 2 © 2022 Susumu Yamazaki

Slide 3

Slide 3 text

ҎԼɼࢁ࡚ਐͷಉλΠτϧͷϙδγϣϯ ϖʔύʔΛࢀর͠ͳ͕Β͝ཡ͍ͩ͘͞ 3 © 2022 Susumu Yamazaki

Slide 4

Slide 4 text

࿩ͷલఏ 4 © 2022 Susumu Yamazaki

Slide 5

Slide 5 text

Elixir(ΤϦΫαʔ)ͱ͸ʁ 5 © 2022 Susumu Yamazaki

Slide 6

Slide 6 text

ฒྻϓϩάϥϛϯάݴޠElixir(ΤϦΫαʔ) • 2012೥ʹJosé Valim(δϣθɾϰΝϦϜ)ʹΑͬͯ։ൃ͞Εͨϓϩάϥϛϯάݴޠ • ࠓ೥2022೥͸10प೥ʂ • José͸ɼҎલ͸Ruby on RailsͷίϛολʔͰͨ͠ • Joséͷ໰୊ҙࣝͱͯ͠ɼRubyͷ͔ΘΓʹɼ΋ͬͱߴ଎ʹಈ࡞͢Δϓϩάϥϛϯάݴ ޠ͕ඞཁͰ͋Δͱߟ͍͑ͯ·ͨ͠ • ͍Ζ͍Ζ୳ڀͯ͠Erlang(Ξʔϥϯ)ͱ͍͏ؔ਺ܕݴޠʹग़⁊͍·͢ • Erlang͸ނJoe Armstrong(δϣʔɾΞʔϜετϩϯά)Λத৺ʹΤϦΫιϯͰ1986 ೥͔Β։ൃ͕ਐΊΒΕ͍ͯ·ͨ͠ • Erlang͸ΤϦΫιϯͷࣄۀͷ1ͭͰ͋ͬͨి࿩ަ׵ػ޲͚ʹઃܭ͞Ε͓ͯΓɼి࿩ ަ׵ػ༻్ʹ଱͑ΒΕΔΑ͏ɼݎ࿚͔ͭฒߦॲཧΛ௥ٻ͍ͯ͠·ͨ͠ • ి࿩ަ׵ػ༝དྷͱ͸ɼTRON OSͷ1ͭͷCTRONͱ͍ۙϞνϕʔγϣϯͰ͢Ͷ • ͨͩ͠ɼErlangͷจ๏͸ͱ͖ͬͭʹ͍͘ͷ͕ܽ఺Ͱͨ͠ • ͦ͜ͰɼJosé͸Rubyͱಉ౳Ҏ্ͷϓϩάϥϜίʔυͷॻ͖΍͢͞Λ௥ٻ͠ɼErlangΛ ϕʔεͱͯ͠ฒߦॲཧج൫Λ੔උͨ͠৽͍͠ϓϩάϥϛϯάݴޠ Elixir Λ։ൃ͠·͢ • Elixir ͸࿉ۚज़ࢣ͕௥͍ٻΊͨෆ࿝ෆࢮͷྶༀͷ໊લͰ͢ • José͍Θ໋໊͘ཧ༝͸ɼErlangͱಉ͡EͰ࢝·Δ͔͍͍ͬ͜୯ޠͱ͍͏Ҏ্ͷ͜ ͱ͸͍֮͑ͯͳ͍ͦ͏Ͱ͢ • Ұ࣌ظݴΘΕ͍ͯͨɼJosé͕ϑΝΠφϧϑΝϯλδʔʹڵ໋໊͍ͯͯͨ͡͠ͱ͍ ͏આ͸ɼJoséࣗ਎ʹΑͬͯ൱ఆ͞Ε·ͨ͠ • Elixir͸ύΠϓϥΠϯԋࢉࢠ|>͕ಛ௃తͰɼ͜ΕΛ࢖ͬͯॻ͍ͨϓϩάϥϜίʔυ͸ɼ ࠨ͔Βӈ΁ɼ͋Δ͍͸্͔ΒԼ΁ɼσʔλΛม׵͍༷ͯ͘͠ΛྲྀΕΔΑ͏ʹಡΈԼ͢ ͜ͱ͕Ͱ͖·͢ 1..1_000_000 # 1͔Β1,000,000·ͰͷϦετΛ |> Enum.map(& &1 * 2) # ֤ཁૉ2ഒͯ͠ |> Enum.map(& &1 + 1) # ͞Βʹ֤ཁૉʹ1଍ͨ͠ϦετΛฦ͢ • Elixir͸ɼ͜ͷΑ͏ͳίʔυΛ؆୯ʹฒྻԽ͢Δ͜ͱ͕Ͱ͖·͢ 6 © 2022 Susumu Yamazaki © Elixir Team

Slide 7

Slide 7 text

Nerves(φʔϰε)ͱ͸ʁ 7 © 2022 Susumu Yamazaki

Slide 8

Slide 8 text

࢖͍΍͍͢IoTج൫Nerves(φʔϰε) • 2015೥͔ΒNerves Project developersʹΑͬͯ ։ൃ͕ਐΊΒΕ͖ͯͨɼElixirϕʔεͷIoTج൫ • Tombo Worksͷࢿྉࢀর 8 © 2022 Susumu Yamazaki Copyright (C) 2015- by the Nerves Project developers https://swest.toppers.jp/SWEST24/proceedings/interactive/SWEST24-IS-004.pdf

Slide 9

Slide 9 text

ͱ͜ΖͰ 9 © 2022 Susumu Yamazaki

Slide 10

Slide 10 text

঎༻ͷਓ޻Ӵ੕ʹmruby͕ ࡌͬͨͦ͏Ͱ͢Ͷ 10 © 2022 Susumu Yamazaki

Slide 11

Slide 11 text

঎༻ͷਓ޻Ӵ੕ʹmruby͕ࡌͬͨͦ͏Ͱ͢Ͷ • Ruby Business Users Conference 2021 Online • 2021೥2݄26೔(ۚ)ɹ15:35ʙ16:15 • খܕϨʔμʔӴ੕։ൃʹ͓͚Δmrubyͷద༻ • QPSݚڀॴCEO େ੢ढ़ี 11 © 2022 Susumu Yamazaki https://i-qps.net/news/438

Slide 12

Slide 12 text

ͦΕʹର߅͢ΔΘ͚Ͱ΋ ͳ͍Ͱ͕͢ 12 © 2022 Susumu Yamazaki

Slide 13

Slide 13 text

Elixir/NervesΛ౥ࡌͨ͠ ਓ޻Ӵ੕Λଧ্͍ͪ͛ͨͰ͢ 13 © 2022 Susumu Yamazaki

Slide 14

Slide 14 text

JAXAͷ ֵ৽తӴ੕࣮ূϓϩάϥϜ 14 © 2022 Susumu Yamazaki

Slide 15

Slide 15 text

KOSEN-1 15 © 2022 Susumu Yamazaki

Slide 16

Slide 16 text

Elixir/Nerves౥ࡌਓ޻Ӵ੕ΛJAXAͷֵ৽త Ӵ੕ٕज़࣮ূϓϩάϥϜͰଧ্ͪ͛Δʂ 16 © 2022 Susumu Yamazaki

Slide 17

Slide 17 text

ͲΜͳӴ੕Λ ଧ্ͪ͛Δʁ 17 © 2022 Susumu Yamazaki

Slide 18

Slide 18 text

Elixirͱ͍͑͹෼ࢄฒྻॲཧ ࠷৽ͷػցֶशج൫Nx΋౥ࡌͯ͠ σʔλॲཧӴ੕Λ࣮ݱ 18 © 2022 Susumu Yamazaki

Slide 19

Slide 19 text

σʔλॲཧӴ੕ 19 © 2022 Susumu Yamazaki

Slide 20

Slide 20 text

QPSݚڀॴ͸JAXAͱ૊ΜͰSARӴ੕͔ΒσʔλॲཧӴ੕ ͱӴ੕ؒ௨৴ΛߦͳͬͯӉ஦্ۭؒͰඞཁͳσʔλॲཧΛ ͔ͯ͠Β஍্ʹॲཧࡁΈͷσʔλΛૹΔͱ͍͏ߏ૝Λൃද 20 © 2022 Susumu Yamazaki

Slide 21

Slide 21 text

SARӴ੕ 21 © 2022 Susumu Yamazaki

Slide 22

Slide 22 text

Nx 22 © 2022 Susumu Yamazaki

Slide 23

Slide 23 text

Elixirͱ͍͑͹෼ࢄฒྻॲཧ ࠷৽ͷػցֶशج൫Nx΋౥ࡌͯ͠ σʔλॲཧӴ੕Λ࣮ݱ 23 © 2022 Susumu Yamazaki

Slide 24

Slide 24 text

جૅݚڀΛ͢ΔͨΊͷݚڀඅΛ֬อࡁ ໨ԼɼݚڀΛਐΊ͍ͯΔͱ͜Ζ 24 © 2022 Susumu Yamazaki