wabt-bin 2.0.0__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.
@@ -0,0 +1,101 @@
1
+ Metadata-Version: 2.4
2
+ Name: wabt-bin
3
+ Version: 2.0.0
4
+ Summary: WebAssembly Binary Toolkit — native CLI tools
5
+ Home-page: https://github.com/cataggar/wabt
6
+ License: Apache-2.0
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+
10
+ # WABT: The WebAssembly Binary Toolkit
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
+ ## Install
17
+
18
+ Pre-built binaries are published to [GitHub Releases](https://github.com/cataggar/wabt/releases) and [PyPI](https://pypi.org/project/wabt-bin/). See [installation details](https://github.com/cataggar/wabt/issues/69).
19
+
20
+ ```console
21
+ $ dist install cataggar/wabt
22
+ ```
23
+
24
+ ```console
25
+ $ uv tool install wabt-bin
26
+ ```
27
+
28
+ ## Tools
29
+
30
+ - **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)
31
+ - **wasm2wat**: the inverse of wat2wasm, translate from the binary format back to the text format (also known as a .wat)
32
+ - **wasm-objdump**: print information about a wasm binary. Similar to objdump.
33
+ - **wasm-interp**: decode and run a WebAssembly binary file using a stack-based interpreter
34
+ - **wasm-decompile**: decompile a wasm binary into readable C-like syntax
35
+ - **wat-desugar**: parse .wat text form and print canonical flat format
36
+ - **wasm-strip**: remove sections of a WebAssembly binary file
37
+ - **wasm-validate**: validate a file in the WebAssembly binary format
38
+ - **wast2json**: convert a file in the wasm spec test format to a JSON file and associated wasm binary files
39
+ - **wasm-stats**: output stats for a module
40
+
41
+ ## Building
42
+
43
+ Requires [Zig](https://ziglang.org/) 0.15.x. No other dependencies.
44
+
45
+ ```console
46
+ $ git clone --recursive https://github.com/cataggar/wabt
47
+ $ cd wabt
48
+ $ zig build
49
+ ```
50
+
51
+ For release builds:
52
+
53
+ ```console
54
+ $ zig build -Doptimize=ReleaseSafe
55
+ ```
56
+
57
+ Cross-compilation works out of the box:
58
+
59
+ ```console
60
+ $ zig build -Dtarget=aarch64-linux -Doptimize=ReleaseSafe
61
+ $ zig build -Dtarget=aarch64-macos -Doptimize=ReleaseSafe
62
+ $ zig build -Dtarget=x86_64-windows -Doptimize=ReleaseSafe
63
+ ```
64
+
65
+ ## Running tests
66
+
67
+ Unit tests:
68
+
69
+ ```console
70
+ $ zig build test
71
+ ```
72
+
73
+ Wasm 3.0 spec tests:
74
+
75
+ ```console
76
+ $ zig build -Doptimize=ReleaseSafe
77
+ $ ./zig-out/bin/spectest-interp third_party/testsuite/i32.wast
78
+ ```
79
+
80
+ ## Wasm 3.0 proposals
81
+
82
+ All ratified Wasm 3.0 proposals are enabled by default:
83
+
84
+ | Proposal | Status |
85
+ | --- | --- |
86
+ | [Exception handling](https://github.com/WebAssembly/exception-handling) | ✓ |
87
+ | [GC (garbage collection)](https://github.com/WebAssembly/gc) | ✓ |
88
+ | [Memory64](https://github.com/WebAssembly/memory64) | ✓ |
89
+ | [Multi-memory](https://github.com/WebAssembly/multi-memory) | ✓ |
90
+ | [Tail calls](https://github.com/WebAssembly/tail-call) | ✓ |
91
+ | [Relaxed SIMD](https://github.com/WebAssembly/relaxed-simd) | ✓ |
92
+ | [Extended const](https://github.com/WebAssembly/extended-const) | ✓ |
93
+ | [SIMD](https://github.com/WebAssembly/simd) | ✓ |
94
+ | [Bulk memory](https://github.com/WebAssembly/bulk-memory-operations) | ✓ |
95
+ | [Reference types](https://github.com/WebAssembly/reference-types) | ✓ |
96
+ | [Multi-value](https://github.com/WebAssembly/multi-value) | ✓ |
97
+ | [Annotations](https://github.com/WebAssembly/annotations) | ✓ |
98
+
99
+ ## License
100
+
101
+ [Apache 2.0](LICENSE)
@@ -0,0 +1,15 @@
1
+ wabt_cli/__init__.py,sha256=Mc6IOhK6rQt7-_FsUrl8yoeHgMDjtFwbMaD50EXoYVU,1641
2
+ wabt_cli/wasm-decompile.exe,sha256=4e6lHwHqGphhxWPPAGGL_gB-__ZluPAccYUsSBDdPgU,307200
3
+ wabt_cli/wasm-interp.exe,sha256=UtdiWditPRzYhyz5oAJDB_qPD5WEPgc7wzSUbj_azH0,289792
4
+ wabt_cli/wasm-objdump.exe,sha256=msBtGKxzw5Z4h-LzCU6NHIz_dvsL4p6AUdRm5XHav9o,292352
5
+ wabt_cli/wasm-stats.exe,sha256=p0T_j_8elEGnSthPenl25eNBYqnY_wwiNRXXWaMdquw,291328
6
+ wabt_cli/wasm-strip.exe,sha256=jrIQ7NUsK1FgiFRK1wbD7UTVke2_PYu-cuXyRLIipXg,303616
7
+ wabt_cli/wasm-validate.exe,sha256=JZkXqag1fNNIfctvZvt4l-ouOpimqRGBKA7_kXIgo2k,335360
8
+ wabt_cli/wasm2wat.exe,sha256=POkgT2W09vuL7DSb2PkNtb0afgRIWv4dN9kQSiKjwd4,313344
9
+ wabt_cli/wast2json.exe,sha256=luEzAhGaLgt9ceWEp60wfVWDKiW57shHE3i_THryGRQ,544256
10
+ wabt_cli/wat-desugar.exe,sha256=lLtE2dd9A8GYLKlqnFbljX7ewChk-ZTdyBXIx4qd7LA,551424
11
+ wabt_cli/wat2wasm.exe,sha256=E45L7c_ayD0tIZTmNnCwS9m4jHPCFxPv-IAf_Pedfo0,594944
12
+ wabt_bin-2.0.0.dist-info/METADATA,sha256=4p1FSado-xzt8r5zzFWHCexdWgE_8djBQEnu_RoXq6I,3420
13
+ wabt_bin-2.0.0.dist-info/WHEEL,sha256=Ica8fhmbe52XbO1cyRYPNSx0KW5onuxFfHy_a18hkCU,93
14
+ wabt_bin-2.0.0.dist-info/entry_points.txt,sha256=D9vI5f2fuyaU0QjIZqwYMtvSBZ_h4nHQiLYYpdeBTiE,360
15
+ wabt_bin-2.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: build_wheels.py
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -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
Binary file
Binary file
Binary file
Binary file
Binary file
wabt_cli/wasm2wat.exe ADDED
Binary file
wabt_cli/wast2json.exe ADDED
Binary file
Binary file
wabt_cli/wat2wasm.exe ADDED
Binary file