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でつくるWebアプリケーション(2)
Search
NearMeの技術発表資料です
PRO
January 20, 2023
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RustでつくるWebアプリケーション(2)
NearMeの技術発表資料です
PRO
January 20, 2023
More Decks by NearMeの技術発表資料です
See All by NearMeの技術発表資料です
Claude Code × git worktree で並列開発 (続き) -差分のサービスだけを併設する-
nearme_tech
PRO
1
50
Claude Code × git worktree で並列開発 — サブモジュール構成のリポジトリで成立させる —
nearme_tech
PRO
0
54
LLM + 強化学習
nearme_tech
PRO
0
31
PosthogのA/Bテスト機能の紹介
nearme_tech
PRO
1
45
AIフレンドリーなプロダクトに向けて
nearme_tech
PRO
2
65
初めてのLean言語
nearme_tech
PRO
0
100
Apache Airflow Workflow orchestration without turning cron into spaghetti
nearme_tech
PRO
2
37
実務で役立つ幾何学 ボロノイ図の基礎から グラフ・ネットワーク応用まで
nearme_tech
PRO
1
76
SQL/ID抽出タスクから考える 実践的なハルシネーション対策
nearme_tech
PRO
1
88
Other Decks in Programming
See All in Programming
フロントエンドUIフレームワークのこれまでとこれから
ssssota
1
370
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
160
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
760
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
0
460
スマート反転とウェブアクセシビリティ
camiha
0
140
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
3
530
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
550
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.8k
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
2
2.5k
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
0
250
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
410
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Balancing Empowerment & Direction
lara
6
1.3k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
The agentic SEO stack - context over prompts
schlessera
0
910
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
How to train your dragon (web standard)
notwaldorf
97
6.8k
We Are The Robots
honzajavorek
0
350
GraphQLとの向き合い方2022年版
quramy
50
15k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Tell your own story through comics
letsgokoyo
1
1.1k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Transcript
0 RustでつくるWebアプリケーション(2) 2023-01-20 第29回NearMe技術勉強会 Asahi Kaito
1 今回は、RustとReactを用いたシングルページの アプリケーションを作成します!!
2 今後は、 (1) Reactの確認 (2) WebAssemblyについて (3) RustとReact ついてまとめます。
3 ですが、今回はその前段階として、 WebAssembly についてまとめます!!
4 WebAssembly(Wasm)について • Webブラウザで実行可能なバイナリ形式アセンブリライクな言語 → 字句解析と構文解析の大半を省くことができ、起動がより高速に • Webアプリケーションの高速化 → JavaScriptのような動的型付けの処理の一部をWasmに置きかえる
→ より高速な動作が期待される!! • Rust+Wasm → wasm-packを通してビルドできる
5 WebAssembly in Rust • JavaScriptの関数alertをRustで扱う → externを用いてalert関数を取り入れる #[wasm_bindgen] extern
{ pub fn alert(s: &str); }
6 WebAssembly in Rust • Rustで定義した関数をJavaScriptで扱う → #[wasm_bindgen]マクロを用いる #[wasm_bindgen] pub
fn greet(name: &str) { alert(&format!("Hello, {}", name)); } → 簡単にRustでWasmを利用できる!!
7 WebAssembly in Rust • JavaScriptでは... → greet関数とalert関数が以下のように扱われている /** *
@param {string} name */ export function greet(name) { const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; wasm.greet(ptr0, len0); } export function __wbg_alert_8755b7883b6ce0ef(arg0, arg1) { alert(getStringFromWasm0(arg0, arg1)); };
8 参考文献 • WebAssemblyとは (https://qiita.com/ShuntaShirai/items/3ac92412720789576f22) • WebAssembly Rust(https://www.rust-lang.org/ja/what/wasm) • WebAssembly
from MDN (https://developer.mozilla.org/ja/docs/WebAssembly)
9 Thank you