Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

[Question]: Thoughts around possibilities #21

Closed
shaggygi opened this issue Jun 21, 2022 · 4 comments
Closed

[Question]: Thoughts around possibilities #21

shaggygi opened this issue Jun 21, 2022 · 4 comments

Comments

@shaggygi
Copy link

I've been trying to read up in this space as it appears to have great potential. When it comes to C# and .NET, I'm a little confused on the type of scenarios we may get. Understanding this SDK (and standards around WASI and such) are in the early stages and things will change, but could you add somewhere in the project some docs about things to expect (both good and bad).

For example, will it be possible to write and convert small C# code (few classes) into WASM byte code or is the .NET runtime going to be required as well? What are some of the file sizes seen when building average type of app? Would it be possible to run C# code in smaller micros on bare metal like ESP32?

Thanks for any details provided while progress is made. Enjoyed your WASI sessions so far. Keep up the good work. 👍

@shaggygi
Copy link
Author

Will there eventually be ease of adding bindings/support like mentioned here...

bytecodealliance/wasm-micro-runtime#1258

@SteveSandersonMS
Copy link
Owner

In the long run, alternative .NET compilation technologies such as NativeAOT might get you towards your goal of running tiny snippets of .NET on embedded devices.

The code in this repo is based on the Mono runtime (which is well tested for use on WebAssembly), which does bring in a .NET runtime. I'm not sure which kinds of microcontrollers can run wasm modules in the few-megabytes size range, but those ones should be able to run it.

Will there eventually be ease of adding bindings/support like mentioned here...

In that thread they are talking about embedding WAMR inside Go/C. The equivalent would be embedding WAMR inside .NET. And something very much like that is already possible: the wasmtime NuGet package embeds wasmtime in .NET.

@shaggygi
Copy link
Author

In that thread they are talking about embedding WAMR inside Go/C. The equivalent would be embedding WAMR inside .NET. And something very much like that is already possible: the wasmtime NuGet package embeds wasmtime in .NET.

I was asking more about device bindings we have over in dotnet/iot where we can access hardware like I2C/SPI/GPIO. Rich Lander mentioned on another thread (couldn't find it) that it seems it would be possible where new classes could be added specific for WASM (GpioWasmController, etc.).

Thanks again.

@SteveSandersonMS
Copy link
Owner

In that case, I think #30 is what you'd want to get from .NET code to arbirary wasm imports/exports, and then it's up to your wasm host to map those imports/exports to whatever native functionality it wants (e.g., GPIO).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants