@ai-ecoverse/wasi-zig

中文文档
0.16.0-20发布于 2026/10/21MIT AND Apache-2.0 WITH LLVM-exception零依赖构建来源已验证近 30 天下载 4455

The Zig compiler with LLVM, to build Zig, C and C++ programs in SLICC.

原始使用文档

@ai-ecoverse/wasi-zig (with LLVM 21)

Zig 0.16.0 for slicc, built for wasm32-wasi with LLVM 21.1.8, clang and lld.

  • zig build-exe / run / test / build, -ofmt=c, all optimize modes, with LLVM's optimizer for ReleaseFast / ReleaseSmall / ReleaseSafe.
  • zig cc / zig c++ for wasm32-wasi. wasi-libc, libc++ and Zig's runtimes (compiler_rt, ubsan_rt, zigc) ship prebuilt for the baseline CPU; another CPU or mode (e.g. -mcpu=generic+simd128) builds wasi-libc from its C sources, in the optional @ai-ecoverse/wasi-zig-libc-src package (ipk install @ai-ecoverse/wasi-zig-libc-src).
  • Backends: Debug builds of pure-Zig wasm32 code use Zig's self-hosted wasm backend (fast compiles, as in the no-LLVM package); Release modes, programs that link libc and C/C++ sources use LLVM. -fllvm / -fno-llvm (or .use_llvm on a compile step) override that per build.
  • Targets: wasm32 / wasm64 only (the LLVM inside has the WebAssembly target); clang's resource headers are trimmed to the ones wasm uses.
  • Runs with real threads under slicc (LLVM's thread pool, wasi-threads).
  • @cImport and zig translate-c work (since 0.16.0-18, homescoop#1061). The first use compiles the translate-c tool into the cache, which takes a while.
  • zig c++ for wasm32-wasi compiles with -fno-exceptions by default (since 0.16.0-18, homescoop#1062): the bundled libc++ has no exception support, as with wasi-sdk's clang. So code with throw or try doesn't compile ("cannot use 'throw' with exceptions disabled"), and an exception libc++ itself throws (std::map::at out of range, a failed new) aborts the program. -fexceptions turns them back on, and the link then fails (__cxa_throw undefined).

LLVM is Apache-2.0 WITH LLVM-exception (LICENSE-LLVM.TXT); Zig is MIT (LICENSE).

版本与发布记录

@ai-ecoverse/wasi-zig 共发布 18 个版本,首次发布于 2026/10/01;过去 12 个月发布了 18 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.16.0-20latest2026/10/2117 天前
0.16.0-192026/10/2118 天前
0.16.0-182026/10/2118 天前
0.16.0-172026/10/1919 天前
0.16.0-162026/10/1821 天前
0.16.0-152026/10/041 个月前

关于 @ai-ecoverse/wasi-zig 的常见问题

@ai-ecoverse/wasi-zig 是什么?

The Zig compiler with LLVM, to build Zig, C and C++ programs in SLICC.

如何安装 @ai-ecoverse/wasi-zig?

在项目目录运行 npm install @ai-ecoverse/wasi-zig,或使用 pnpm add / yarn add / bun add。

@ai-ecoverse/wasi-zig 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ai-ecoverse__wasi-zig 是否存在。

@ai-ecoverse/wasi-zig 可以商用吗?

@ai-ecoverse/wasi-zig 使用 MIT AND Apache-2.0 WITH LLVM-exception 许可。声明的许可为 MIT AND Apache-2.0 WITH LLVM-exception,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@ai-ecoverse/wasi-zig 的下载量有多少?

根据 npm 官方下载统计,@ai-ecoverse/wasi-zig 在 2026/10/05 – 2026/11/03 这 30 天内被下载 4,455 次,日均约 149 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ai-ecoverse/wasi-zig 还在维护吗?

最新版本 0.16.0-20 发布于 2026/10/21(17 天前);至今共发布 18 个版本,其中过去 12 个月发布了 18 个;首次发布于 2026/10/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。