Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
wstdなんだか良さそう
Search
asuka
June 17, 2025
Technology
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
wstdなんだか良さそう
UV Study : Rust LT会 ~お好きなCrate紹介してください~
https://uniquevision.connpass.com/event/355069/
asuka
June 17, 2025
More Decks by asuka
See All by asuka
GoとSIMDとWasmの今。
askua
3
650
2025年ふりかえり
askua
1
260
ライブラリを公開してメンテナンスした一年
askua
0
120
Wasmの気になる最新情報
askua
1
430
Wasmのエコシステムを使った ツール作成方法
askua
0
470
Pure Goで体験するWasmの未来
askua
1
1.1k
Wasmで社内ツールを作って配布しよう
askua
0
350
Wasm元年
askua
0
430
Dartでウェブ開発 (やりたい)
askua
0
120
Other Decks in Technology
See All in Technology
新卒エンジニア、 介護士になる
ryu1013
1
680
20261031_IoTLT_vol140_kitazaki_v1.pdf
kitazaki
0
170
2026 Apache Flink Community Checkpoint
rmetzger
0
150
`go get`したらELFが降ってきた件
taiyow
0
170
詳解 never 型 - ボトム型の性質を深掘り
nealle
0
150
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
3
150
Lint の層を組み直した話
bengo4com
3
310
In-Context Learning再入門。ICLの勾配降下的解釈の研究動向を追ってみる。
dai08srhg
1
220
視野はAIに、視座は人に / ai-for-breadth-humans-for-perspective
nkzn
6
3k
AI時代に求められる優秀なTechLeadの振る舞い
pospome
4
4.9k
Consistency for mere mortals - A gentle guide to consistency
ufried
0
120
【Oracle AI SPOTLIGHT ウェビナー】事例から見る!なぜOCIが選ばれたのか ― AI時代のクラウド戦略を紐解く ―
oracle4engineer
PRO
2
150
Featured
See All Featured
Mind Mapping
helmedeiros
1
430
Site-Speed That Sticks
csswizardry
13
1.6k
How STYLIGHT went responsive
nonsquared
100
6.3k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
760
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
890
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
920
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
500
Google's AI Overviews - The New Search
badams
0
1.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Transcript
wstdなんか良さそう UV Study : Rust LT会 June 17, 2025
WHOAMI asuka • 株式会社モニクル/SWE ◦ Monicle Techbook vol.1 技術書典17 •
Wasm関連の同人誌・商業誌の執筆 ◦ 実践入門WebAssembly ◦ WebAssembly System Interface入門 ◦ ご注文はWASIですか?? 技術書典16 ◦ Wasm Cookbook vol.2 技術書典17 ◦ Wasm Cookbook vol.3 技術書典18 ◦ Wasm Cookbook vol.4 技術書典NT • 新宿御苑.dev ◦ 新宿御苑.wasm #2025.6.25 LT会 2 商業誌 Cookbookシリーズ ごちWASI
前提知識 3
前提知識 4 • WASI 0.2というWasmのシステムインターフェースの仕様が存在する • WASI 0.2はWIT(Wasm Interface Type)でインターフェースが定義されている
• RustはWASI 0.2をサポートしている Wasmの詳しい話は こういう本を読むと良い
前提知識 5 • WASI 0.2というWasmのシステムインターフェースの仕様が存在する • WASI 0.2はWIT(Wasm Interface Type)でインターフェースが定義されている
• RustはWASI 0.2をサポートしている Wasmの詳しい話は こういう本を読むと良い
RustはWASI 0.2をサポートしている cargo build -r –-target wasm32-wasip2 6 $ wasmtime
run <TARGET_PATH>/hello-world.wasm Hello, WASI 0.2! ターゲットにWASIp2 (WASI 0.2)を指定すると 「wasi:cli/command」ワールドが実装される
wasi:cli/commandワールド CLI実行に必要なFSなどの一般的なインターフェース実装 7 $ wasm-tools component wit <TARGET_PATH>/hello-world.wasm | head
package root:component; world root { import wasi:cli/
[email protected]
; import wasi:cli/
[email protected]
; import wasi:io/
[email protected]
; import wasi:io/
[email protected]
; import wasi:cli/
[email protected]
; import wasi:cli/
[email protected]
; import wasi:cli/
[email protected]
; import wasi:clocks/
[email protected]
; import wasi:filesystem/
[email protected]
; import wasi:filesystem/
[email protected]
; export wasi:cli/
[email protected]
; } https://wa.dev/wasi:cli
wasi:cli/commandワールド CLI実行に必要なFSなどの一般的なインターフェース実装 → ネットワーク関連のインターフェース定義は含まれていない 8 wasi:httpやwasi:socketといったパッケージ定義はあるが, ビルドターゲットとなる wasi:cli/commandには含まれていない WASIのインターフェース 使いたいなー
wasi:cli/commandに含まれていない WASIインターフェースを使うには 9
WASIインターフェースを使うには 10 1. WITを使ってインターフェースを定義 & 実装する a. wit-bindgen 2. WASIのインターフェースをラップしたクレートを使う
a. wasmcloud → 今回説明しない b. wstd
WITを使ってインターフェースを定義 & 実装する wit-bindgenを使う 11 インターフェースの定義 インターフェースの実装
WITを使ってインターフェースを定義 & 実装する wit-bindgenを使う 12 wasi:http/proxyを実装してみると... WITのインターフェース定義を そのまま使うのは少々面倒
WASIのインターフェースを もう少し簡単に扱いたい 13
WASIのインターフェースをラップした クレートを使おう 14
wstd 15
wstd 16 https://github.com/yoshuawuyts/wstd An async standard library for Wasm Components
and WASI 0.2 $ wasmtime run -S http <TARGET_PATH>/example.wasm <!doctype html> <html> <head> <title>Example Domain</title> ... 実行できる
wstd 1. 非同期をサポートしている 2. WASIの薄いラッパーである 17 #[wstd::main] WASI 0.2には非同期インターフェースがない (WASI
0.3で導入予定) pollingインターフェースをラップして Futureとして扱えるように
wstd 1. 非同期をサポートしている 2. WASIの薄いラッパーである 18 WASIとの対応がわかりやすい
wstd 1. 非同期をサポートしている 2. WASIの薄いラッパーである 19 Request::get(“https::example.com”).body(io::empty())?; WITの定義をそのまま使うともっと冗長になる
wstd 20 WASIのインターフェースを 使いたい時に良さそう