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
240
no_stdでもasyncしたい
lemolatoon
0
260
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.3k
Other Decks in Programming
See All in Programming
浮動小数の比較について
kishikawakatsumi
0
300
JPUG勉強会 OSSデータベースの内部構造を理解しよう
oga5
2
190
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
250
CSC307 Lecture 05
javiergs
PRO
0
510
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
190
CSC307 Lecture 12
javiergs
PRO
0
440
Python’s True Superpower
hynek
0
180
Event Storming
hschwentner
3
1.3k
株式会社 Sun terras カンパニーデック
sunterras
0
1.8k
2026年 エンジニアリング自己学習法
yumechi
0
150
Metaprogramming isn't real, it can't hurt you
okuramasafumi
0
120
Raku Raku Notion 20260128
hareyakayuruyaka
0
410
Featured
See All Featured
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
210
Marketing to machines
jonoalderson
1
4.9k
How to Talk to Developers About Accessibility
jct
2
140
Into the Great Unknown - MozCon
thekraken
40
2.3k
ラッコキーワード サービス紹介資料
rakko
1
2.4M
Designing Experiences People Love
moore
144
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Designing Powerful Visuals for Engaging Learning
tmiket
0
250
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