Skip to content

3.0.0-alpha.5 - #4

Merged
dirkwa merged 5 commits into
masterfrom
WASM_WASIX
Dec 2, 2025
Merged

dirkwa merged 5 commits into
masterfrom
WASM_WASIX

Conversation

@dirkwa

@dirkwa dirkwa commented Dec 2, 2025

Copy link
Copy Markdown
Owner

[3.0.0-alpha.5] - 2025-12-03

Investigated - C#/.NET WASM Support

Status: NOT CURRENTLY WORKING

Attempted to add C#/.NET as a third WASM plugin language option using componentize-dotnet. After extensive investigation, discovered fundamental incompatibility between componentize-dotnet and Node.js/V8 (via jco transpilation).

What Was Tested:

  • .NET 10.0 Preview with BytecodeAlliance.Componentize.DotNet.Wasm.SDK 0.7.0-preview00010
  • WASI Component Model (P2) compilation target
  • jco 1.10.0 for JavaScript transpilation

What Works:

  • Building .NET WASI Component: ✅
  • Transpiling with jco to JavaScript: ✅
  • Plugin initialization ($init): ✅
  • Plugin registration in Signal K: ✅

What Fails:

  • Calling any exported function results in: RuntimeError: null function or function signature mismatch
  • Root cause: .NET NativeAOT uses indirect call tables (call_indirect) that are initialized by _initialize(). This works in Wasmtime but table entries remain null in V8.

Workarounds Attempted (None Successful):

  1. Manual _initialize() call - No effect
  2. Manual InitializeModules() call - Crashes (already called by _initialize)
  3. Various jco flags (--instantiation sync, --tla-compat) - No effect
  4. Removing [ThreadStatic] attribute - Fixed build issues but not runtime

Conclusion:
componentize-dotnet explicitly only supports Wasmtime and WAMR runtimes, not V8/JavaScript. This is a known limitation documented in their README. The issue is deeply embedded in how .NET NativeAOT-LLVM structures WASM output.

Issue Filed:
bytecodealliance/componentize-dotnet#103

Files Created:

  • examples/wasm-plugins/anchor-watch-dotnet/ - Complete example with documentation
  • examples/wasm-plugins/anchor-watch-dotnet/ISSUE_REPORT.md - Detailed technical report

Documentation Updated:

  • wasm/WASM_PLUGIN_DEV_GUIDE.md - C#/.NET section marked as NOT WORKING
  • examples/wasm-plugins/anchor-watch-dotnet/README.md - Marked as NOT WORKING with explanation

Future Possibilities:

  • Wait for componentize-dotnet to add V8/jco support
  • Alternative: Mono interpreter approach (different compilation strategy)
  • Alternative: Direct Wasmtime embedding in Node.js (if/when available)

01.12. SK changes from master
- Debug logging toggle in Admin UI
- setPluginStatus/setPluginError working
- Configuration persistence fixed
- Dashboard visibility working
@dirkwa
dirkwa merged commit 39895f3 into master Dec 2, 2025
@dirkwa dirkwa mentioned this pull request Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant