wabt-bin 2.0.0.dev2__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wabt_bin-2.0.0.dev2.dist-info/METADATA +91 -0
- wabt_bin-2.0.0.dev2.dist-info/RECORD +15 -0
- wabt_bin-2.0.0.dev2.dist-info/WHEEL +4 -0
- wabt_bin-2.0.0.dev2.dist-info/entry_points.txt +11 -0
- wabt_cli/__init__.py +88 -0
- wabt_cli/wasm-decompile.exe +0 -0
- wabt_cli/wasm-interp.exe +0 -0
- wabt_cli/wasm-objdump.exe +0 -0
- wabt_cli/wasm-stats.exe +0 -0
- wabt_cli/wasm-strip.exe +0 -0
- wabt_cli/wasm-validate.exe +0 -0
- wabt_cli/wasm2wat.exe +0 -0
- wabt_cli/wast2json.exe +0 -0
- wabt_cli/wat-desugar.exe +0 -0
- wabt_cli/wat2wasm.exe +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wabt-bin
|
|
3
|
+
Version: 2.0.0.dev2
|
|
4
|
+
Summary: WebAssembly Binary Toolkit — native CLI tools
|
|
5
|
+
Home-page: https://github.com/WebAssembly/wabt
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# WABT: The WebAssembly Binary Toolkit (Zig)
|
|
11
|
+
|
|
12
|
+
A fork of [WebAssembly/wabt](https://github.com/WebAssembly/wabt) ported from C++ to Zig and maintained with AI assistance.
|
|
13
|
+
|
|
14
|
+
**100% WebAssembly 3.0 spec conformance** — 65,011/65,011 tests passing.
|
|
15
|
+
|
|
16
|
+
## Tools
|
|
17
|
+
|
|
18
|
+
- **wat2wasm**: translate from [WebAssembly text format](https://webassembly.github.io/spec/core/text/index.html) to the [WebAssembly binary format](https://webassembly.github.io/spec/core/binary/index.html)
|
|
19
|
+
- **wasm2wat**: the inverse of wat2wasm, translate from the binary format back to the text format (also known as a .wat)
|
|
20
|
+
- **wasm-objdump**: print information about a wasm binary. Similar to objdump.
|
|
21
|
+
- **wasm-interp**: decode and run a WebAssembly binary file using a stack-based interpreter
|
|
22
|
+
- **wasm-decompile**: decompile a wasm binary into readable C-like syntax
|
|
23
|
+
- **wat-desugar**: parse .wat text form and print canonical flat format
|
|
24
|
+
- **wasm2c**: convert a WebAssembly binary file to a C source and header
|
|
25
|
+
- **wasm-strip**: remove sections of a WebAssembly binary file
|
|
26
|
+
- **wasm-validate**: validate a file in the WebAssembly binary format
|
|
27
|
+
- **wast2json**: convert a file in the wasm spec test format to a JSON file and associated wasm binary files
|
|
28
|
+
- **wasm-stats**: output stats for a module
|
|
29
|
+
- **spectest-interp**: run WebAssembly spec tests (.wast files)
|
|
30
|
+
|
|
31
|
+
## Building
|
|
32
|
+
|
|
33
|
+
Requires [Zig](https://ziglang.org/) 0.15.x. No other dependencies.
|
|
34
|
+
|
|
35
|
+
```console
|
|
36
|
+
$ git clone --recursive https://github.com/cataggar/wabt
|
|
37
|
+
$ cd wabt
|
|
38
|
+
$ zig build
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For release builds:
|
|
42
|
+
|
|
43
|
+
```console
|
|
44
|
+
$ zig build -Doptimize=ReleaseSafe
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Cross-compilation works out of the box:
|
|
48
|
+
|
|
49
|
+
```console
|
|
50
|
+
$ zig build -Dtarget=aarch64-linux -Doptimize=ReleaseSafe
|
|
51
|
+
$ zig build -Dtarget=aarch64-macos -Doptimize=ReleaseSafe
|
|
52
|
+
$ zig build -Dtarget=x86_64-windows -Doptimize=ReleaseSafe
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Running tests
|
|
56
|
+
|
|
57
|
+
Unit tests:
|
|
58
|
+
|
|
59
|
+
```console
|
|
60
|
+
$ zig build test
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Wasm 3.0 spec tests:
|
|
64
|
+
|
|
65
|
+
```console
|
|
66
|
+
$ zig build -Doptimize=ReleaseSafe
|
|
67
|
+
$ ./zig-out/bin/spectest-interp third_party/testsuite/i32.wast
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Wasm 3.0 proposals
|
|
71
|
+
|
|
72
|
+
All ratified Wasm 3.0 proposals are enabled by default:
|
|
73
|
+
|
|
74
|
+
| Proposal | Status |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| [Exception handling](https://github.com/WebAssembly/exception-handling) | ✓ |
|
|
77
|
+
| [GC (garbage collection)](https://github.com/WebAssembly/gc) | ✓ |
|
|
78
|
+
| [Memory64](https://github.com/WebAssembly/memory64) | ✓ |
|
|
79
|
+
| [Multi-memory](https://github.com/WebAssembly/multi-memory) | ✓ |
|
|
80
|
+
| [Tail calls](https://github.com/WebAssembly/tail-call) | ✓ |
|
|
81
|
+
| [Relaxed SIMD](https://github.com/WebAssembly/relaxed-simd) | ✓ |
|
|
82
|
+
| [Extended const](https://github.com/WebAssembly/extended-const) | ✓ |
|
|
83
|
+
| [SIMD](https://github.com/WebAssembly/simd) | ✓ |
|
|
84
|
+
| [Bulk memory](https://github.com/WebAssembly/bulk-memory-operations) | ✓ |
|
|
85
|
+
| [Reference types](https://github.com/WebAssembly/reference-types) | ✓ |
|
|
86
|
+
| [Multi-value](https://github.com/WebAssembly/multi-value) | ✓ |
|
|
87
|
+
| [Annotations](https://github.com/WebAssembly/annotations) | ✓ |
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
[Apache 2.0](LICENSE)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
wabt_cli/__init__.py,sha256=Mc6IOhK6rQt7-_FsUrl8yoeHgMDjtFwbMaD50EXoYVU,1641
|
|
2
|
+
wabt_cli/wasm-decompile.exe,sha256=G4uPrwnYtFzPM8j1m28AUKDaFF4x_PEizlk6sWb4AXM,33280
|
|
3
|
+
wabt_cli/wasm-interp.exe,sha256=MUkBfou85tRrZU5KNQN1IvK-UvE1N36qsOY9UmffbD4,33280
|
|
4
|
+
wabt_cli/wasm-objdump.exe,sha256=k_APzycupMt7ULJVWpMc5jgzeNQe1E9zZJ4b-LRyGoE,33280
|
|
5
|
+
wabt_cli/wasm-stats.exe,sha256=cLP-MVhpS4VRbv091Ysu9QCjzhnT_lgq1dxHTdVdtKQ,33280
|
|
6
|
+
wabt_cli/wasm-strip.exe,sha256=3aOL_K0GOzCzm-kqm-oAiTv1J30Rv4_FXqLmXvf-ODs,33280
|
|
7
|
+
wabt_cli/wasm-validate.exe,sha256=_Gayc7GQrB9vEfsVgtK1STVqsXV6gCXGvWuVU3CijVg,33280
|
|
8
|
+
wabt_cli/wasm2wat.exe,sha256=AEk8v5dFHA7bLpZiXmNqhbzjznPqF6Lsg9jL_nmtDLY,33280
|
|
9
|
+
wabt_cli/wast2json.exe,sha256=jot1WY50zCvJ1yH15LBFMVSr1oyUVJOxihuvkUEk-GE,33280
|
|
10
|
+
wabt_cli/wat-desugar.exe,sha256=Dv2LoiT3XEFLz6CLEGxG_v21D_Co5DLe3M26LvWOiis,33280
|
|
11
|
+
wabt_cli/wat2wasm.exe,sha256=vBlMv2xI6ufV2uncljm2vJYgKAB5GA2ame51rZ5uR5w,33280
|
|
12
|
+
wabt_bin-2.0.0.dev2.dist-info/METADATA,sha256=eDBqliT1oIfvSvOPdjixgj7tiEylU9FJlvSdnJlaqNM,3255
|
|
13
|
+
wabt_bin-2.0.0.dev2.dist-info/WHEEL,sha256=Ica8fhmbe52XbO1cyRYPNSx0KW5onuxFfHy_a18hkCU,93
|
|
14
|
+
wabt_bin-2.0.0.dev2.dist-info/entry_points.txt,sha256=D9vI5f2fuyaU0QjIZqwYMtvSBZ_h4nHQiLYYpdeBTiE,360
|
|
15
|
+
wabt_bin-2.0.0.dev2.dist-info/RECORD,,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[console_scripts]
|
|
2
|
+
wat2wasm = wabt_cli:wat2wasm
|
|
3
|
+
wasm2wat = wabt_cli:wasm2wat
|
|
4
|
+
wast2json = wabt_cli:wast2json
|
|
5
|
+
wasm-validate = wabt_cli:wasm_validate
|
|
6
|
+
wasm-objdump = wabt_cli:wasm_objdump
|
|
7
|
+
wasm-interp = wabt_cli:wasm_interp
|
|
8
|
+
wasm-decompile = wabt_cli:wasm_decompile
|
|
9
|
+
wasm-strip = wabt_cli:wasm_strip
|
|
10
|
+
wasm-stats = wabt_cli:wasm_stats
|
|
11
|
+
wat-desugar = wabt_cli:wat_desugar
|
wabt_cli/__init__.py
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""wabt-bin — WebAssembly Binary Toolkit CLI tools."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _get_version() -> str:
|
|
10
|
+
try:
|
|
11
|
+
from importlib.metadata import version
|
|
12
|
+
|
|
13
|
+
return version("wabt-bin")
|
|
14
|
+
except Exception:
|
|
15
|
+
return "0.0.0"
|
|
16
|
+
|
|
17
|
+
_TOOLS = [
|
|
18
|
+
"wat2wasm",
|
|
19
|
+
"wasm2wat",
|
|
20
|
+
"wast2json",
|
|
21
|
+
"wasm-validate",
|
|
22
|
+
"wasm-objdump",
|
|
23
|
+
"wasm-interp",
|
|
24
|
+
"wasm-decompile",
|
|
25
|
+
"wasm-strip",
|
|
26
|
+
"wasm-stats",
|
|
27
|
+
"wat-desugar",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
_EXT = ".exe" if sys.platform == "win32" else ""
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _binary_path(tool_name: str) -> Path:
|
|
34
|
+
"""Return the path to a wabt tool binary."""
|
|
35
|
+
return Path(__file__).parent / f"{tool_name}{_EXT}"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _run(tool_name: str) -> None:
|
|
39
|
+
"""Run a wabt tool binary, replacing the current process on Unix."""
|
|
40
|
+
binary = _binary_path(tool_name)
|
|
41
|
+
if not binary.exists():
|
|
42
|
+
print(f"{tool_name} binary not found at {binary}", file=sys.stderr)
|
|
43
|
+
sys.exit(1)
|
|
44
|
+
args = [str(binary), *sys.argv[1:]]
|
|
45
|
+
if sys.platform != "win32":
|
|
46
|
+
os.execv(args[0], args)
|
|
47
|
+
else:
|
|
48
|
+
raise SystemExit(subprocess.call(args))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def wat2wasm() -> None:
|
|
52
|
+
_run("wat2wasm")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def wasm2wat() -> None:
|
|
56
|
+
_run("wasm2wat")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def wast2json() -> None:
|
|
60
|
+
_run("wast2json")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def wasm_validate() -> None:
|
|
64
|
+
_run("wasm-validate")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def wasm_objdump() -> None:
|
|
68
|
+
_run("wasm-objdump")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def wasm_interp() -> None:
|
|
72
|
+
_run("wasm-interp")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def wasm_decompile() -> None:
|
|
76
|
+
_run("wasm-decompile")
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def wasm_strip() -> None:
|
|
80
|
+
_run("wasm-strip")
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def wasm_stats() -> None:
|
|
84
|
+
_run("wasm-stats")
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def wat_desugar() -> None:
|
|
88
|
+
_run("wat-desugar")
|
|
Binary file
|
wabt_cli/wasm-interp.exe
ADDED
|
Binary file
|
|
Binary file
|
wabt_cli/wasm-stats.exe
ADDED
|
Binary file
|
wabt_cli/wasm-strip.exe
ADDED
|
Binary file
|
|
Binary file
|
wabt_cli/wasm2wat.exe
ADDED
|
Binary file
|
wabt_cli/wast2json.exe
ADDED
|
Binary file
|
wabt_cli/wat-desugar.exe
ADDED
|
Binary file
|
wabt_cli/wat2wasm.exe
ADDED
|
Binary file
|