![]() |
VOOZH | about |
dotnet add package WACS --version 0.16.14
NuGet\Install-Package WACS -Version 0.16.14
<PackageReference Include="WACS" Version="0.16.14" />
<PackageVersion Include="WACS" Version="0.16.14" />Directory.Packages.props
<PackageReference Include="WACS" />Project file
paket add WACS --version 0.16.14
#r "nuget: WACS, 0.16.14"
#:package WACS@0.16.14
#addin nuget:?package=WACS&version=0.16.14Install as a Cake Addin
#tool nuget:?package=WACS&version=0.16.14Install as a Cake Tool
WACS is a pure C# WebAssembly Interpreter designed for .NET environments, including Unity's IL2CPP. It allows seamless execution of WASM modules with minimal setup, offering compatibility and advanced interop features.
Install WACS from NuGet:
dotnet add package WACS
Here's a basic example demonstrating how to load and run a WebAssembly module:
using System;
using System.IO;
using Wacs.Core;
using Wacs.Core.Runtime;
var runtime = new WasmRuntime();
runtime.BindHostFunction<Action<char>>(("env", "sayc"), c => Console.Write(c));
using var fileStream = new FileStream("HelloWorld.wasm", FileMode.Open);
var module = BinaryModuleParser.ParseWasm(fileStream);
var modInst = runtime.InstantiateModule(module);
runtime.RegisterModule("hello", modInst);
if (runtime.TryGetExportedFunction(("hello", "main"), out var mainAddr))
{
var mainInvoker = runtime.CreateInvokerFunc<Value>(mainAddr);
int result = mainInvoker();
Console.Error.WriteLine($"hello.main() => {result}");
}
An alternative interpreter backed by a source-generated monolithic switch over an annotated bytecode stream — typically 1.5–2× the polymorphic runtime on compute-heavy workloads, AOT-safe, same correctness (118/118 wast files pass).
Set both flags before InstantiateModule — the switch runtime eagerly
compiles every module-owned function at link time when enabled:
var runtime = new WasmRuntime();
runtime.UseSwitchRuntime = true;
runtime.ExecContext.Attributes.UseSwitchSuperInstructions = true; // optional stream-fuser
var modInst = runtime.InstantiateModule(module);
See for the full architecture. The polymorphic runtime stays the default path.
WACS is distributed under the Apache 2.0 License, allowing usage in both open-source and commercial projects.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on WACS:
| Package | Downloads |
|---|---|
|
Hako.Backend.WACS
A Hako backend which uses https://github.com/kelnishi/WACS, a WebAssembly runtime implemented in .NET Using this backend allows a .NET application using Hako to compile to any target where .NET is supported |
|
|
WACS.ComponentModel
WebAssembly Component Model support for WACS. Provides the WIT IDL parser, component types, canonical ABI lift/lower, component instantiation, and the host binding surface for running .component.wasm modules on the WACS runtime and AOT transpiler. |
|
|
WACS.WASI.NN
WASI-NN host bindings for WACS — wasi:nn@0.2.0-rc-2024-10-28 (component-model WIT) plus the legacy wasi_ephemeral_nn (WITX) ABI. Backend-agnostic core; pluggable backends (ML.NET, ONNX Runtime, ONNX Runtime GenAI, LlamaSharp, TorchSharp, OpenVINO) ship as sibling packages. Tracks the wasi-nn proposal at WASI Phase 2 — the WIT surface may change as the proposal evolves. |
|
|
WACS.Transpiler.Lib
Library API for WACS.Transpiler — programmatic ahead-of-time WebAssembly-to-.NET IL transpilation, plus seamless loading of saved transpiled assemblies. v0.7.2 fixes a re-instantiation bug where Module classes with active data segments would come up zeroed on the second `Activator.CreateInstance` because spec §4.5.4 segment-drop emptied the process-wide ModuleInit registry. Module ctors now restore from `ModuleInitData.SavedDataSegments` before each CopyDataSegment so every fresh instance sees its memory initialized. v0.7 retires Lokad.ILPack for PersistedAssemblyBuilder (.NET 9), moves WASM data segments + the codec blob to RVA-mapped initialized data (62.5% smaller than the prior base64-in-#US path, true zero-copy from PE pages to ModuleInitData via UnmanagedMemoryStream), and introduces EmissionTarget.Auto as the new default — promotes to AotLinked when the module fits a conservative envelope (compute / memory / globals / tables + active+passive segments / multi-memory / local tags / imported functions), falling back to Standard otherwise. ~50% first-trial cold-start cut on promoted modules. ImportDispatcher now throws on missing handlers by default (lenient: true opts out). v0.6 consumed the Branch Hinting proposal's metadata.code.branch_hint custom section. v0.5 added the AotLinked emission target, stable AssemblyName, and the [WacsTranspiledImports] / [WacsImportNames] emission used by WACS.HostBindings.SourceGen. |
|
|
WACS.WASI.Preview2.DependencyInjection
Microsoft.Extensions.DependencyInjection extension methods for WACS.WASI.Preview2. Registers default host implementations + bindings + a pre-wired Linker. |
Showing the top 1 popular GitHub repositories that depend on WACS:
| Repository | Stars |
|---|---|
|
6over3/hako
An embeddable, lightweight, secure, high-performance JavaScript engine.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 0.16.14 | 850 | 5/28/2026 |
| 0.15.22 | 288 | 5/18/2026 |
| 0.15.20 | 421 | 5/16/2026 |
| 0.15.19 | 512 | 5/12/2026 |
| 0.13.8 | 510 | 5/11/2026 |
| 0.13.7 | 1,207 | 5/10/2026 |
| 0.12.1 | 199 | 5/7/2026 |
| 0.10.0 | 484 | 5/1/2026 |
| 0.9.1 | 201 | 4/23/2026 |
| 0.9.0 | 244 | 4/23/2026 |
| 0.8.3 | 218 | 4/21/2026 |
| 0.8.2 | 196 | 4/21/2026 |
| 0.8.1 | 193 | 4/20/2026 |
| 0.8.0 | 199 | 4/18/2026 |
| 0.7.5 | 636 | 11/3/2025 |
| 0.7.4 | 347 | 2/24/2025 |
| 0.7.3 | 304 | 2/6/2025 |
| 0.7.2 | 301 | 2/6/2025 |
| 0.7.1 | 473 | 2/6/2025 |
| 0.7.0 | 289 | 1/14/2025 |