Besides the comment regarding using a Go interpreter, you can definitely compile inside of the browser and then load that WASM module into the current session.
This is cool! Do you think you could get Hugo to run in the browser this way so you could show live-previews in the browser without having to run Hugo locally?
Great project, well-bounded and insightful! Do you think about making it open source? I was thinking about trying to use another JSON library and make it work with tinygo, but don't want to repeat the work.
17 comments
[ 3.1 ms ] story [ 51.7 ms ] threadWhat I could add, though, is a bunch of "standard" functions (like the ones found in Hugo, for example).
Noted!
[0] https://github.com/traefik/yaegi
I didn't say there is already a Go compiler that supports such workflow, rather that the infrastructure doesn't forbid it.
Haven’t tried the above, just an example. Tinygo is the one commonly used in the Wasm ecosystem
Binary size is the main issue with Go WASM, the binary on this is 4MB, and it only does templating.
TinyGo won't work because it doesn't have reflect (which I need for parsing arbitrary JSON).
But I'll give it a spin. Thanks!
First of all, I really interested with this project and I see there is a room for improvement, mind to open source the code?
thanks randomguy011