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

Rust本番投入をあきらめるためのガイドライン

KOBA789
July 04, 2018

 Rust本番投入をあきらめるためのガイドライン

あきらめないで
(これは https://d-cube.connpass.com/event/90317/ で発表した際の資料です)

KOBA789

July 04, 2018
Tweet

More Decks by KOBA789

Other Decks in Programming

Transcript

  1. Rustຊ൪౤ೖΛ

    ͖͋ΒΊΔͨΊͷ

    ΨΠυϥΠϯ
    KOBA789

    View full-size slide

  2. KOBA789
    ΫοΫύουגࣜձࣾ
    ΠϯϑϥετϥΫνϟʔ෦
    σʔλج൫άϧʔϓ
    2017೥2݄ʹେֶΛதୀͯ͠ೖࣾ
    ϓογϡ௨஌ͷ഑৴ج൫Ͱ
    RustΛຊ൪౤ೖ
    ΋ͱ΋ͱ͸JavaScriptͷਓ(13೥)

    View full-size slide

  3. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ˞ࠓ೔͸ϞώΧϯͰ

    ͍͖·͢

    View full-size slide

  4. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ࠓ೔࿩͞ͳ͍͜ͱ
    wਓؒͷઆಘ
    wݴޠ࢓༷
    wࡉ͔͍πʔϧ

    View full-size slide

  5. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ࠓ೔࿩͢͜ͱ
    wRustͷຊ൪౤ೖͷ

    ϋʔυϧ͸Կ͔
    wͲͷΑ͏ʹͦͷ

    ϋʔυϧΛ௒͑Δ͔

    View full-size slide

  6. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ϋʔυϧΛ໌Β͔ʹ͍ͯ͘͠ͷͰ

    ͥͻఘΊ͍ͯͩ͘͞

    View full-size slide

  7. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ͳͥ3VTUΛ

    ࢖͍͍ͨͷ͔

    View full-size slide

  8. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ੑೳ ҆શੑ
    ੜ࢈ੑ
    झຯ
    ࠾༻޿ใ

    View full-size slide

  9. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ͳͥRustΛ

    ࢖͑ͨͷ͔

    View full-size slide

  10. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ฐࣾͷίϯςφج൫
    ຕఆٛϑΝΠϧΛॻ͍ͯɺ
    ϦϙδτϦʹ13Λ౤͛Δͱɺ
    σϓϩΠͰ͖Δ
    Hako
    DockerͰଈドーン
    ΤϯδχΞͳΒ୭Ͱ΋

    View full-size slide

  11. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ݪཧతʹ͸

    ೚ҙͷ෺ମ͕ಈ͘

    View full-size slide

  12. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    Ͱ΋͜Ε͚ͩͰ

    ӡ༻ՄೳʹͳΔΘ͚͡Όͳ͍
    %PDLFSͰυʔϯ͘Β͍ࠓͲ͖ͲͷձࣾͰ΋Ͱ͖ΔͰ͠ΐ

    View full-size slide

  13. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    Rust࠾༻ͷ೉͠͞

    View full-size slide

  14. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    Rust࠾༻ͷ೉͠͞
    Rustಛ༗ͷ೉͠͞ ৽͍͕͠ނͷ೉͠͞

    View full-size slide

  15. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    Rust࠾༻ͷ೉͠͞
    Rustಛ༗ͷ೉͠͞ ৽͍͕͠ނͷ೉͠͞
    Lifetime Trait etc

    View full-size slide

  16. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    Rust࠾༻ͷ೉͠͞
    ৽͍͕͠ނͷ೉͠͞

    View full-size slide

  17. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    2৽͍͠ͱͳͥ೉͍͔͠
    "ਅࣅͰ͝·͔ͤͳ͍͔Β

    View full-size slide

  18. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ਅࣅͰ͝·͔ͤͳ͍ͱ͖
    جૅ΍ݪཧʹཔΔ

    View full-size slide

  19. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ׳ΕͯΔγεςϜɾݴޠͱͷ

    ҧ͍Λೝࣝ͢Δ
    ྫ͑͹

    View full-size slide

  20. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    Ruby Rust
    ྫ͑͹

    View full-size slide

  21. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    w ϥϯλΠϜ ΄΅
    ͳ͠Ͱಈ͘ͱ͸Ͳ͏͍͏͜ͱ͔
    w ຊ൪ͰΫϥογϡͨ͠ͱ͖͸ίΞμϯϓΛಡΉ͔΋
    w ࣮ߦ࣌ʹ$16΍04ΛӅณ͠ͳ͍
    w $16΍04ͷ஌͕ࣝͳ͍ͱτϥϒϧγϡʔςΟϯά͕
    ͱͯ΋ࠔ೉ʹͳΔ͔΋
    εΫϦϓτݴޠͷܦݧ͔͠ͳ͍ͱ

    ϋʔυϧʹͳΓ͑Δ

    View full-size slide

  22. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ӡ༻্ඞཁͳػೳΛ

    ੔ཧ͢Δ
    ྫ͑͹

    View full-size slide

  23. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    w ϩΪϯά
    w ద੾ͳϩΨʔϥΠϒϥϦ͸͋Δ͔
    w ࢲ͸ࣗ࡞͠·ͨ͠
    w ΤϥʔϋϯυϦϯάͱτϨʔαϏϦςΟ
    w ൃ୺ͱͳͬͨΤϥʔͱͦͷ఻೻Λ௥͑ͳ͍ͱΩπ͍
    ωοτϫʔΫϓϩτίϧΛ஻Δ

    σʔϞϯͷ৔߹

    View full-size slide

  24. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    w HSBDFGVMTIVUEPXO
    w ඞཁͳΒ࣮૷Λߟ͑ͳ͍ͱͶ
    w γάφϧͷϋϯυϦϯά
    w γεςϜίʔϧͰϒϩοΫͯ͠Δͱ͖ʹ4*(*/5ඈΜͰ
    ͖ͨΒͲ͏͢Δ
    w -JOVYϓϩάϥϛϯάͷڭՊॻΛ͓΋ΉΖʹऔΓग़͢
    ωοτϫʔΫϓϩτίϧΛ஻Δ

    σʔϞϯͷ৔߹

    View full-size slide

  25. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ϑϨʔϜϫʔΫͷ

    σϑΝΫτελϯμʔυ͕

    ͳ͍
    ׂͱࠔΓ͕ͪ

    View full-size slide

  26. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ඞཁͳγεςϜͷઃܭΛ

    θϩ͔Βى͜͢ඞཁ͕͋Δ
    ͭ·Γ

    View full-size slide

  27. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    w 3VTUͷݴޠػೳΛ׆͔ͨ͠ઃܭͱ͸
    w Ϟδϡʔϧ෼ׂͷ୯ҐͲ͏͢Δ͔
    w τϨΠτΛ༻͍ͨ%*Λ࡞ͬͯΈΔͱ͔
    ઃܭͷΰʔϧΛܾΊɺ

    ஸೡʹτϨʔυΦϑΛબ୒͍ͯ͘͠

    View full-size slide

  28. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    w εϨουͱΠϕϯτϧʔϓͷ࢖͍෼͚
    w ฒྻܭࢉΛ͍ͨ͠ͷ͔ɺ

    *0ΛଟॏԽ͍ͨ͠ͷ͔
    w εϧʔϓοτΛ্͍͛ͨͷ͔ɺ

    ϨΠςϯγΛ࡟Γ͍ͨͷ͔
    04ͷڭՊॻͳͲΛҾͬுΓग़ͦ͏

    View full-size slide

  29. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    ίϯϐϡʔλαΠΤϯε΍

    ιϑτ΢ΣΞΤϯδχΞϦϯάͷ

    ීวతͳ஌͕ࣝຯํʹͳΔ
    ·͊Զ͸େֶதୀͳΜͰ͚͢Ͳ

    View full-size slide

  30. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    Έͳ͞ΜఘΊ͸

    ͖ͭ·͔ͨ͠

    View full-size slide

  31. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    Կ΋೉͘͠ͳ͍Ͱ͢Ͷ

    View full-size slide

  32. Ғͦ͏ʹ஻͍ͬͯ·͢ KOBA789
    3VTUͷຊ൪ಋೖ͕ͳͥ೉͍͔͠ˠ3VTU͕৽͍͠΋ͷ͔ͩΒ
    ৽͍͠ͱͳͥ೉͍͔͠ˠਅࣅͰ͝·͔ͤͳ͍͔Β
    ਅࣅͰ͝·͔ͤͳ͍ͳΒͲ͏͢Δ͔ˠجૅ΍ݪཧʹཔΔ
    Զ͸Ͳ͏͔ͨ͠
    طଘͷγεςϜɾݴޠͱͷҧ͍Λ֬ೝͨ͠
    ͦͷաఔͰɺඞཁͳ஌ࣝ΍ٕज़Λशಘͨ͠
    ӡ༻্ඞཁͳػೳΛ੔ཧͨ͠
    ܦݧ͔Βɺӡ༻ͰҰൠʹඞཁͱͳΔػೳΛྻڍͨ͠
    ඞཁͳ΋ͷ͕ଗ͍ͬͯΔ͔֬ೝ͠ɺͳ͚Ε͹։ൃͨ͠
    ϑϨʔϜϫʔΫ͕ͳ͍ͷͰɺஸೡʹઃܭΛ͢Δ
    ઃܭͷΰʔϧΛܾΊɺτϨʔυΦϑΛબ୒͍ͯͬͨ͠
    *0ͷଟॏԽ ߴ଎Խ
    ʹ͍ͭͯ΋ݪཧʹ஧࣮ʹ
    ڭՊॻʹॻ͍ͯ͋ΔΑ͏ͳ͜ͱΛͪΌΜͱԡ͑͞Δ

    View full-size slide