Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gate-computer/wag
WebAssembly compiler implemented in Go
https://github.com/gate-computer/wag
aarch64 amd64 arm64 compiler go wasm webassembly x86-64
Last synced: 6 days ago
JSON representation
WebAssembly compiler implemented in Go
- Host: GitHub
- URL: https://github.com/gate-computer/wag
- Owner: gate-computer
- License: bsd-3-clause
- Created: 2015-11-27T08:12:25.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-11-23T21:23:08.000Z (29 days ago)
- Last Synced: 2024-12-15T16:59:45.860Z (7 days ago)
- Topics: aarch64, amd64, arm64, compiler, go, wasm, webassembly, x86-64
- Language: Go
- Homepage: https://pkg.go.dev/gate.computer/wag
- Size: 3.97 MB
- Stars: 192
- Watchers: 9
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - wag - computer | 179 | (Go)
README
Wag is a [WebAssembly](https://webassembly.org) compiler implemented as a
[Go](https://golang.org) package.- License: [3-clause BSD](LICENSE)
- Author: Timo SavolaFeatures
--------- The input is a wasm binary module.
- The output is machine code.
- It is only a compiler. A runtime environment for the compiled program,
including all import functions, needs to be implemented separately. Wag has
been developed for the [Gate](https://gate.computer/gate) runtime.- Single-pass, fast ahead-of-time compilation.
- The generated code requires minimal runtime support; it's designed to be
executed in an isolated environment. Calling standard library ABIs is not
directly supported.- Supports snapshot-and-restore across compiler versions and CPU architectures.
- Supports breakpoint debugging via recompilation.
- Cross-compilation is supported via Go build tags. If `wagamd64` is
specified, the x86-64 code generator is used regardless of host architecture,
and CPU feature detection is disabled with pessimistic assumptions. Likewise
for `wagarm64` (but feature detection is not currently used for ARM64 in any
case).Status
------- Supports WebAssembly version 1 (wasm32).
- Supports non-trapping float-to-int conversions extension, sign-extension
instructions extension, and partially bulk memory operations extension.- Supports x86-64 and ARM64 code generation.
- Generated x86-64 code requires SSE4.1 floating-point instructions (available
since 2007).Security
--------[Spectre](https://spectreattack.com) variant 1: Out-of-bounds linear memory
access detection requires that addressable but unallocated memory is
inaccessible. It naturally prevents conditional branch exploitation.Spectre variant 2: On x86-64, [Retpoline](https://support.google.com/faqs/answer/7625886)
is used to protect the runtime environment (although user programs shouldn't be
able to inject arbitrary addresses into the branch target buffer).Testing
-------Requires Linux, Make, Go, Python, [Capstone](https://www.capstone-engine.org),
and a recent version of [WABT](https://github.com/WebAssembly/wabt).
The applicable parts of the WebAssembly spec testsuite are run. Code execution
tests are implemented in a separate Go module in the testsuite subdirectory (to
work around circular dependencies). All tests can be run by checking out Git
submodules and running `make check`.