• Stars
    star
    4,478
  • Rank 9,051 (Top 0.2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 4 years ago
  • Updated 27 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

wazero: the zero dependency WebAssembly runtime for Go developers

wazero: the zero dependency WebAssembly runtime for Go developers

WebAssembly Core Specification Test Go Reference License

WebAssembly is a way to safely run code compiled in other languages. Runtimes execute WebAssembly Modules (Wasm), which are most often binaries with a .wasm extension.

wazero is a WebAssembly Core Specification 1.0 and 2.0 compliant runtime written in Go. It has zero dependencies, and doesn't rely on CGO. This means you can run applications in other languages and still keep cross compilation.

Import wazero and extend your Go application with code written in any language!

Example

The best way to learn wazero is by trying one of our examples. The most basic example extends a Go application with an addition function defined in WebAssembly.

Runtime

There are two runtime configurations supported in wazero: Compiler is default:

By default, ex wazero.NewRuntime(ctx), the Compiler is used if supported. You can also force the interpreter like so:

r := wazero.NewRuntimeWithConfig(ctx, wazero.NewRuntimeConfigInterpreter())

Interpreter

Interpreter is a naive interpreter-based implementation of Wasm virtual machine. Its implementation doesn't have any platform (GOARCH, GOOS) specific code, therefore interpreter can be used for any compilation target available for Go (such as riscv64).

Compiler

Compiler compiles WebAssembly modules into machine code ahead of time (AOT), during Runtime.CompileModule. This means your WebAssembly functions execute natively at runtime. Compiler is faster than Interpreter, often by order of magnitude (10x) or more. This is done without host-specific dependencies.

If interested, check out the RATIONALE.md and help us optimize further!

Conformance

Both runtimes pass WebAssembly Core 1.0 and 2.0 specification tests on supported platforms:

Runtime Usage amd64 arm64 others
Interpreter wazero.NewRuntimeConfigInterpreter()
Compiler wazero.NewRuntimeConfigCompiler()

Support Policy

The below support policy focuses on compatability concerns of those embedding wazero into their Go applications.

wazero

wazero's 1.0 release happened in March 2023, and is in use by many projects and production sites.

We offer an API stability promise with semantic versioning. In other words, we promise to not break any exported function signature without incrementing the major version. This does not mean no innovation: New features and behaviors happen with a minor version increment, e.g. 1.0.11 to 1.2.0. We also fix bugs or change internal details with a patch version, e.g. 1.0.0 to 1.0.1.

You can get the latest version of wazero like this.

go get github.com/tetratelabs/wazero@latest

Please give us a star if you end up using wazero!

Go

wazero has no dependencies except Go, so the only source of conflict in your project's use of wazero is the Go version.

wazero follows the same version policy as Go's Release Policy: two versions. wazero will ensure these versions work and bugs are valid if there's an issue with a current Go version.

Additionally, wazero intentionally delays usage of language or standard library features one additional version. For example, when Go 1.29 is released, wazero can use language features or standard libraries added in 1.27. This is a convenience for embedders who have a slower version policy than Go. However, only supported Go versions may be used to raise support issues.

Platform

wazero has two runtime modes: Interpreter and Compiler. The only supported operating systems are ones we test, but that doesn't necessarily mean other operating system versions won't work.

We currently test Linux (Ubuntu and scratch), MacOS and Windows as packaged by GitHub Actions, as well compilation of 32-bit Linux and 64-bit FreeBSD.

  • Interpreter
    • Linux is tested on amd64 (native) as well arm64 and riscv64 via emulation.
    • MacOS and Windows are only tested on amd64.
  • Compiler
    • Linux is tested on amd64 (native) as well arm64 via emulation.
    • MacOS and Windows are only tested on amd64.

wazero has no dependencies and doesn't require CGO. This means it can also be embedded in an application that doesn't use an operating system. This is a main differentiator between wazero and alternatives.

We verify zero dependencies by running tests in Docker's scratch image. This approach ensures compatibility with any parent image.


wazero is a registered trademark of Tetrate.io, Inc. in the United States and/or other countries

More Repositories

1

proxy-wasm-go-sdk

WebAssembly for Proxies (Go SDK)
Go
654
star
2

func-e

func-e (pronounced funky) makes running Envoy® easy
Go
346
star
3

getmesh

Go
140
star
4

istio-weekly

Demos, slides, resources and other stuff from Istio Weekly and Istio Big Talk episodes
67
star
5

envoy-wasm-rust-sdk

Rust SDK for WebAssembly-based Envoy extensions
Rust
52
star
6

istio-tools

A set of tools written by Tetrate to help wrangle Istio.
Go
47
star
7

car

Like tar, but for containers!
Go
45
star
8

istio-0to60

Istio 0 to 60 workshop labs
HTML
22
star
9

wabin

wabin: WebAssembly Binary Format in Go
Go
19
star
10

istio-security-analyzer

Go
18
star
11

istio-training

Materials for Istio training
15
star
12

istio-cheatsheet

Istio config cheatsheet
JavaScript
15
star
13

cncf-istio-course

Go
14
star
14

wasm-rate-limiting

A sample Istio WebAssembly plugin for rate limiting.
Go
14
star
15

istio-workshop-zh

Istio Workshop/教程中文版
13
star
16

tinymem

WebAssembly compatible memory utilities for TinyGo
Go
12
star
17

wasmxds

a Kubernetes operator implementing Extension Configuration Discovery Service for Envoy Wasm extensions
Go
11
star
18

istio-cost-analyzer

Cluster Egress Cost Analysis
Go
10
star
19

archive-envoy

Archive of Envoy® release binaries
Shell
10
star
20

zta-demo-2022

Demo delivered at the 2022 ZTA and DevSecOps for Cloud Native Applications NIST conference
Go
9
star
21

terraform-eksblueprints-tetrate-istio-addon

HCL
7
star
22

log

Common logging infrastructure
Go
7
star
23

tetrate-todos

Sample Spring Boot Application
Java
6
star
24

istio-distro.io

Tetrate Istio Distro project website, formerly GetIstio
SCSS
6
star
25

envoy-postgres-stats-example

PLpgSQL
5
star
26

zipkin-es-templater

Tests for and creates when needed Elasticsearch index templates for Zipkin
Go
5
star
27

telemetry

Telemetry interfaces for logs and metrics allowing complete decoupling of instrumentation implementations.
Go
5
star
28

tetrate-tech-talks

HTML
4
star
29

run

run.Group is a universal mechanism to manage package lifecycles. Based on https://github.com/oklog/run
Go
4
star
30

qcon-labs

4
star
31

envoy-als

gRPC access logging service example from Envoy Fundamentals course
Go
4
star
32

envoy-smtp-filter

WebAssembly-based SMTP filter for Envoy
Rust
3
star
33

venafi-demo

3
star
34

pulumi-checkmate

TypeScript
2
star
35

terraform-provider-checkmate

Go
2
star
36

istio-vault-ext-certs

Makefile
2
star
37

kubecon2022-eu-immersion-day

Labs for the Kubecon 2022 EU immersion day
Go
1
star
38

wazero-playground

Demo architecture for a service that embeds a golang to webassembly compiler
1
star
39

bugs-are-features

This repository is a sample buggy React application based on CRA
TypeScript
1
star
40

telemetry-opentelemetry

OpenTelemetry backed implementation to the Tetratelabs Telemetry metrics interfaces
Go
1
star
41

wasm-json-validation-demo

Go
1
star
42

istio-api

Makefile
1
star
43

networking-demo

Go
1
star
44

wazero-fuzz

This has been merged into https://github.com/tetratelabs/wazero
Go
1
star
45

tsb-cheatsheet

JavaScript
1
star
46

aws-app-mesh-to-istio-example

This is an example of moving AWS demo application to Istio
Go
1
star
47

telemetry-gokit-log

Telemetry Logger implementation bridging Go Kit Log
Go
1
star
48

charts

Smarty
1
star
49

telemetry-opencensus

Telemetry Metric implementation bridging OpenCensus metrics
Go
1
star
50

helm-charts

Smarty
1
star