Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
【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
Transcript
10 slides
【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
More Decks by lemolatoon
See All by lemolatoon
スマホから Youtube Shortsを見られないようにする
lemolatoon
29
39k
お家miniPCを使ってミリしらでkubernetes clusterたててみる
lemolatoon
1
370
no_stdでもasyncしたい
lemolatoon
0
290
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.4k
Other Decks in Programming
See All in Programming
Distance field of Julia set
kinakomoti321
0
330
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
190
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
220
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
210
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
200
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
180
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
360
Kotlin Fest 2026: Kotlin コンパイラに Contribute してみよう! - Kotlin/Wasm で深い再帰を書けるようにした話
ternbusty
1
360
Beyond Chatbots: Agentic UI with Open Standards @W-JAX 2026, München
manfredsteyer
PRO
0
110
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
オーケストレーション記述言語 Katari
yukikurage
0
270
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.1k
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
660
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
680
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
570
Rebuilding a faster, lazier Slack
samanthasiow
85
9.8k
Writing Fast Ruby
sferik
630
63k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.8k
Amusing Abliteration
ianozsvald
1
390
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
530