github.com/tetratelabs/wazero@v1.2.1/experimental/gojs/README.md (about)

     1  # Overview
     2  
     3  When `GOOS=js` and `GOARCH=wasm`, Go's compiler targets WebAssembly Binary
     4  format (%.wasm).
     5  
     6  Wazero's "github.com/tetratelabs/wazero/experimental/gojs" package allows you to run
     7  a `%.wasm` file compiled by Go.  This is similar to what is implemented in
     8  [wasm_exec.js][1]. See https://wazero.io/languages/go/ for more.
     9  
    10  ## Example
    11  
    12  wazero includes an [example](example) that makes HTTP client requests.
    13  
    14  ## Experimental
    15  
    16  Go defines js "EXPERIMENTAL... exempt from the Go compatibility promise."
    17  Accordingly, wazero cannot guarantee this will work from release to release,
    18  or that usage will be relatively free of bugs. Moreover, [`GOOS=wasip1`][2] will be shipped
    19  in Go 1.21, and once that's available in two releases wazero will remove this
    20  package.
    21  
    22  Due to these concerns and the relatively high implementation overhead, most
    23  will choose TinyGo instead of gojs.
    24  
    25  [1]: https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js
    26  [2]: https://github.com/golang/go/issues/58141