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
80
no_stdでもasyncしたい
lemolatoon
0
240
AI系サービスに代表されるAPIについて
lemolatoon
0
91
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.2k
Other Decks in Programming
See All in Programming
Nuances on Kubernetes - RubyConf Taiwan 2025
envek
0
110
ワープロって実は計算機で
pepepper
2
1.2k
可変性を制する設計: 構造と振る舞いから考える概念モデリングとその実装
a_suenami
10
1.6k
ゲームの物理
fadis
3
860
なぜあなたのオブザーバビリティ導入は頓挫するのか
ryota_hnk
5
580
Flutter로 Gemini와 MCP를 활용한 Agentic App 만들기 - 박제창 2025 I/O Extended Seoul
itsmedreamwalker
0
120
中級グラフィックス入門~効率的なメッシュレット描画~
projectasura
4
2.5k
0から始めるモジュラーモノリス-クリーンなモノリスを目指して
sushi0120
0
250
SwiftでMCPサーバーを作ろう!
giginet
PRO
2
230
decksh - a little language for decks
ajstarks
4
21k
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
320
Terraform やるなら公式スタイルガイドを読もう 〜重要項目 10選〜
hiyanger
12
2.9k
Featured
See All Featured
Balancing Empowerment & Direction
lara
1
530
Unsuck your backbone
ammeep
671
58k
GraphQLとの向き合い方2022年版
quramy
49
14k
KATA
mclloyd
32
14k
Building Applications with DynamoDB
mza
95
6.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
The Language of Interfaces
destraynor
158
25k
Navigating Team Friction
lara
188
15k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.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