WACS.ComponentModel.Harness.Runtime
0.7.5
dotnet add package WACS.ComponentModel.Harness.Runtime --version 0.7.5
NuGet\Install-Package WACS.ComponentModel.Harness.Runtime -Version 0.7.5
<PackageReference Include="WACS.ComponentModel.Harness.Runtime" Version="0.7.5" />
<PackageVersion Include="WACS.ComponentModel.Harness.Runtime" Version="0.7.5" />
<PackageReference Include="WACS.ComponentModel.Harness.Runtime" />
paket add WACS.ComponentModel.Harness.Runtime --version 0.7.5
#r "nuget: WACS.ComponentModel.Harness.Runtime, 0.7.5"
#:package WACS.ComponentModel.Harness.Runtime@0.7.5
#addin nuget:?package=WACS.ComponentModel.Harness.Runtime&version=0.7.5
#tool nuget:?package=WACS.ComponentModel.Harness.Runtime&version=0.7.5
WACS.ComponentModel.Harness.Runtime
AOT-safe runtime primitives that emitted typed WIT harnesses link
against at runtime. Pure C# — no reflection, no
Reflection.Emit — so every type here is reachable from harness
IL transpiled by NativeAOT or Unity IL2CPP.
Multi-targets net8.0 (annotated IsAotCompatible=true) and
netstandard2.1.
What's inside
HarnessLoader.Load(byte[], Action<WasmRuntime>?, string)— the canonical-ABI boilerplate every emitted{World}Harness.LoadFromfunnels through: parse the.component.wasmwrapper (viaWACS.ComponentModel.Parser), pull the first embedded core module, instantiate it on a freshWasmRuntime, wire resource handle tables, return aLoadedComponentfor the emitter to walk for typed bindings.MemoryHelpers— little-endian readers / writers over aMemoryInstance's backingbyte[]. Owns the LE-on-every-width detail so emitted harness IL just callsReadI32LE/WriteI32LE/ etc.StringCoding— canonical-ABI string lift+lower for UTF-8 / UTF-16 / Latin1. Isolated behind one helper so a future swap (e.g.wasi-js-string-builtinsexternref) lands in one place.HostHandleTable— host-side handle space forown<R>/ resource handles that the guest hands to the host. Separate from the wasm-side rep table maintained by the runtime.Borrowed<T>— the lifetime-distinct view of a resource:borrow<R>references that the host received from wasm without participating in the host handle table. The struct is intentionally notIDisposable— code that took a borrow can't accidentally release it.WitContract+WitContractMismatchException— typed WIT model for runtime + compile-time validation; emitted harnesses embed the WIT source as_WitContractand the validator parses it back to diff against the component's embedded WIT custom section.WitResult,WitTupleAccess— helpers for theResult<T,E>andtuple<...>shapes emitted harness IL needs to construct + destructure.
How it relates to the other WACS packages
.wit files
│
▼ (build time)
WACS.ComponentModel.Harness.Lib ──► {World}Harness.dll
│ │
│ references │ references
▼ ▼
WACS.ComponentModel.Parser WACS.ComponentModel.Harness.Runtime (this)
│
▼
WACS.Core (interpreter)
A consumer running an emitted harness only needs this package
plus WACS at runtime —
the emitter (Harness.Lib) is a build-time tool, not a runtime
dependency.
| Package | Role |
|---|---|
WACS.ComponentModel.Harness.Runtime |
this — runtime primitives the emitted harness DLL calls into |
WACS.ComponentModel.Harness.Lib |
Build-time emitter — produces the {World}Harness.dll |
WACS.ComponentModel.Parser |
Used internally by HarnessLoader.Load to walk the .component.wasm |
WACS |
Core interpreter; HarnessLoader instantiates the embedded core module on a WasmRuntime |
WACS.Transpiler.Lib |
Alternative engine — emits a {World}HarnessImpl : I{World} against the same surface |
Why a separate package
The emitter (Harness.Lib) needs PersistedAssemblyBuilder and
targets net9.0. The runtime the emitter's output links
against has no such requirement — it's pure
canonical-ABI helpers. Splitting them lets consumers ship the
emitted harness DLL alongside this small AOT-safe runtime, on
net8.0 or netstandard2.1, without dragging the emitter into
the application image.
This is the same shape WACS uses elsewhere:
WACS.Transpiler.Lib vs WACS.Transpiler.Runtime,
WACS.ComponentModel.Bindgen.Lib vs the
WACS.ComponentModel.Bindgen.SourceGen analyzer.
Reference
The cross-engine symmetry story (interpreter {World}Harness vs
transpiler {World}HarnessImpl : I{World}) is documented in
docs/WIT_HARNESS_APPROACH.md.
License
Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- WACS (>= 0.16.14)
- WACS.ComponentModel.Parser (>= 0.2.2)
-
net8.0
- WACS (>= 0.16.14)
- WACS.ComponentModel.Parser (>= 0.2.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on WACS.ComponentModel.Harness.Runtime:
| Package | Downloads |
|---|---|
|
WACS.ComponentModel.Harness.Lib
Build-time IL emitter for typed WIT harnesses. Takes a WIT contract (either as a directory of `.wit` files or a pre-parsed CtPackage set) and emits a .NET assembly containing the typed harness class with `LoadFrom(byte[])` + per-export typed methods. Two ergonomic surfaces over one emit core: `EmitToFile` / `EmitToStream` for persisted .dll output (the `wacs harness gen` flow) and `EmitInMemory` for immediate consumption (the `wacs run --wit-dir` flow). Targets net9.0 to use PersistedAssemblyBuilder for the AOT-clean save+load round-trip. |
GitHub repositories
This package is not used by any popular GitHub repositories.