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.8k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
【Rust × C++】 夢の共演を試した話
2023 セキュリティ・キャンプLT会で話した内容です。
lemolatoon
August 10, 2023
More Decks by lemolatoon
See All by lemolatoon
スマホから Youtube Shortsを見られないようにする
lemolatoon
29
39k
お家miniPCを使ってミリしらでkubernetes clusterたててみる
lemolatoon
1
310
no_stdでもasyncしたい
lemolatoon
0
280
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.4k
Other Decks in Programming
See All in Programming
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
650
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
3.8k
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
480
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.8k
継続モナドとリアクティブプログラミング
yukikurage
3
680
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
230
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
210
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
170
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
1.1k
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
580
メールのエイリアス機能を履き違えない
isshinfunada
0
220
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
470
Featured
See All Featured
Deep Space Network (abreviated)
tonyrice
0
250
Optimising Largest Contentful Paint
csswizardry
37
3.9k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
Design in an AI World
tapps
1
270
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Why Our Code Smells
bkeepers
PRO
340
58k
So, you think you're a good person
axbom
PRO
2
2.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
450
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
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