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
【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
280
no_stdでもasyncしたい
lemolatoon
0
270
Rustの手続きマクロで黒魔術入門
lemolatoon
2
1.4k
Other Decks in Programming
See All in Programming
ふつうのFeature Flag実践入門
irof
7
3.4k
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
760
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.8k
Swiftのレキシカルスコープ管理
kntkymt
0
200
Inspired By RubyKaigi (EN)
atzzcokek
0
460
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
130
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.2k
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
430
net-httpのHTTP/2対応について
naruse
0
380
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
540
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
250
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
698
190k
Writing Fast Ruby
sferik
630
63k
The agentic SEO stack - context over prompts
schlessera
0
790
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Mobile First: as difficult as doing things right
swwweet
225
10k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Music & Morning Musume
bryan
47
7.2k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
Docker and Python
trallard
47
3.9k
エンジニアに許された特別な時間の終わり
watany
107
240k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
810
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
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