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
75
no_stdでもasyncしたい
lemolatoon
0
240
AI系サービスに代表されるAPIについて
lemolatoon
0
90
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.2k
Other Decks in Programming
See All in Programming
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
340
A2A プロトコルを試してみる
azukiazusa1
2
1.3k
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
600
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
700
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
280
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
250
ふつうの技術スタックでアート作品を作ってみる
akira888
0
460
ニーリーにおけるプロダクトエンジニア
nealle
0
780
NPOでのDevinの活用
codeforeveryone
0
790
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
230
CursorはMCPを使った方が良いぞ
taigakono
1
240
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
200
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.7k
How STYLIGHT went responsive
nonsquared
100
5.6k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
680
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Unsuck your backbone
ammeep
671
58k
How to train your dragon (web standard)
notwaldorf
94
6.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.4k
Designing Experiences People Love
moore
142
24k
Speed Design
sergeychernyshev
32
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