Replies: 2 comments 1 reply
-
I think you are likely to run into far bigger problems than Not sure what your use-case is exactly but you may be better trying to optimise the size of the binary from the Go toolchain instead, either with |
Beta Was this translation helpful? Give feedback.
-
Regarding Tinygo, I was also wondering about how many more issues I would hit with tinygo, thanks, for clarifying, as I suspected there would be many more too, but was not sure. I think I will go for just golang and gzip the wasm file through Caddy for now. Regarding golang and WASM compilation permutations, I got 25 MB from all these: GOOS=js GOARCH=wasm go build -tags osusergo,netgo -ldflags '-extldflags "-static"'
GOOS=js GOARCH=wasm go build -ldflags '-extldflags "-static"'
GOOS=js GOARCH=wasm go build -ldflags '-s -w'
My use case is to have nats server run as a leaf node in a browser in memory. |
Beta Was this translation helpful? Give feedback.
-
FYI: @neilalexander
I noticed there is some work started to get Nats Server to compile to wasm.
This brings some interesting use cases for both Clients and Servers that I am interested in.
The golang compiler works great. 25 MB is the size of the wasm is big.
The tinygo compiler is complaining about:
tinygo error: server/server.go:34:2: package net/http/pprof is not in std (/Users/apple/Library/Caches/tinygo/goroot-c56cb921522c039d646c5c4f9b8f28598ed4b3910aa8d088c7ff5dd44d7c2cdd/src/net/http/pprof)
I was wondering if the build tags could the adjusted ?
The Nats team might be interested in https://github.com/tractordev/wanix
It shows off how far you can take golang and wasm in the browser.
Beta Was this translation helpful? Give feedback.
All reactions