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.8k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
【Rust × C++】 夢の共演を試した話
2023 セキュリティ・キャンプLT会で話した内容です。
lemolatoon
August 10, 2023
More Decks by lemolatoon
See All by lemolatoon
スマホから Youtube Shortsを見られないようにする
lemolatoon
29
39k
お家miniPCを使ってミリしらでkubernetes clusterたててみる
lemolatoon
1
310
no_stdでもasyncしたい
lemolatoon
0
280
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.4k
Other Decks in Programming
See All in Programming
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
2.3k
OS アップデート対応の取り組み方がもっと共有されてほしい
andpad
0
110
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
190
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
130
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
480
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
190
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
240
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
160
symfony/aiとlaravel/boost
77web
0
120
1B+ /day規模のログを管理する技術
broadleaf
0
130
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.6k
Mind Mapping
helmedeiros
PRO
1
280
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.6k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
GraphQLとの向き合い方2022年版
quramy
50
15k
Color Theory Basics | Prateek | Gurzu
gurzu
0
390
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
370
Navigating Weather and Climate Data
rabernat
0
310
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
From π to Pie charts
rasagy
0
230
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
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