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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
38k
お家miniPCを使ってミリしらでkubernetes clusterたててみる
lemolatoon
1
290
no_stdでもasyncしたい
lemolatoon
0
280
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.4k
Other Decks in Programming
See All in Programming
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
510
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
The NotImplementedError Problem in Ruby
koic
1
650
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
4.7k
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
240
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
3.3k
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
0
180
AutonomyとControlのあいだ:Graflowで記述するAIエージェント協調
myui
0
110
AIとRubyの静的型付け
ukin0k0
0
550
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
1.9k
New "Type" system on PicoRuby
pocke
1
720
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.2k
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.7k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
430
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
The Spectacular Lies of Maps
axbom
PRO
1
790
Site-Speed That Sticks
csswizardry
13
1.2k
Designing Powerful Visuals for Engaging Learning
tmiket
1
400
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
Building a Scalable Design System with Sketch
lauravandoore
463
34k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
WENDY [Excerpt]
tessaabrams
11
38k
The SEO Collaboration Effect
kristinabergwall1
1
480
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