https://github.com/dolanor/drawasm
https://github.com/dolanor/drawasm
canvas go golang tinygo webassembly
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/dolanor/drawasm
- Owner: dolanor
- Created: 2019-07-26T15:40:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-27T01:11:24.000Z (almost 7 years ago)
- Last Synced: 2026-03-29T17:02:06.921Z (2 months ago)
- Topics: canvas, go, golang, tinygo, webassembly
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Drawasm
Simple example from [Sendil Kumar N](https://dev.to/sendilkumarn/tiny-go-to-webassembly-5168)
## Run
### Go wasm
```shell
# We generate the wasm binary with standard Go and copy its wasm_exec.js counterpart
GOOS=js GOARCH=wasm go generate ./cmd/drawasm
go run ./cmd/server/server.go
```
### TinyGo wasm
```shell
# We generate the wasm binary with TinyGo and copy its wasm_exec.js counterpart
go generate ./cmd/drawasm
go run ./cmd/server/server.go
```
The TinyGo version crashes when you draw too many segments since it doesn't have GC yet.
But then, it's lighter!