@thi.ng/wasm-api
Advanced tools
Comparing version 1.5.0 to 1.5.1
# Change Log | ||
- **Last updated**: 2024-04-22T09:56:21Z | ||
- **Last updated**: 2024-04-22T10:34:01Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -5,0 +5,0 @@ |
{ | ||
"name": "@thi.ng/wasm-api", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects", | ||
@@ -119,3 +119,3 @@ "type": "module", | ||
}, | ||
"gitHead": "4e2bf6b12e35192e678b525fa699429370e357d3\n" | ||
"gitHead": "7d3339310c56ac7fd3572fb3487b6f34f1de57ca\n" | ||
} |
@@ -24,3 +24,3 @@ <!-- This file is generated - DO NOT EDIT! --> | ||
- [Using the Zig build system](#using-the-zig-build-system) | ||
- [Zig v0.11.0 or newer](#zig-v0110-or-newer) | ||
- [Zig v0.12 or newer](#zig-v012-or-newer) | ||
- [Example projects](#example-projects) | ||
@@ -319,7 +319,8 @@ - [Naming & structural conventions](#naming--structural-conventions) | ||
### Zig v0.11.0 or newer | ||
### Zig v0.12 or newer | ||
**IMPORTANT:** Due to recent [syntax & build system changes in Zig | ||
v0.11.0](https://ziglang.org/download/0.11.0/release-notes.html), support for | ||
older Zig versions had to be removed... | ||
v0.12.0](https://ziglang.org/download/0.12.0/release-notes.html), older Zig | ||
versions are not actively unsupported (however build files for v0.10 and v0.11 | ||
are still included) | ||
@@ -475,8 +476,9 @@ ```zig | ||
```bash | ||
# compile WASM binary | ||
zig build-lib \ | ||
--pkg-begin wasm-api node_modules/@thi.ng/wasm-api/zig/lib.zig --pkg-end \ | ||
-target wasm32-freestanding \ | ||
-O ReleaseSmall -dynamic -rdynamic \ | ||
hello.zig | ||
# compile WASM binary (zig v0.12) | ||
zig build-exe \ | ||
-fno-entry -fstrip -OReleaseSmall -target wasm32-freestanding \ | ||
--name main -rdynamic --import-symbols \ | ||
--dep wasm-api \ | ||
-Mroot=hello.zig \ | ||
-Mwasm-api=node_modules/@thi.ng/wasm-api/zig/lib.zig | ||
@@ -491,25 +493,20 @@ # disassemble WASM | ||
(module | ||
(type $i32_i32_=>_none (func (param i32 i32))) | ||
(type $none_=>_none (func)) | ||
(type $i32_=>_i32 (func (param i32) (result i32))) | ||
(import "wasmapi" "_printStr" (func $fimport$0 (param i32 i32))) | ||
(global $global$0 (mut i32) (i32.const 1048576)) | ||
(memory $0 17) | ||
(data (i32.const 1048576) "hello world!\00") | ||
(export "memory" (memory $0)) | ||
(export "start" (func $0)) | ||
(export "_wasm_allocate" (func $1)) | ||
(export "_wasm_free" (func $2)) | ||
(func $0 | ||
(call $fimport$0 | ||
(i32.const 1048576) | ||
(i32.const 12) | ||
) | ||
) | ||
(func $1 (param $0 i32) (result i32) | ||
(i32.const 0) | ||
) | ||
(func $2 (param $0 i32) (param $1 i32) | ||
) | ||
) | ||
(type $t0 (func (param i32 i32))) | ||
(type $t1 (func)) | ||
(type $t2 (func (param i32) (result i32))) | ||
(import "wasmapi" "_printStr" (func $wasmapi._printStr (type $t0))) | ||
(func $start (type $t1) | ||
(call $wasmapi._printStr | ||
(i32.const 1048576) | ||
(i32.const 12))) | ||
(func $_wasm_allocate (type $t2) (param $p0 i32) (result i32) | ||
(i32.const 0)) | ||
(func $_wasm_free (type $t0) (param $p0 i32) (param $p1 i32)) | ||
(memory $memory 17) | ||
(global $g0 (mut i32) (i32.const 1048576)) | ||
(export "memory" (memory $memory)) | ||
(export "start" (func $start)) | ||
(export "_wasm_allocate" (func $_wasm_allocate)) | ||
(export "_wasm_free" (func $_wasm_free)) | ||
(data $d0 (i32.const 1048576) "hello world!\00")) | ||
``` | ||
@@ -516,0 +513,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143945
548