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
WASM入門
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
NearMeの技術発表資料です
PRO
January 19, 2025
Programming
220
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WASM入門
NearMeの技術発表資料です
PRO
January 19, 2025
More Decks by NearMeの技術発表資料です
See All by NearMeの技術発表資料です
Claude Code × git worktree で並列開発 — サブモジュール構成のリポジトリで成立させる —
nearme_tech
PRO
0
41
LLM + 強化学習
nearme_tech
PRO
0
24
PosthogのA/Bテスト機能の紹介
nearme_tech
PRO
1
33
AIフレンドリーなプロダクトに向けて
nearme_tech
PRO
2
60
初めてのLean言語
nearme_tech
PRO
0
95
Apache Airflow Workflow orchestration without turning cron into spaghetti
nearme_tech
PRO
2
34
実務で役立つ幾何学 ボロノイ図の基礎から グラフ・ネットワーク応用まで
nearme_tech
PRO
1
66
SQL/ID抽出タスクから考える 実践的なハルシネーション対策
nearme_tech
PRO
1
82
OpenCode & Local LLM
nearme_tech
PRO
0
290
Other Decks in Programming
See All in Programming
今さら聞けない .NET CLI
htkym
0
210
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
7.7k
バグを直したら useEffect が消えた
colorful12
3
700
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
1
1.9k
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
510
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
240
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
100
Android CLI
fornewid
0
230
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
140
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
580
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
270
リアルな遅延を測る仕様
kota_yata
1
120
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.2k
RailsConf 2023
tenderlove
30
1.5k
Deep Space Network (abreviated)
tonyrice
0
270
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
WENDY [Excerpt]
tessaabrams
11
39k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Navigating Team Friction
lara
192
16k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
470
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
550
Scaling GitHub
holman
464
140k
It's Worth the Effort
3n
188
29k
Transcript
0 WASM⼊⾨ 2025-01-17 第111回NearMe技術勉強会 @yujiosaka
1 WASMとは? • 低レベルのバイトコードフォーマット • C、C++、Rust等の⾔語のコンパイル対象 • ⾼性能なウェブアプリケーションを実現する • サーバーサイドでの利⽤が増加している
2 Write once, run anywhere Java バイトコード JVM ARM X86
中間表現
3 Write once, run anywhere WASM バイトコード WASM ランタイム ARM
X86 中間表現
4 Write once, run anywhere WASM ランタイム WASM バイトコード ARM
X86 Wasmtime 中間表現
5 WASMの特徴 • 性能 ‒ ほぼネイティブの速度で実⾏ • 多⾔語対応 ‒ 様々なプログラミング⾔語をサポート
• クロスプラットフォーム ‒ ブラウザやネイティブのランタイムに対応 • セキュリティ ‒ サンドボックス環境で実⾏ • クロスアーキテクチャ ‒ 複数のCPUアーキテクチャで実⾏(例:ARM、x86)
6 Confidential 6
7 性能 7
8 検証
9 コラッツ問題 3 Step ステップ数 n 5 8 4 2
1 10 16 1. 任意の正の整数nで開始 2. nが偶数なら2で割る 3. nが奇数なら3倍して1を⾜す 4. nが1になるまでこのプロセスを繰り返す 9
10 JavaScript vs. Rust function collatzSteps(n) { let counter =
0; while (n !== 1) { if (n % 2 === 0) { n /= 2; } else { n = 3 * n + 1; } counter++; } return counter; } pub fn collatz_steps(mut n: u64) -> u64 { let mut counter = 0; while n != 1 { if n % 2 == 0 { n /= 2; } else { n = 3 * n + 1; } counter += 1; } return counter; }
11 n = 670617279 の場合(必要ステップ数:986) 関数 Opt/Sec JS 32,172 WASM
1,465,898
12 n = 7 の場合(必要ステップ数:16) 関数 Opt/Sec JS 21,627,204 WASM
77,805,618
13 多⾔語対応 13
14 WASMにコンパイル可能な⾔語
15 クロスプラットフォーム 15
16 フロント エンド バック エンド エッジ 2025年時点でのユースケース
17 セキュリティ 17
18 JavaScriptの関数をインポートする use wasm_bindgen::prelude::*; #[wasm_bindgen] extern “C” { #[wasm_bindgen(js_namespace =
console)] fn log(s: &str) } #[wasm_bindgen] pub fn hello_world(name: &str) { log(&format!(“Hello, {}!”, name)); }
19 サンドボックスの実⾏環境 Shared Linear Memory hello_world(name: &str) log helloWorld(name: string)
console.log エクス ポート イン ポート 書き 込む 読み 込む 呼び 出す WASMモジュール
20 クロスアーキテクチャ 20
21 Numpyのディストリビューションとの⽐較
22 Thank you