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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
Transcript
11 slides
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
More Decks by asuka
See All by asuka
GoとSIMDとWasmの今。
askua
3
660
2025年ふりかえり
askua
1
260
ライブラリを公開してメンテナンスした一年
askua
0
130
Wasmの気になる最新情報
askua
1
450
Wasmのエコシステムを使った ツール作成方法
askua
0
480
Pure Goで体験するWasmの未来
askua
1
1.2k
Wasmで社内ツールを作って配布しよう
askua
0
360
Wasm元年
askua
0
430
wstdなんだか良さそう
askua
0
170
Other Decks in Technology
See All in Technology
【Oracle AI SPOTLIGHT ウェビナー】【特別開催:日本語で解説!】Oracle AI World 2026 最新情報フィードバック
oracle4engineer
PRO
1
260
Agent Harnessはどう作る?事例から学ぶAI Agentの設計思想
sergicalsix
0
330
MCPでネットワーク障害調査を自動化する前に直すべき3つのこと
yama3133
0
490
Del vibe coding a un Desarrollo (agéntico) fiable
jcabot
0
140
Shared Signals Framework 仕様解説
oidfj
0
460
IP重複は"ランディングVPC"で受け止める ― PrivateLink と Transit Gatewayによるマルチテナント接続基盤の設計
hatahata021
2
210
あの日、見つかっていなかったらどうなっていたか
kazzpapa3
2
240
Skill とカスタムエージェント (手順と役割を渡す) | 目指せ Kiro マスター 08
inariku
PRO
2
110
常時稼働エージェントの作り方(Claude公式ブログを資料化)
minorun365
PRO
14
25k
Go初心者のクラウドエンジニアが、デプロイを通して旨味を知っていく話
ryudai
1
230
ラクスル会社紹介資料|エンジニア向け / RAKSUL Introduction for Engineers
raksulrecruiting
0
120
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
120
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Balancing Empowerment & Direction
lara
6
1.4k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
600
The Cult of Friendly URLs
andyhume
79
7.1k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
310
Building AI with AI
inesmontani
PRO
1
1.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.7k
Thoughts on Productivity
jonyablonski
76
5.5k
How GitHub (no longer) Works
holman
316
150k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
How to Ace a Technical Interview
jacobian
280
24k