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
Vugu: Go+WebAssemblyでつくる Omikuji-Go
Search
Misato Kawano
July 20, 2024
55
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Vugu: Go+WebAssemblyでつくる Omikuji-Go
Misato Kawano
July 20, 2024
More Decks by Misato Kawano
See All by Misato Kawano
MulmoTerminal 今年に入ってから何回かターミナルを乗り換えた話
mikkegt
0
25
Gopherto
mikkegt
0
66
Featured
See All Featured
A better future with KSS
kneath
240
18k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
The untapped power of vector embeddings
frankvandijk
2
1.9k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Transcript
Vugu: Go+WebAssemblyでつくる Omikuji-Go Tokyo, July 18 2024 Misato IT Engineer
@mikkegt
Today’s (glorious) blather. 自己紹介 01 コミュニティ活動 Vuguを使ったおみくじアプリ お披露目 Next Step
おわり 02 03 04 05 06
お仕事:アプリ保守してます(TSとJava) お楽しみ:ランチに天王洲アイル, 運河散策 01 自己紹介
テック系・地域コミュニティで活動してます • WomenWhoGoスタッフ • 一般社団法人SingularitySocietyスタッフ ◦ 無料で使えるテイクアウトサービスの運用 ◦ たまにVue.jsを書いてます、たまに •
地域コミュニティ 02 コミュニティ活動 https://omochikaeri.com/
omikuji-go アプリを作った👏 この日のために👏👏 03 Vuguを使ったおみくじアプリ(本題)
おみくじアプリです Go+WebAssemblyなライブラリVuguを使用しました
WebAssemblyとは • GoやC++,Rustなどのコンパイル言語で書いたコードを Web用のAssemblyにコンパイルしブラウザーで実行する 技術です • JavaScriptと比べ処理速度が速く、複雑な計算や3Dグラ フィックスなどの重い処理に適しています • JavaScriptと連携して使用することができ、既存のウェ
ブ技術と組み合わせて新しい可能性を広げています
プチ開発で採用したVugu • Vuguは、GoとWebAssemblyを使用してWebUIを構築す るための実験的なライブラリです • Vue.jsに触発された設計をもち、単一ファイルコンポー ネントやVue風のマークアップ構文を採用しています • Node.js、JavaScript、npmを使用せずに、純粋なGo コードでUIを開発できます
• WebAssemblyを利用してブラウザ上で動作し、高速なパ フォーマンスを実現します
Vuguのコード, JSの部分に Goを書くのダヨ <div> <div vg-if="c.message != nil"> <p vg-html="c.message"></p>
</div> </div> <script type="application/x-go"> import "hoge" type Root struct { message string } func (c *Root) hogehoge() { c.message = "hogehogehoge" } </script> 構造体 コンポーネントの状態管理 Vueのdataに相当 関数 Computedに相当 Watchに相当するもの はないけど実装は可 ディレクティブ
GoからDOM要素にアクセスできたりする <div> <canvas width="300" height="100" vg-js-populate="c.canvasPopulate(value)" ></canvas> </div> <script type="application/x-go">
type Root struct {} func (c *Root) canvasPopulate(value js.Value) { drawCtx := value.Call("getContext", "2d") drawCtx.Set("font", "30px Arial") drawCtx.Call("strokeText", "Hello from Vugu!", 10, 50) } </script>
omikuji-go お披露目 04 Vuguを使ったおみくじアプリ(Demo)
VuguはTinyGoでビルドできる //go:generate vugugen -tinygo ビルドしてCDNのWorkerに のせるのに挑戦したいかも 05 Next Step
ROB PIKE Go's purpose is to make its designers' programming
lives better.
おしまい Thankyou! https://www.vugu.org/ https://pkg.go.dev/github.com/vugu/vugu https://github.com/mikkegt/omikuji-go