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
1.3k
[スタディサプリ] Railsアプリケーションのモジュールとして存在していた Darklaunch (Feature Toggles) を Goアプリケーションとしてフルスクラッチでマイクロサービス化した話
kazu9su
0
2.5k
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
Realtime API 入門
riofujimon
0
150
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
670
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
580
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
CSC509 Lecture 12
javiergs
PRO
0
160
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
subpath importsで始めるモック生活
10tera
0
300
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
330
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Adopting Sorbet at Scale
ufuk
73
9.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Being A Developer After 40
akosma
86
590k
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Ͱ<ΤϯδχΞ>Λੵۃ࠾༻தʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠