Skip to content

Add a minimal TinyGo guest example - #98

Open
AndyFerns wants to merge 5 commits into
GianIac:mainfrom
AndyFerns:feat/tinygo-guest
Open

Add a minimal TinyGo guest example#98
AndyFerns wants to merge 5 commits into
GianIac:mainfrom
AndyFerns:feat/tinygo-guest

Conversation

@AndyFerns

Copy link
Copy Markdown
Contributor

Summary

Adds a new Guest example for TinyGo performing simple logging and KV access

Additions

A TinyGo guest (living under the src/ subdir) that exports run and imports host_log_v2 and db_set from the nx namespace.

  • Explicit memory boundary handling (converting Go strings to uint32 pointers/lengths).
  • Windows (build.bat) and Linux/macOS (build.sh) build scripts.
  • A README detailing requirements, build steps, and TinyGo-specific ABI observations.

notes

  • used //go:wasmimport and //go:export directives to keep the WASM ABI clean (no C-esque name mangling)
  • compiled with -target wasi to prevent TinyGo from injecting JS-specific runtime hooks (which previously caused gojs::runtime.ticks linking errors)
  • skipped optimizations (-opt=0) in the build scripts so users don't strictly need wasm-opt (Binaryen) installed on their machines just to run the example.

Closes #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a TinyGo WebAssembly guest example for Numax

1 participant