SteveSandersonMS / dotnet-wasi-sdk

Packages for building .NET projects as standalone WASI-compliant modules
519 stars 36 forks source link

Question: would it be possible to export a C# method as a WASM function #46

Open fbouteruche opened 2 years ago

fbouteruche commented 2 years ago

Hi Steve,

I was wondering if it would be possible to have an attribute to mark a C# method and an associated WASM function would be exported from the WASM module.

It would allow to know which function you can call when you load the module.

Regards, François.

JohnGalt1717 commented 2 years ago

and how can C# code call a WASM function?

ChristianWeyer commented 1 year ago

and how can C# code call a WASM function?

You can achieve this with wasmtime: https://github.com/bytecodealliance/wasmtime-dotnet

ChristianWeyer commented 1 year ago

Hi Steve,

I was wondering if it would be possible to have an attribute to mark a C# method and an associated WASM function would be exported from the WASM module.

It would allow to know which function you can call when you load the module.

Regards, François.

See https://github.com/SteveSandersonMS/dotnet-wasi-sdk/issues/30