neelance / go_js_wasm_exec Goto Github PK
View Code? Open in Web Editor NEWPOC on how to use WebAssembly binaries generated by the Go compiler in a non-web environment
POC on how to use WebAssembly binaries generated by the Go compiler in a non-web environment
The example currently allows writing to a file (stdout). I wanted to explore how this could support additional types of IO.
Networking
For use cases like services it would make sense to interact over the network. However, it the current GOOS=js
build target doesn't support networking. In addition, there is no standardized WASM syscall interface, making it hard to define what a new build target would look like. CraneStation/wasmtime seems to have picked CloudABI for this. That may offer a viable option.
Custom entry points
For use cases like serverless, blockchains, data pipelines, ... it would make sense to interact over custom entry points. To make these possible, it may be worth reevaluating the discussion in golang/go#25612.
Hello,
I know this is just a POC and I'm new to wasm but I'm desperately trying to run a wasm-module compiled in Go to run outside the browser. There is not a whole lot of docs explaining how the vm that is hosting the wasm module can make calls to functions within the wasm.
I created a very simple hello world go-compiled wasm module that use fmt.Println to just print out the string.
When I point main.go to that wasm module I get:
go run main.go hello.wasm
go: finding github.com/go-interpreter/wagon v0.0.0
panic: function not found: runtime.scheduleCallback
goroutine 1 [running]:
main.main()
/home/bob/projects/go_js_wasm_exec/main.go:105 +0x1439
exit status 2
Any help would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.