wasmtime-dotnet icon indicating copy to clipboard operation
wasmtime-dotnet copied to clipboard

AOT Compatibility

Open andrewmd5 opened this issue 1 year ago • 1 comments

I'd like to suggest some improvements to make wasmtime-dotnet more AOT friendly. I'm thinking along the lines of enabling static linking against wasmtime, which could really improve scenarios where the C# assembly is AOT compiled.. More details about .NET's native AOT and how it interops with native code can be found here: Native AOT with .NET.

Why This Matters:

AOT offers significant performance improvements and having wasmtime-dotnet support this more seamlessly would be a huge win. It could enhance the library's usability in high-performance scenarios.

Suggested Changes:

  • Enable static linking in wasmtime-dotnet.
  • Ensure compatibility with .NET AOT binaries.

I'm happy to implement the necessary changes myself if it is something that will be accepted.

andrewmd5 avatar Jan 07 '24 19:01 andrewmd5

Hi @andrewmd5, thanks very much for the informational request!

I definitely think this would be something we would accept, but I'm not entirely sure what the work entails. Is it mostly just a different way of building the project?

peterhuene avatar Jan 12 '24 19:01 peterhuene

Hey @andrewmd5, what problems did you encounter specifically? I have an AWS Lambda function that is NativeAOT (.Net 8) and it seems to work fine with Wasmtime running a server side wasm module (so far).

alc-aardvark avatar May 23 '25 07:05 alc-aardvark

IIRC this was an upstream issue in ARM64 Windows because those native builds didn’t exist for wasmtime. I’m unsure if any progress was made there.

Edit: looks like this can be closed https://github.com/bytecodealliance/wasmtime-dotnet/issues/298

andrewmd5 avatar May 23 '25 07:05 andrewmd5