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
20250228-create-npm-package-with-wasm
Search
kazto
February 28, 2025
Programming
150
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20250228-create-npm-package-with-wasm
kazto
February 28, 2025
More Decks by kazto
See All by kazto
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
630
アイカツ!から学ぶビジネスパーソンとしての姿勢 / learn-the-attitude-of-businessperson-from-aikatsu
kazto
0
980
C言語でオブジェクト指向プログラミング / object-oriented-in-c
kazto
1
990
Golangでwget劣化クローンをつくる / wget clone with golang
kazto
1
540
登壇を応援する会忘年LT_今からやぞ_.pdf
kazto
2
4.7k
Other Decks in Programming
See All in Programming
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
Kotlinの15年とServer-Side Kotlin
n_takehata
1
150
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
ジョジョの世界をXRで再現する
mofurune
0
160
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2k
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
590
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Deep Space Network (abreviated)
tonyrice
0
370
A designer walks into a library…
pauljervisheath
211
25k
The Limits of Empathy - UXLibs8
cassininazir
2
720
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Ethics towards AI in product and experience design
skipperchong
2
430
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
410
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
Transcript
WASMをビルドして npmパッケージにする (個人的な作業進捗を添えて) 2025/02/28 新宿御苑.wasm kazto_dev
自己紹介 • 横浜のSIerで働いている多摩地区在住 • 仕事ではマルチスタックと言う名のなんでも屋 ◦ メインはサーバサイド ◦ フロントエンドちょこっと ◦
Flutterスマホアプリちょこっと ◦ AWSちょこっと • 自社で一番WASMとZigとCloudflareを語れる人になりたい
やりたいこと • 昨年末のアドベントカレンダーでこんなん書きました
やりたいこと • fzfの検索で、migemo風にローマ字で日本語検索できたら便利そう • 本丸は、CLI • npmパッケージにして、フロントエンドとかでも使えたりしないか? ◦ fzfもmigemoもGolang実装だし、WASMで配布できるのでは?
おおまかなステップ • 簡単なWASMをビルドしてnpmパッケージにする • npm installして使えることを確認する • 使いたい外部パッケージ (gomigemo, fzf)
をWASMビルドする • どれをどう呼んだら連結させられるか(たぶんここまではまだ行けない)
簡単なWASMをビルドしてnpmパッケージにする • 右のような簡単なソースをつくる • GOOS=js GOARCH=wasm go build -o add.wasm
add.go main.go
npmパッケージをつくる • ./dist/ ディレクトリに下記を置く ◦ add.wasm ◦ $(go env GOROOT)/misc/wasm/wasm_exec.js
◦ index.js (右記) • npm publish
・・・結果
時間切れ • お目汚し失礼いたしました🙇 • さきほど知ったんですが、WASMにはまだDynamic Link Libraryみたいなしくみな いらしいですね