5 ms·
This is super exciting for me, as a C# developer. I'm fed up of needing (to learn how) to compile C++ projects for each platform so that I can reference them fr
by indentit 7y ago
This is super exciting for me, as a C# developer. I'm fed up of needing (to learn how) to compile C++ projects for each platform so that I can reference them from .NET Core. The idea of just compiling them once for WebAssembly/WASI and only needing to ship one copy of each binary dependency is quite freeing and makes cross plat functionality easier.
- fxfan 7y agoYou're in luck- MS released a WASM GUI kit- Blazor
- nicoburns 7y agoI think this is about c++-in-wasm-in-C# rather than c#-in-wasm. It's an (arguably) better way of doing FFI without having to worry about compiling the C++ dependency.
- arethuza 7y agoPresumably you have to compile the C++ once to wasm though?
- tybit 7y agoYeah you would, though having a common compile to target would hopefully make it easier to find pre compiled wasm binaries.
- WorldMaker 7y agoRight, some libraries are already getting official and semi-official wasm targets for the Node JS ecosystem. It would be interesting to "borrow" an existing wasm binary from npm and simply rehost it on the .NET CLR or JVM.
- tracker1 7y agoAbsolutely... I have a suspicion that Node may actually expand its' presence as a defacto runtime for wasm outside the browser.
- tracker1 7y agoNot to mention, cross platform (think x86, arm AND linux, mac, windows) from a single compile target.
- pjc50 7y agoYou can compile C++ directly to MSIL if you want...
- indentit 7y agoOoh, instructions as to how would be super, please :)
- indentit 7y agois it somehow related to "mixed mode assemblies"[1]? [1]: https://github.com/dotnet/coreclr/issues/18013 https://github.com/dotnet/coreclr/issues/18013
- pjc50 7y agoVisual studio compiler option "/clr": https://www.visualcplusdotnet.com/visualcplusdotnet1.html https://www.visualcplusdotnet.com/visualcplusdotnet1.html There's a bunch of language extensions which let you access C# heap, string types etc from C++. You may want to define a "shim" layer to do the translation, but the bulk of your existing C++ can just compile straight across.