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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kazumasa Yamamoto
October 27, 2020
Programming
460
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rustで定数式を扱う
Kazumasa Yamamoto
October 27, 2020
More Decks by Kazumasa Yamamoto
See All by Kazumasa Yamamoto
ユニークビジョンの Rust 活用事例
fill9120
2
1.8k
Rust & AWS X-Ray による分散トレーシングの実現
fill9120
0
2.9k
Rust製プロダクトを 3年以上運用して得たノウハウ
fill9120
0
1.1k
Messaging APIを駆使した ChatGPT ボットのUX改善
fill9120
0
400
Rust を開発言語として採用してからの取り組み
fill9120
1
1.9k
ストラクチャードコミュニケーション
fill9120
0
140
Cloudflare PagesにVue.jsアプリをデプロイしてみた
fill9120
0
1.1k
Rustでディープラーニング
fill9120
0
460
LINE BotとLIFFを使って謎解きアプリを作った話
fill9120
0
760
Other Decks in Programming
See All in Programming
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
530
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
120
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
600
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
500
Haskell/Servantを通してWebミドルウェアを捉え直す
pizzacat83
1
600
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
150
関数型プログラミングのメリットって何だろう?
wanko_it
0
180
Claude Team Plan導入・ガイド
tk3fftk
0
220
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
330
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
140
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
190
Featured
See All Featured
Discover your Explorer Soul
emna__ayadi
2
1.2k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
BBQ
matthewcrist
89
10k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
180
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.1k
How to build a perfect <img>
jonoalderson
1
5.8k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
470
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.2k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Building an army of robots
kneath
306
46k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
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での制限緩和は希望がある!
ありがとうございました