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.6k
【Rust × C++】 夢の共演を試した話
2023 セキュリティ・キャンプLT会で話した内容です。
lemolatoon
August 10, 2023
Tweet
Share
More Decks by lemolatoon
See All by lemolatoon
お家miniPCを使ってミリしらでkubernetes clusterたててみる
lemolatoon
1
82
no_stdでもasyncしたい
lemolatoon
0
240
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.2k
Other Decks in Programming
See All in Programming
Android端末で実現するオンデバイスLLM 2025
masayukisuda
1
160
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
24
12k
Putting The Genie in the Bottle - A Crash Course on running LLMs on Android
iurysza
0
140
AI Coding Agentのセキュリティリスク:PRの自己承認とメルカリの対策
s3h
0
230
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
760
🔨 小さなビルドシステムを作る
momeemt
4
680
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
440
AWS発のAIエディタKiroを使ってみた
iriikeita
1
190
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
520
MCPとデザインシステムに立脚したデザインと実装の融合
yukukotani
4
1.4k
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
6
2.5k
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
270
Featured
See All Featured
Thoughts on Productivity
jonyablonski
70
4.8k
Facilitating Awesome Meetings
lara
55
6.5k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Optimizing for Happiness
mojombo
379
70k
What's in a price? How to price your products and services
michaelherold
246
12k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
113
20k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
KATA
mclloyd
32
14k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Agile that works and the tools we love
rasmusluckow
330
21k
Making Projects Easy
brettharned
117
6.4k
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