Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rustで定数式を扱う
Search
Kazumasa Yamamoto
October 27, 2020
Programming
0
440
Rustで定数式を扱う
Kazumasa Yamamoto
October 27, 2020
Tweet
Share
More Decks by Kazumasa Yamamoto
See All by Kazumasa Yamamoto
ユニークビジョンの Rust 活用事例
fill9120
2
1.6k
Rust & AWS X-Ray による分散トレーシングの実現
fill9120
0
2.8k
Rust製プロダクトを 3年以上運用して得たノウハウ
fill9120
0
970
Messaging APIを駆使した ChatGPT ボットのUX改善
fill9120
0
370
Rust を開発言語として採用してからの取り組み
fill9120
1
1.8k
ストラクチャードコミュニケーション
fill9120
0
120
Cloudflare PagesにVue.jsアプリをデプロイしてみた
fill9120
0
950
Rustでディープラーニング
fill9120
0
410
LINE BotとLIFFを使って謎解きアプリを作った話
fill9120
0
690
Other Decks in Programming
See All in Programming
AIコーディングエージェント(Gemini)
kondai24
0
250
AIコーディングエージェント(Manus)
kondai24
0
200
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
400
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
950
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
870
tparseでgo testの出力を見やすくする
utgwkk
2
260
認証・認可の基本を学ぼう前編
kouyuume
0
260
マスタデータ問題、マイクロサービスでどう解くか
kts
0
110
Graviton と Nitro と私
maroon1st
0
110
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
150
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
9
5.8k
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
130
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
22
Code Reviewing Like a Champion
maltzj
527
40k
Writing Fast Ruby
sferik
630
62k
Designing for humans not robots
tammielis
254
26k
We Are The Robots
honzajavorek
0
110
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
2
2.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
0
98
Believing is Seeing
oripsolob
0
10
Designing for Timeless Needs
cassininazir
0
86
Transcript
Rustで定数式を扱う ユニークビジョン株式会社 山本 一将
自己紹介 2 ⚫ 名前:山本 一将(@kyamamoto9120) ⚫ 所属:ユニークビジョン株式会社 ⚫ 言語:C++, Rust,
Python, Ruby ⚫ 趣味:将棋、キャンプ、DIY、野球観戦 ⚫ 実績:2015年 世界コンピュータ将棋選手権9位
アジェンダ 3 ① 定数式とは何か ② Rustの定数式の状況 ③ 簡単な使用方法(フィボナッチ数列を例に)
定数式とは 4 • コンパイル時に評価可能な式のこと • Rustでは const fn で始まる関数が定数式となる
Rustにおける定数式 5 ① 1.31.0から導入 • ローカル変数が使えない • ループ文、制御文が使えない • 引数を&mutにできない
② 1.46.0までに徐々に制限緩和 • ローカル変数が使える! • matchやwhileが使える!
現時点での制限 6 ① for文は使えない ② 評価できる式の深さに制限がある
まとめ 7 ⚫ 制限が一部緩和されたがまだまだ実用レベルではない • 自由度はまだC++14のconstexprにも届かない • 標準ライブラリの対応もまだまだ ⚫ 当面はlazy_static!を使用した方が幸せ
⚫ それでも1.46.0での制限緩和は希望がある!
ありがとうございました