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
【Rust × C++】 夢の共演を試した話
2023 セキュリティ・キャンプLT会で話した内容です。
lemolatoon
August 10, 2023
More Decks by lemolatoon
See All by lemolatoon
スマホから Youtube Shortsを見られないようにする
lemolatoon
29
38k
お家miniPCを使ってミリしらでkubernetes clusterたててみる
lemolatoon
1
270
no_stdでもasyncしたい
lemolatoon
0
270
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.4k
Other Decks in Programming
See All in Programming
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
150
AIと共に生きる技術選定 2026
sgash708
0
130
実用!Hono RPC2026
yodaka
2
300
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
110
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1k
Road to RubyKaigi: Play Hard(ware)
makicamel
1
560
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
190
AgentCore Optimizationを始めよう!
licux
3
230
過去のレビュー知見をSkillsで資産化した話
pkshadeck
PRO
1
1.7k
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
110
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
140
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
290
AI: The stuff that nobody shows you
jnunemaker
PRO
6
630
For a Future-Friendly Web
brad_frost
183
10k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
How GitHub (no longer) Works
holman
316
150k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.4k
How STYLIGHT went responsive
nonsquared
100
6.1k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
GraphQLとの向き合い方2022年版
quramy
50
15k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
290
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
500
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