github.com/AR1011/wazero@v1.0.5/site/content/_index.md (about)

     1  +++
     2  title = "the _zero_ dependency _WebAssembly_ runtime for _Go developers_"
     3  layout = "home"
     4  +++
     5  
     6  **WebAssembly** is a way to safely run code compiled in other languages. Runtimes
     7  execute WebAssembly Modules (Wasm), which are most often binaries with a
     8  `.wasm` extension.
     9  
    10  **wazero** is the only zero dependency WebAssembly runtime written in Go.
    11  
    12  ## Get Started
    13  
    14  **Get the wazero CLI** and run any Wasm binary
    15  
    16  ```bash
    17  curl https://wazero.io/install.sh | sh
    18  ./bin/wazero run app.wasm
    19  ```
    20  
    21  **Embed wazero** in your Go project and extend any app
    22  
    23  ```go
    24  import "github.com/AR1011/wazero"
    25  
    26  // ...
    27  
    28  r := wazero.NewRuntime(ctx)
    29  defer r.Close(ctx)
    30  mod, _ := r.Instantiate(ctx, wasmAdd)
    31  res, _ := mod.ExportedFunction("add").Call(ctx, 1, 2)
    32  ```
    33  
    34  ---
    35  
    36  ## Example
    37  
    38  The best way to learn wazero is by trying one of our [examples][1]. The
    39  most [basic example][2] extends a Go application with an addition function
    40  defined in WebAssembly.
    41  
    42  ## Why zero?
    43  
    44  By avoiding CGO, wazero avoids prerequisites such as shared libraries or libc,
    45  and lets you keep features like cross compilation. Being pure Go, wazero adds
    46  only a small amount of size to your binary. Meanwhile, wazero’s API gives
    47  features you expect in Go, such as safe concurrency and context propagation.
    48  
    49  ### When can I use this?
    50  
    51  You can use wazero today! wazero's [1.0 release][3] happened in March 2023, and
    52  is [in use]({{< relref "/community/users.md" >}}) by many projects and
    53  production sites.
    54  
    55  You can get the latest version of wazero like this.
    56  
    57  ```bash
    58  go get github.com/AR1011/wazero@latest
    59  ```
    60  
    61  Please give us a [star][4] if you end up using wazero!
    62  
    63  [1]: https://github.com/AR1011/wazero/blob/main/examples
    64  [2]: https://github.com/AR1011/wazero/blob/main/examples/basic
    65  [3]: https://tetrate.io/blog/introducing-wazero-from-tetrate/
    66  [4]: https://github.com/AR1011/wazero/stargazers