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
Laravel Boost 超入門
fire_arlo
2
160
Langfuseと歩む生成AI活用推進
licux
3
320
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
120
AIでLINEスタンプを作ってみた
eycjur
1
220
速いWebフレームワークを作る
yusukebe
2
340
Kiroで始めるAI-DLC
kaonash
2
430
AI OCR API on Lambdaを Datadogで可視化してみた
nealle
0
220
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
0
210
時間軸から考えるTerraformを使う理由と留意点
fufuhu
4
210
Rancher と Terraform
fufuhu
2
150
Claude Codeで実装以外の開発フロー、どこまで自動化できるか?失敗と成功
ndadayo
3
1.8k
WebAssemblyインタプリタを書く ~Component Modelを添えて~
ruccho
1
940
Featured
See All Featured
Faster Mobile Websites
deanohume
309
31k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
The Art of Programming - Codeland 2020
erikaheidi
55
13k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Raft: Consensus for Rubyists
vanstee
140
7.1k
BBQ
matthewcrist
89
9.8k
Embracing the Ebb and Flow
colly
87
4.8k
Statistics for Hackers
jakevdp
799
220k
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