Re:JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
by maxxxxx on Wednesday April 04, 2018 @09:45PM
(#16761083)
A previous poster states that a "hello world" in Rust is 100 byte. Is that Rust compiled to machine or webasm? Simple C# compiled to an exe is bigger but by not much. But you need a big runtime. Now if you compiled C# to webasm you potentially wouldn't need the .NET runtime so the result should be quite similar to the Rust code. In addition if you modified the C# compiler to have a real linker that only includes code from the runtime that's actually used I would think the output size shouldn't grow much.
[ Parent
| on HN ]
Re:JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
by steveklabnik on Thursday April 05, 2018 @07:22AM
(#16763750)
That's Rust compiled to WebAssembly.
> Now if you compiled C# to webasm you potentially wouldn't need the .NET runtime
Why not? How does C# work without the runtime? As the docs for .NET Native say:
> You can continue to take advantage of the resources provided by the .NET Framework, including its class library, automatic memory management and garbage collection, and exception handling.
So you still have that runtime code in your binary, even if it's not JITted.