![]() |
VOOZH | about |
dotnet add package WACS.ComponentModel --version 0.10.3
NuGet\Install-Package WACS.ComponentModel -Version 0.10.3
<PackageReference Include="WACS.ComponentModel" Version="0.10.3" />
<PackageVersion Include="WACS.ComponentModel" Version="0.10.3" />Directory.Packages.props
<PackageReference Include="WACS.ComponentModel" />Project file
paket add WACS.ComponentModel --version 0.10.3
#r "nuget: WACS.ComponentModel, 0.10.3"
#:package WACS.ComponentModel@0.10.3
#addin nuget:?package=WACS.ComponentModel&version=0.10.3Install as a Cake Addin
#tool nuget:?package=WACS.ComponentModel&version=0.10.3Install as a Cake Tool
WebAssembly Component Model runtime for WACS — WIT parsing, canonical-ABI lift/lower, resource handles, and component instantiation. Layered on the same parse / validate / link pipeline WACS uses for core modules; works with both the interpreter and the AOT transpiler engines.
ComponentInstance.Instantiate, resource registries, variant /
option / result / list / record / tuple / flags lift+lowerWitLoader resolves use chains across
packages, embedded WIT files in assemblies via WitContract.FromAssemblyComponentBridge — cross-engine adapter that lets interpreted and transpiled
components compose against the same typed contractLinker.Validate(WitContract) — link-time check that bound host implementations
match the WIT contract (catches drift before the component runs)dotnet add package WACS.ComponentModel
using Wacs.ComponentModel.Runtime;
var bytes = File.ReadAllBytes("hello.component.wasm");
var ci = ComponentInstance.Instantiate(bytes,
rt =>
{
// configure host bindings on the underlying WasmRuntime
// — `--bind` shims, WASI Preview 2 hosts, custom IBindables
});
var result = ci.Invoke("greet", new object?[] { "world" });
Console.WriteLine(result);
For the WASI Preview 2 host implementations (cli / clocks / filesystem / http / io /
random / sockets), pair this package with WACS.WASI.Preview2
or WACS.WASI.Preview2.DependencyInjection.
For programmatic WIT ↔ C# binding generation, see
WACS.ComponentModel.Bindgen.Lib.
This package handles the component-model layer; the underlying core wasm executes through either:
WACS) — AOT-safe, ~270–385 iter/s
on CoreMark, suitable for Unity IL2CPP / PublishAot.WACS.Transpiler.Lib)
— Reflection.Emit AOT, ~17 500 iter/s on CoreMark, ~50% of native C speed.The wacs run --wasip2 CLI verb auto-routes to the transpiler engine when WASI Preview 2
host packages are wired. See the top-level
WACS README for the full
matrix.
docs/COMPONENT_CHAINING.md
— runtime requirements, host-package composition, end-to-end CLI / embedder examplesWacs.ComponentModel/Validation/README.md
— WIT contract validation deep-diveApache-2.0
| 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.ComponentModel:
| Package | Downloads |
|---|---|
|
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. |
|
|
WACS.WASI.Preview2
WASI Preview 2 (component-model) host implementations for WACS |
|
|
WACS.WASI.NN.DependencyInjection
Microsoft.Extensions.DependencyInjection extension methods for WACS.WASI.NN. Registers the WasiNNBundle that the transpiler's HostPackageResolver direct-links wasi:nn imports against — symmetric with WACS.WASI.Preview2.DependencyInjection. Tracks the wasi-nn proposal at WASI Phase 2 — the WIT surface may change as the proposal evolves. |
This package is not used by any popular GitHub repositories.