You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
2 months ago | |
---|---|---|
.vscode | 2 months ago | |
.gitignore | 2 months ago | |
ReadMe.md | 2 months ago | |
global.d.ts | 2 months ago | |
package-lock.json | 2 months ago | |
package.json | 2 months ago | |
tinygo_shim.go | 2 months ago | |
tinygo_shim.js | 2 months ago | |
tinygo_shim.ts | 2 months ago | |
tsconfig.json | 2 months ago | |
wasm_exec.js | 2 months ago |
ReadMe.md
The Plan
- The developer will write code in golang that they want to expose to the web browser
- The developer will import the
tinygo_shim
go module and insidemain()
they will call some sort oftinygo_shim.register(...)
function - the developer will compile the
main
module to a WASM binary filemy_module.wasm
- The application will import
tinygo_shim.ts
and then callInstantiateWASMModule('my_module.wasm')
InstantiateWASMModule
will usego.importObject
to attach a javascript function to TODO BLAHfunc main()
in the go code (my_module.wasm
) will be run when the module is instantiated, callingtinygo_shim.register
which will return some configuration info that will be passed to TODO BLAH- TODO BLAH will generate the instance of
ShimmedWASMModule
based on the configuration - instance of
ShimmedWASMModule
will be returned to the application