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
440
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
640
2025年ふりかえり
askua
1
250
ライブラリを公開してメンテナンスした一年
askua
0
120
Wasmの気になる最新情報
askua
1
420
Wasmのエコシステムを使った ツール作成方法
askua
0
460
Pure Goで体験するWasmの未来
askua
1
1.1k
Wasmで社内ツールを作って配布しよう
askua
0
340
Wasm元年
askua
0
420
wstdなんだか良さそう
askua
0
160
Other Decks in Technology
See All in Technology
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
130
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
Running Kotlin + Quarkus with Lambda
nealle
1
3.7k
Getting Started with Google Antigravity
glaforge
0
300
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
160
分析AIエージェントを育てる、動く環境を育てる
codatum
1
1.1k
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
100
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
770
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
4
1.1k
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
490
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
920
How to Design Configuration for Rails Applications
willnet
1
770
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
440
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
First, design no harm
axbom
PRO
2
1.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
GraphQLとの向き合い方2022年版
quramy
50
15k
Between Models and Reality
mayunak
4
500
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
GitHub's CSS Performance
jonrohan
1033
470k
Practical Orchestrator
shlominoach
192
12k
Thoughts on Productivity
jonyablonski
76
5.4k
Tell your own story through comics
letsgokoyo
1
1.1k
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