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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
lemolatoon
August 10, 2023
Programming
1.8k
1
Share
【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
270
no_stdでもasyncしたい
lemolatoon
0
270
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.4k
Other Decks in Programming
See All in Programming
色即是空、空即是色、データサイエンス
kamoneggi
1
150
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
170
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
110
Cloudflare で始める Data Platform
ta93abe
0
210
「OSSがあるなら自作するな」は AI時代も正しいか ── Build vs Adopt の新しい判断基準
kumorn5s
7
2.9k
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
120
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
530
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
240
要はバランスからの卒業 #yumemi_grow
kajitack
0
190
iOS26時代の新規アプリ開発
yuukiw00w
0
190
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
400
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
260
Featured
See All Featured
Paper Plane
katiecoart
PRO
1
50k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
WCS-LA-2024
lcolladotor
0
600
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
120
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Navigating Weather and Climate Data
rabernat
0
190
First, design no harm
axbom
PRO
2
1.2k
Odyssey Design
rkendrick25
PRO
2
620
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
The Cost Of JavaScript in 2023
addyosmani
55
9.9k
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