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
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-...
Search
TOMIKAWA Sotaro
October 25, 2025
Programming
59k
15
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
https://vuefes.jp/2025/
TOMIKAWA Sotaro
October 25, 2025
Transcript
12 slides
なんでRustの環境構築してないのに Rust製のツールが動くの? Why Do Rust-Based Tools Run Without a Rust
Environment? sssssota / #vuefes
深刻な「Rust製ツールチェイン侵⾷」問題 いま、フロントエンド開発を始めるとRust製のツールチェインが必ず登場する(?) Rolldown, Oxc, SWC, Biome, Deno, Rspack, Lightning CSS,
etc... その勢いはとどまるところを知らず、 ランタイム、エンジン、リンター、フォーマッター、バンドラー、などなど...
いや、待てよ...? JavaScriptのためにNode.jsは⼊れたけど、 「Rustの環境構築」してないぞ...?
なぜか動くRust製ツールたち なんでうごくの...?こわくなってきた...😰 Rust製ツールこわい npmでinstallしただけなのに (そうじゃないものもあるけど) なんなら、JavaScriptで機能を拡張したり協調して動くことだってある。ヒェッ ...主にパターンは3つ。CLIかNode-APIかWASM。
1. CLIベースのRust製ツール DenoやBiomeがこれに該当。 インストールすると、単純なCLI、バイナリが配置される。 Node.jsをインストールする行為に近い。 バイナリということは、OS/CPUによって対応してたりしてなかったり。 package.jsonの `optionalDependencies` という仕組みで OS/CPUに応じたバイナリがインストールされる。
2. Node-APIベースのRust製ツール Rolldown, Oxc, SWC, Rspackなどが該当。 OS/CPU依存のネイティブバイナリ、でもNode.jsと通信できる。 =Node-API Rustには、Node-APIを実装するためのフレームワークNAPI-RSがある。 NAPI-RSにより手軽にNode.jsとRustの世界をつなぐことができる。
3. WASMベースのRust製ツール WebAssemblyベースのRust製ツールはOS/CPUに依存しない。 →ブラウザ上でも動かせる。OS/CPU毎にビルドしなくて良い。 ただし、1,2のようなネイティブな手法よりは動作が遅い。 現在、RustからWASMを作る方法としては以下の2つが主流: 1. wasm-bindgen 2. NAPI-RS
(WASI) (上記のいずれも使わない方法もあるが省略)
WASM (WebAssembly: ワズム) WebAssemblyはいわば高階関数(関数を返す関数)みたいなもの できることは関数呼び出し、メモリ操作と計算だけ。Importsでできることが決まる
WASI (WebAssembly System Interface: ワズィ) WASIは入出力の仕様が決まっているWASM ファイルの読み書き、時間取得など入出力関数のシグネチャが定義されている。
3. WASMベースのRust製ツール(wasm-bindgen) wasm-bindgenは • 非WASIなWebAssembly • それを使うためのJavaScript + 型定義ファイル を出力する。
Rustで提供される標準ライブラリの大部分は使えない。 =ファイルシステムやネットワークへのアクセスには工夫が必要 一方、DOM操作APIをRustから使える仕組みがあるなどの利点もある。 SWCやNode.jsのTypeScript対応(Amaro)などで利用されている。
3. WASMベースのRust製ツール(NAPI-RS) NAPI-RSはWASIベースのWASMも出力できる。 wasm-bindgenと比べ制約も少なく、RustのコードベースをWASMにできる。 WASIなので、ファイルシステムなども扱えるし、WASMなのでブラウザで動く。 →ブラウザで動く開発環境(StackBlitz等)を支える主力な技術となっている
おわり Rust製ツールチェインは、 • ネイティブコンパイル (CLI / Node-API) • WASM (WASI)
により開発環境がなくてもJavaScriptと協調して動く。 今後のRust製ツールチェインの進化が怖い!
More Decks by TOMIKAWA Sotaro
See All by TOMIKAWA Sotaro
JavaScriptはシングルバイナリの夢を見るか / Does JavaScript Dream of a Single Binary?
ssssota
0
1k
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
3.5k
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
2.9k
Atomics APIを知る / Understanding Atomics API
ssssota
2
1.6k
Web技術を最大限活用してRAW画像を現像する / Developing RAW Images on the Web
ssssota
2
3.5k
漸進。
ssssota
0
3.8k
Preact、HooksとSignalsの両立 / Preact: Harmonizing Hooks and Signals
ssssota
1
4k
useSyncExternalStoreを使いまくる
ssssota
6
7.2k
React CompilerとFine Grained Reactivityと宣言的UIのこれから / The next chapter of declarative UI
ssssota
8
6.4k
Other Decks in Programming
See All in Programming
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
imagewebp()の向こう側: WebPはなぜ JPEG・PNGより軽いのか
yuzneri
0
160
The Cost of the DOM
ypresto
3
1.1k
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
490
Canvas 2D Context Next
petamoriken
0
720
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
210
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
130
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
280
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
440
AI駆動TDD ― 2026年10月版
hrmstrsmgs
0
120
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
470
joyful-journey-spring-boot.pdf
hollycummins
0
130
Featured
See All Featured
HDC tutorial
michielstock
2
1k
Docker and Python
trallard
47
4.3k
Utilizing Notion as your number one productivity tool
mfonobong
4
710
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
400
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.7k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
320
Chasing Engaging Ingredients in Design
codingconduct
0
410
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k