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
no_stdでもasyncしたい
lemolatoon
0
230
AI系サービスに代表されるAPIについて
lemolatoon
0
84
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.1k
Other Decks in Programming
See All in Programming
Visual StudioのGitHub Copilotでいろいろやってみる
tomokusaba
1
100
ARA Ansible for the teams
kksat
0
150
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
120
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.4k
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
51
17k
プログラミング言語学習のススメ / why-do-i-learn-programming-language
yashi8484
0
140
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
120
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
3
640
チームリードになって変わったこと
isaka1022
0
210
パスキーのすべて ── 導入・UX設計・実装の紹介 / 20250213 パスキー開発者の集い
kuralab
3
810
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
12
4.3k
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
Designing Experiences People Love
moore
140
23k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Building an army of robots
kneath
303
45k
Thoughts on Productivity
jonyablonski
69
4.5k
Building Applications with DynamoDB
mza
93
6.2k
Producing Creativity
orderedlist
PRO
344
39k
Designing for humans not robots
tammielis
250
25k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
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