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、何もわからない...#6発表資料
Search
Ryuki Kamikubo
January 27, 2023
Programming
0
890
Rust、何もわからない...#6発表資料
こちらのイベントで登壇した際の発表資料です。
https://estie.connpass.com/event/270226/
Ryuki Kamikubo
January 27, 2023
Tweet
Share
Other Decks in Programming
See All in Programming
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
8
2.1k
Doctrine ORMでValue Objectを扱う方法4選 #phpstudy / 4 ways to handle Value Objects with Doctrine ORM
77web
4
110
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
220
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
26
7.9k
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
120
本格ローグライク制作にEbitengineを選んでみた
nagainaganawa
0
290
try! Swift Tokyo 初参加報告LT
hinakko2
0
190
Semantic search with Django and pgvector
pauloxnet
0
240
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
230
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
430
Hanami and htmx
bkuhlmann
0
190
Elm Form Validation
bkuhlmann
0
510
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
119
38k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
The Illustrated Children's Guide to Kubernetes
chrisshort
29
46k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.4k
Atom: Resistance is Futile
akmur
258
25k
A Tale of Four Properties
chriscoyier
150
22k
Teambox: Starting and Learning
jrom
128
8.4k
Building a Scalable Design System with Sketch
lauravandoore
455
32k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Navigating Team Friction
lara
177
13k
Building Effective Engineering Teams - LeadDev
addyosmani
27
1.8k
Transcript
Copyright © LabBase, Inc. All Rights Reserved. LabBaseのサービスプラットフォームの データ収集機能開発にRustを活用した話 株式会社LabBase
プラットフォーム開発本部 上久保 竜輝
Copyright © LabBase, Inc. All Rights Reserved. 自己紹介 上久保 竜輝(Kamikubo
Ryuki) 趣味 > テニス、ランニング、ボドゲ、競プロ(過去形) ソフトウェアエンジニア > frontend : backend = 6:4 > React,TypeScript,Rust,Python,PHP(Laravel) 職歴 > 2019年 4月 大手通信会社 入社 > 2021年10月 株式会社LabBase 入社 最近の興味 > アーキテクチャ,DDD,インフラ周り強くなりたい
Copyright © LabBase, Inc. All Rights Reserved.
Copyright © LabBase, Inc. All Rights Reserved. サービス紹介
Copyright © LabBase, Inc. All Rights Reserved.
Copyright © LabBase, Inc. All Rights Reserved. 約1年前 CTO「Rustやろう」ぼくら「「「はい」」」 Rustで業務開発経験あるエンジニアなし、無茶振りに焦る
> 新しい技術を学ぶのはみんな好き
Copyright © LabBase, Inc. All Rights Reserved. 現在 エンジニアの半数以上がRustで開発している 新規開発のバックエンドは基本的にRust
プラットフォーム基盤などの重要なシステムにもRustを利用 > 実はCTOの無茶振りのおかげで仕事でRustがかなり書ける会社です!!
Copyright © LabBase, Inc. All Rights Reserved. 自分がRustで開発したプロダクト紹介: 企業マスタ 企業情報をバッチ処理で
外部APIを叩いて取得 社内の他プロダクトがア クセスできるようにgRPC サーバを構築
Copyright © LabBase, Inc. All Rights Reserved. 自分がRustで開発したプロダクト紹介: 研究室データ投入 集めた大量の研究室や指導
教官に関するデータを投入 するツール > JSON形式のデータをparseして DB投入
Copyright © LabBase, Inc. All Rights Reserved. 最初はやっぱり大変 無限に所有権で怒られる >
所有権やCopyトレイトを学んで 解決
Copyright © LabBase, Inc. All Rights Reserved. Rust、何もわからない... スマートポインタわからん 動的ディスパッチわからん
ライフタイム注釈わからん > 見た目がいかつくて怖い(※個人の感想で す) > 文法がわかっても存在理由や使い道がしっ くりきていない
Copyright © LabBase, Inc. All Rights Reserved. 慣れてくると段々いい感じに Option型、Result型によるエ ラーハンドリング便利
> ?やmap_errなどを使うとネストが 深くならなくて可読性保てる
Copyright © LabBase, Inc. All Rights Reserved. よかったこと SeaORMいい感じだった >
Seeding,Migration,Entity自動生 成など一通りできる > MockのConnectionなど簡単に作れ てテスト書きやすい
Copyright © LabBase, Inc. All Rights Reserved. よかったこと ユニットテストを実装と同ファイルに書くと、見通し良い
Copyright © LabBase, Inc. All Rights Reserved. 学んだこと ソフトウェアアーキテクチャを 実現するのにRustは向いている
なと思った > 階層ごとにpublic設定しないとアク セスできないので、意図しない公開を 防げる [lib.rs] pub mod models; [models.rs] pub mod laboratory; [laboratory.rs] pub mod lab_name;
Copyright © LabBase, Inc. All Rights Reserved. 学んだこと > domainやinfra層をそれぞれ別の
パッケージとして実装。変更差分の あるパッケージだけビルドできる し、各層間の依存関係も表現できる > テックブログ書きました 企業マスタのディレクトリ構成
Copyright © LabBase, Inc. All Rights Reserved. 学んだこと Rustは早いと言われているが、遅 く書けてしまう(当たり前)
> clone(),to_owned()祭り > 遅いアルゴリズム、不必要なSQLでの呼 び出しなどなど
Copyright © LabBase, Inc. All Rights Reserved. 感じたこと Rustじゃなきゃダメっていう問題解決的な動機での導入では ないが、様々な言語の良い部分がRustに取り入れられてお
り、他の言語からやってくると新たな発見があって楽しい > CargoやCrateの充実もそう > エラー文がとても親切・アドバイスもしてくれる(clippyもいい)
Copyright © LabBase, Inc. All Rights Reserved. 感じたこと 所有権の概念と冗長なコードに慣れれば走り出せる >
実際に開発しながら、これなんだろ?で調べるの繰り返しがいいと思 う つよつよな人が多いおかげでネットで本質的な情報を探しや すい!
Copyright © LabBase, Inc. All Rights Reserved. まとめ Rustは開発しながら学習意欲、知的好奇心を満たせる >
仕様を学ぶごとに2週目ダンジョンの隠しステージが見えてくるよう Rustの難しさは必要な複雑性、自分の理解の甘さ 業務開発の中でアーキテクチャ、アルゴリズムなど疎かにし ない、あくまで総合格闘技
Copyright © LabBase, Inc. All Rights Reserved. 最後に LabBaseで一緒に開発する仲間を募集中です!Rustに興味がある皆 さん是非!
• ソフトウェアエンジニア • リサーチエンジニア
Copyright © LabBase, Inc. All Rights Reserved. 最後に エンジニアメンバーでテックノートを書いています!