Name Date Size #Lines LOC

..15-May-2026-

codegen/H15-May-2026-26,08619,523

README.mdH A D15-May-20262.4 KiB6945

README.md

1<div align="center">
2  <h1>Winch</h1>
3
4  <h3>WebAssembly Intentionally Non-optimizing Compiler and Host</h3>
5
6  <p>
7    <strong>A WebAssembly baseline compiler</strong>
8  </p>
9
10  <strong>A <a href="https://bytecodealliance.org/">Bytecode Alliance</a> project</strong>
11
12  <p>
13    <a href="https://github.com/bytecodealliance/wasmtime/actions?query=workflow%3ACI"><img src="https://github.com/bytecodealliance/wasmtime/workflows/CI/badge.svg" alt="build status" /></a>
14    <a href="https://bytecodealliance.zulipchat.com/#narrow/stream/417703-winch"><img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" alt="zulip chat" /></a>
15    <img src="https://img.shields.io/badge/rustc-stable+-green.svg" alt="supported rustc stable" />
16    <a href="https://docs.rs/winch-codegen"><img src="https://docs.rs/winch-codegen/badge.svg" alt="Documentation Status" /></a>
17  </p>
18</div>
19
20## About
21
22Winch is a WebAssembly "baseline" or single-pass compiler designed for Wasmtime.
23
24Winch's primary goal is compilation performance, therefore only certain, very
25limited peephole optimizations are applied.
26
27For more details on the original motivation and goals, refer to the [Bytecode
28Alliance RFC for Baseline Compilation in Wasmtime.][rfc].
29
30[rfc]: https://github.com/bytecodealliance/rfcs/blob/main/accepted/wasmtime-baseline-compilation.md
31
32## Design principles
33
34* Single pass over Wasm bytecode
35
36* Function as the unit of compilation
37
38* Machine code generation directly from Wasm bytecode – no intermediate
39  representation
40
41* Avoid reinventing machine-code emission – use Cranelift's instruction emitter
42  code to create an assembler library
43
44* Prioritize compilation performance over runtime performance
45
46* Simple to verify by looking. It should be evident which machine instructions
47  are emitted per WebAssembly operator
48
49* Adding and iterating on new (WebAssembly and developer-facing) features should
50  be simpler than doing it in an optimizing tier (Cranelift)
51
52
53## Status
54
55Winch's aim is to support all the backends officially supported by Wasmtime:
56
57* x86\_64
58* arm64
59* riscv64
60* s390x
61
62The x86\_64 backend offers an almost-complete implementation, it currently
63supports all the instructions that are part of WebAssembly's MVP, plus some of
64the [feature extensions][feature-extensions]. Refer to the [Tiers of
65Support][tiers-of-support] for more details.
66
67[feature-extensions]: https://webassembly.org/features/
68[tiers-of-support]: https://docs.wasmtime.dev/stability-tiers.html
69