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 × C++】 夢の共演を試した話
Search
lemolatoon
August 10, 2023
Programming
1
1.7k
【Rust × C++】 夢の共演を試した話
2023 セキュリティ・キャンプLT会で話した内容です。
lemolatoon
August 10, 2023
Tweet
Share
More Decks by lemolatoon
See All by lemolatoon
スマホから Youtube Shortsを見られないようにする
lemolatoon
29
37k
お家miniPCを使ってミリしらでkubernetes clusterたててみる
lemolatoon
1
220
no_stdでもasyncしたい
lemolatoon
0
260
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.3k
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
330
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
1.3k
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
530
CSC307 Lecture 01
javiergs
PRO
0
680
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
180
CSC307 Lecture 02
javiergs
PRO
1
770
Package Management Learnings from Homebrew
mikemcquaid
0
130
高速開発のためのコード整理術
sutetotanuki
1
360
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
460
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1k
Oxlintはいいぞ
yug1224
5
1.2k
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
220
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
280
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
120
Docker and Python
trallard
47
3.7k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
630
Navigating Team Friction
lara
192
16k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
Music & Morning Musume
bryan
47
7.1k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
66
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
Amusing Abliteration
ianozsvald
0
91
Ethics towards AI in product and experience design
skipperchong
2
190
Transcript
【Rust × C++】 夢の共演を試した話 Y1 OS自作ゼミ lemolatoon
自己紹介 • 名前: lemolatoon • twitter( X ) や github
は lemolatoon • 情報系の学科の大学2年生 • 普段は Rust を触っていることが多いです。
Rust × C++ !? Rust × C の場合 • Rustはシステムプログラミング言語で
C言語の関数などは簡単に呼ぶことができる。 • C言語は、いろいろな言語の間の共通言語のような感じでいろいろな言語から呼べるような仕組みがあ る。 Rust × C++ の場合 • 共通言語であるC言語からC++のクラスなどを使うのが難しいように、 RustからC++を使うのは難しい
CXX crate CXX crateはRust, C++どうしを舞台裏でCに訳してくれる。 現実の翻訳家のようなもの。 * Rustではcrateというものがあり、他言語でいうところのライブラリのようなものである。 * 画像の出典:
cxx.rs
具体例 ← C++のクラスの実装 ↓Rustのライブラリのノリをつくる部分
具体例 Rust から C++ が呼べた! * https://github.com/lemolatoon/cxx-example
舞台裏で作られた”のり”の部分 ↑C++側 Rust側→
実際に使われた例 • autocxx ◦ CXX crateをさらにwrapしたcrate • chromium ◦ https://source.chromium.org/chromium/chromium/src/+/main:third_party/rust/serde_json_
lenient/v0_1/wrapper/lib.rs ◦ https://github.com/chromium/chromium/blob/4184e2582e2a94f607c7eec562502dcd370 d5769/docs/rust.md ◦ 実際にchromiumのソースコード内部で使われている!
None
ありがとうございました。 twitter: @lemolatoon1 github: lemolatoon https://github.com/lemolatoon/cxx-example