Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ポイントで導入するRust
Search
Kazushige Tominaga
July 03, 2018
Programming
2
7.9k
ポイントで導入するRust
Running Rust in Production(
https://d-cube.connpass.com/event/90317/
)発表資料です
Kazushige Tominaga
July 03, 2018
Tweet
Share
More Decks by Kazushige Tominaga
See All by Kazushige Tominaga
スタディサプリのInternal Platform開発
kazu9su
0
1k
[スタディサプリ] Railsアプリケーションのモジュールとして存在していた Darklaunch (Feature Toggles) を Goアプリケーションとしてフルスクラッチでマイクロサービス化した話
kazu9su
0
2.2k
ExplorTechToronto20191016.pdf
kazu9su
0
57
キャッシュ安心戦略 with Feature Toggles
kazu9su
0
490
ebisurb20180724.pdf
kazu9su
1
230
How to contribute to OSS with test
kazu9su
0
340
プログラミング言語入門Vim編
kazu9su
1
360
プログラミング言語入門
kazu9su
1
2.5k
ebisurb15
kazu9su
0
50
Other Decks in Programming
See All in Programming
Modular Monolith Go Server with GraphQL Federation + gRPC
110y
1
580
Swiftコードバトル必勝法
toshi0383
0
150
マルチモジュールにおけるテスト最適化
fxwx23
0
210
はじめてみよう量子プログラミング
itokoichi01
0
140
2024 컴포즈 정원사
jisungbin
0
150
Understand the mechanism! Let's do screenshots tests of Compose Previews with various variations / 仕組みから理解する!Composeプレビューを様々なバリエーションでスクリーンショットテストしよう
sumio
3
620
1人で挑むSwiftコンパイラ 〜型システム入門編〜
s_shimotori
0
340
開発を加速する共有Swift Package実践
elmetal
PRO
0
410
Rubyのobject_id
qnighy
6
1.3k
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
620
React + TextAliveでカッコいいLyric Applicatioinを作ろう!!
tosuri13
0
400
Google Sign-inの移行から始めるCredential Manager活用
clockvoid
0
210
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
327
20k
How to Ace a Technical Interview
jacobian
274
23k
Code Review Best Practice
trishagee
62
16k
Robots, Beer and Maslow
schacon
PRO
157
8.2k
The Cult of Friendly URLs
andyhume
76
6k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
225
22k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Web development in the modern age
philhawksworth
204
10k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
Building Adaptive Systems
keathley
36
2.1k
Music & Morning Musume
bryan
46
6k
Fashionably flexible responsive web design (full day workshop)
malarkey
401
65k
Transcript
ϙΠϯτͰಋೖ͢Δ3VTU
2 ࣗ ݾ հ Fablic, inc. —> Rakuten, inc.
Software Engineer 5PNNZ @tooooooooomy
3 ࣍ • RustΛ͓͏ͱࢥͬͨཧ༝ • RustΛ͏४උ • Rustಋೖͷ͖͔͚ͬ •
ӡ༻ͱͦͷޙ • ͓·͚
3VTUΛ͓͏ͱࢥͬͨཧ༝
5 ɾຖҰͭͷݴޠΛֶश
6
7 ·ͱʹͬͨ͜ͱͷ͋Δݴޠ(࣌) • PHP • JavaScript • Perl • Ocaml(ϓϩάϥϛϯάͷجૅݺΜͩఔ)
• C(େֶͱ͔K&RͰͪΐΖͬͱ)
8 ͬͨ͜ͱͷ͋Δݴޠ • PHP • JavaScript • Perl • C(େֶͳͲͰͪΐΖͬͱ)
৽͍͜͠ͱ͕͍ͨ͠ʂ
9
10 (PͳΒ͜ͷઌࣄͰ͏͜ͱ͋Γͦ͏ͩͳʜ
11 (PͳΒ͜ͷઌࣄͰ͏͜ͱ͋Γͦ͏ͩͳʜ ϗϯτ͔ʁ
12 ࣌ɹɹɹ΄͛
3VTUΛ͏४උ
14 ४උʁ
15 https://doc.rust-lang.org/book/second-edition/index.html
16 ϑϜϑϜͳΔ΄ͲʜҎ্ͷײ͕ग़ͳ͍
17 ಈ͘ͷ͕࡞Γ͍ͨ
18 https://kazu9su.com/football-matome • Α͋͘Δ2ch·ͱΊ • αʔόʔαΠυ: Rust • ΫϥΠΞϯτ: React
+ Redux
19 RustͰ͍ͬͯΔ͜ͱ • xmlΛऔ͖ͬͯͯDBʹอଘ • JSONΛग़ྗɹ
20 RustͰ͍ͬͯΔ͜ͱ • xmlΛऔ͖ͬͯͯDBʹอଘ • JSONΛग़ྗɹ ීஈ͍ͬͯΔͷͰΠϝʔδͰ͖Δ
21 https://github.com/kazu9su/football-matome • Libraries • Web framework • nickel •
ORM and Query Builder • diesel • Http client(and server) • hyper • Mocking • mockito
22 https://github.com/kazu9su/football-matome • Libraries • Web framework • nickel •
ORM and Query Builder • diesel • Http client(and server) • hyper • Mocking • mockito ࣮Λҙࣝ͢Ε͍͍͚ͩͷ ϥΠϒϥϦ͢Ͱʹ༻ҙ͞Ε͍ͯΔ
23 ศར
3VTUಋೖͷ͖͔͚ͬ
25 • ϥΫϚ։ൃνʔϜͰɺࣗಈԽΛଅਐ͍ͯ͠·͢ • ͕Joinͨ࣌͠(1લ)νʔϜͷਓ͕େ͖͘มΘΓ ࢝Ί͓ͯΓɺࣗಈԽͷػӡ͕ߴ͘ͳ͖͍ͬͯͯͨ
26 • ࣾΞϓϦڞ௨ͷϥΠϒϥϦͱ͍ͯͬͯ͠ΔͷͷσϓϩΠϑϩʔ
27 • ࣾΞϓϦڞ௨ͷϥΠϒϥϦͱ͍ͯͬͯ͠ΔͷͷσϓϩΠϑϩʔ
28 • ࣾΞϓϦڞ௨ͷϥΠϒϥϦͱ͍ͯͬͯ͠ΔͷͷσϓϩΠϑϩʔ 1SPCMFN
29 • λά࡞εΫϦϓτʹRubyΛ༻͍ͯͨͨ͠ΊɺHeroku্Ͱ bundle install͍ͯͨ͠ • ຖճ2͘Β͍͔͔͍ͬͯͨ
30 • λά࡞εΫϦϓτʹRubyΛ༻͍ͯͨͨ͠ΊɺHeroku্Ͱ bundle install͍ͯͨ͠ • ຖճ2͘Β͍͔͔͍ͬͯͨ ࣗಈԽͷҙຯͶ͑
31 • ͦΜͳં
32 • ͦΜͳં
33 3VTUͷػӡ
ӡ༻ͱͦͷޙ
35 ಋೖޙ
36 ແࣄॳͷղܾ͞Εͨ
37 ͔͠͠…
38 3VTUΛॻ͚Δਓ͕͔͍͠ͳ͍ͱ͍͏͜ͱ͕ʹʜ
39
40 ͳΒͳ͔ͬͨ
41
42 ͜Εʹؔͯ͠νʔϜϝϯόʔͷ͓͔͛ͳͷͰײँ͔͠ͳ͍Ͱ͢
43 ਅͷΫϩείϯύΠϧ
44 ͦΕҎ߱मਖ਼ͱ͔ͳͯ͘·ͩղܾͯ͠ͳ͍Ͱ͢ɻ νʔϜͱͯ͠ӡ༻͍ͯ͘͜͠ͱΛߟ͑ΔͱϚετͳͷͰɺলʜ
45 ·ͱΊ • ͕ࣗखΛಈ͔ͯ͠Πϝʔδ͕Ͱ͖ΔͷͰ࿅श͢Δͱศར • ͷ߹؆ૉͳWebαʔϏε • ৽͍͠ڥͷ߹ɺ৽͍͜͠ͱΛ͢Δνϟϯε • ࣗಈԽͳͲɺࣄۀυϝΠϯʹ͋·Γؔͷͳ͍ͱ͜ΖΛΒͤͯΒ͑Δνϟϯε͕ଟ͍
• Rust͑Δ͜ͱΛΞϐʔϧ͍ͯͨ͠ͷͰϝϯόʔ͔ΒੵۃతʹಋೖΛࢧԉͯ͠Βͬͨ • ෆ۩߹͕ى͖ͨΒࣗʹͤΖελΠϧͰͬͯ͠·͏ͷ݁ߏ͋Γͩͱࢥ͏ • ͦͷޙͷέΞΛΔͷͱηοτ • νʔϜͷջͷਂ͞ͱ৽͍ٕ͠ज़ͷಋೖʹର͢Δཧղ • ʹίϯτϩʔϧͰ͖Δͱ͜ΖͰͳ͍ͷͰɺվΊͯνʔϜϝϯόʔʹײँ
͓·͚
3VTU5FTUUJQT
48 σϑΥϧτͰϚϧνεϨου࣮ߦ͞ΕΔ • DBͳͲΛͬͨςετͱ૬ੑѱ͍ • ࣮࣭తʹWebαʔϏεͰ͏߹ $cargo test -- —test-threads=1
͕σϑΥʹͳΔ͔
49 Private methodͷςετಉϑΝΠϧʹॻ͘ • ༰қʹςετͰϑΝΠϧߦ͕૿Ճ͍ͯ͘͠ͷͰݸਓతʹ͚ͯॻ͖͔ͨͬͨ • PrivateͳϝιουʹͦͷϑΝΠϧ͔Β͔͠ΞΫηεͰ͖ͳ͍ͱ͍͏ͷɺݴΘΕͯΈ ΕҰͭͷ͑ͳؾͨ͠ • ͋ͱͦΕͰߦ͕૿͑ͯݟ௨͕͠ѱ͘ͳͬͨΒઃܭΛݟͤͱ͍͏͜ͱ͔ͳͱਪଌ
50 Mocking Library Mockitoͷ༷ • Javaͷಉ໊ϥΠϒϥϦͷΠϯεύΠΞʁ(ਅِෆ໌) • ༷ॻಡΊॻ͍ͯ·͕͢ɺϩʔΧϧϚγϯ্ͰHTTPαʔόΛ্ཱͪ͛Δͱ͍͏ͷ • ίʔυͰࢦఆͯ͠ΔURLͰΞΫηε͢ΔઌΛMockitoͰ্ཱͪ͛ͨαʔόʔʹ͚ΔΠϝʔδ
• ීஈPHPͱ͔RubyͰΠϝʔδͯ͠Δͷͱҧ͏ͷͰݴٴͯ͠Έͨ
͞Βʹ͓·͚
52 ஔ͖͑ݩ(Ruby)ͱஔ͖͑ઌ(Rust)ͷൺֱ https://speakerdeck.com/kazu9su/wen-zi-lie-cao-zuo-nijian-rurubytorustfalsebi-jiao-wen-zi- lie-cao-zuo-nijian-rurubytorustfalsebi-jiao
53 3BLVUFOͰ<ΤϯδχΞ>Λੵۃ࠾༻தʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠