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
8k
ポイントで導入する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
1.3k
[スタディサプリ] Railsアプリケーションのモジュールとして存在していた Darklaunch (Feature Toggles) を Goアプリケーションとしてフルスクラッチでマイクロサービス化した話
kazu9su
0
2.6k
ExplorTechToronto20191016.pdf
kazu9su
0
61
キャッシュ安心戦略 with Feature Toggles
kazu9su
0
510
ebisurb20180724.pdf
kazu9su
1
230
How to contribute to OSS with test
kazu9su
0
340
プログラミング言語入門Vim編
kazu9su
1
360
プログラミング言語入門
kazu9su
1
2.6k
ebisurb15
kazu9su
0
50
Other Decks in Programming
See All in Programming
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
ドメインイベント増えすぎ問題
h0r15h0
2
290
Go の GC の不得意な部分を克服したい
taiyow
2
770
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
선언형 UI에서의 상태관리
l2hyunwoo
0
160
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
Security_for_introducing_eBPF
kentatada
0
110
良いユニットテストを書こう
mototakatsu
5
2.1k
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
169
14k
Making Projects Easy
brettharned
116
5.9k
Scaling GitHub
holman
458
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
97
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Embracing the Ebb and Flow
colly
84
4.5k
Fireside Chat
paigeccino
34
3.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Typedesign – Prime Four
hannesfritz
40
2.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
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Ͱ<ΤϯδχΞ>Λੵۃ࠾༻தʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠