microsoft / dotnet

This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.
https://devblogs.microsoft.com/dotnet/
MIT License
14.31k stars 2.21k forks source link

about C# aot to wasm discuss #1363

Open nczsl opened 1 year ago

nczsl commented 1 year ago

Let C # can be compiled into pure wasm code through aot without runtime and without any web ui library Because wasm does not need to operate the web ui and dom, it should be handed over to the js side. I hope C # can be directly and freely converted to wasm code through aot. As a condition, restrictions can be accepted, including specific context, or sacrificing some functions of C #. If this can be done, then it is possible to make the wasm code generated by C # compilation and the wasm code generated by rust have the same performance and running speed. I think this is a more important and valuable thing. However, the current blazor carries too many things and goals, which has made the generated wasm cumbersome, obviously against the original design intention of wasm. So please create a direct and free scheme to convert C # into pure wasm code after aot!

charlesroddie commented 1 year ago

The current blazor approach (partial aot only via monovm) is very unfortunate. In runtimelab there is a NativeAOT WASM project which is early stage but more likely to be a viable solution for deploying pure WASM apps.