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
go:wasmexport
Search
asuka
September 20, 2024
Technology
430
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
go:wasmexport
Niigata 5分 Tech #12
https://niigata-5min-tech.connpass.com/event/329653/
asuka
September 20, 2024
More Decks by asuka
See All by asuka
GoとSIMDとWasmの今。
askua
3
620
2025年ふりかえり
askua
1
250
ライブラリを公開してメンテナンスした一年
askua
0
120
Wasmの気になる最新情報
askua
1
410
Wasmのエコシステムを使った ツール作成方法
askua
0
450
Pure Goで体験するWasmの未来
askua
1
1.1k
Wasmで社内ツールを作って配布しよう
askua
0
340
Wasm元年
askua
0
410
wstdなんだか良さそう
askua
0
160
Other Decks in Technology
See All in Technology
.NET WebAssemblyで実現するクライアントサイドAI推論:NuGetからViteまで、2つのエコシステムを繋ぐビルド戦略
yamachu
0
420
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
2.7k
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
2
1.5k
CLIライブラリ開発を支える技術
htnabe
0
140
その Lambda、8分で 管理者権限まで奪われます
k1nakayama
7
3.5k
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
5
25k
`t*(42&t>>10)`だけで音楽が鳴る、Swiftで実装するBytebeat / iOSDC Japan 2026
yutailang0119
0
130
事業課題から技術的負債に向き合う
sansantech
PRO
2
2.2k
AIに賢く動いてもらうためのコンテキスト〜Snowflake女子会 vol.8
snowwmn0824
0
140
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
2
1k
安心して変更できるWebフロントエンドの作り方
pirosikick
5
2.9k
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
180
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
From π to Pie charts
rasagy
1
370
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
How STYLIGHT went responsive
nonsquared
100
6.3k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
240
Designing for Performance
lara
611
70k
Making the Leap to Tech Lead
cromwellryan
135
10k
Crafting Experiences
bethany
1
350
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Color Theory Basics | Prateek | Gurzu
gurzu
1
470
Transcript
go:wasmexport 2024.9 Niigata 5分 Tech #12
asuka (@a_skua) • 株式会社モニクル ◦ SWE / プロダクトSRE • WebAssemblyの同人誌を書いている人
◦ WebAssemblyでできること ▪ 商業誌版:実践入門WebAssembly ◦ ご注文はWASIですか? ◦ ご注文はWASIですか?? ◦ WebAssembly Cookbook vol.1 2 WHOIS
そういえば... 3 Niigata 5分 Techであんまり技術の話をしていない • N5T#5 AssemblyScriptではじめるWebAssembly入門 • N5T#8
技術書典16オフライン振り返り • N5T#10 エンジニアコミュニティ
Wasmの話をします
Go1.23時点のWasmサポート状況
Go1.23時点のWasmサポート状況 go:wasmimportという構文をサポートしている • Go1.21とWebAssembly 6 package main //go:wasmimport add a
func addA() int32 //go:wasmimport add b func addB() int32 var a, b int32 func main() { a = addA() b = addB() } import "./wasm_exec.js"; const go = new Go(); const { instance } = await WebAssembly.instantiateStreaming( fetch(new URL("main.wasm", import.meta.url)), { ...go.importObject, add: { a: () => 10, b: () => 20, }, }, ); go.run(instance);
Go1.23時点のWasmサポート状況 go:wasmimportという構文をサポートしているが,go:wasmexportはサポートされていない • Go1.21とWebAssembly 7 package main //go:wasmimport add a
func addA() int32 //go:wasmimport add b func addB() int32 var a, b int32 func main() { a = addA() b = addB() } import "./wasm_exec.js"; const go = new Go(); const { instance } = await WebAssembly.instantiateStreaming( fetch(new URL("main.wasm", import.meta.url)), { ...go.importObject, add: { a: () => 10, b: () => 20, }, }, ); go.run(instance);
• go:wasmexportはtiny-goには入っている • go:wasmexportはWasmを使う上で欲しい機能の一つ • 今年のはじめに go:wasmexportのプロポーザルがacceptされた • Go1.23には来なかったが,すでに対応済み ◦
cmd/compile: add go:wasmexport directive · Issue #65199 · golang/go · GitHub go:wasmexport 8 →Go1.24でgo:wasmexportが来る
Go1.24からはこう書けるようになる
Go1.24からはこう書けるようになる 10 package main //go:wasmexport add func add() int32 {
return a + b } //go:wasmimport add a func addA() int32 //go:wasmimport add b func addB() int32 var a, b int32 func main() { a = addA() b = addB() } import "./wasm_exec.js"; const go = new Go(); const { instance } = await WebAssembly.instantiateStreaming( fetch(new URL("main.wasm", import.meta.url)), { ...go.importObject, add: { a: () => 10, b: () => 20, }, }, ); go.run(instance); console.log(instance.exports.add());
go:wasmexport Niigata 5分 Tech #12