WebAssembly Rust Advantage besides size - compared to GC Languages

@OptimisticPeach, Yes, I think this answered by question.

WebAssembly binary code for GC languages will have GC included for that language since that is usual for the language to run with GC.
By itself, WebAssembly does not have a GC as we know. Even if WebAssembly later has GC or the language includes the GC, I think Rust that will run without GC will perform better and will not use it.

Also, Well explained by @Pauan in the answer below.

@kornel Agreed.

@anlumo So now in terms of performance in webAssembly, this comes down to Rust vs Other GC languages even without WebAssembly. I think we know advantages of JIT, but in general with Java experience, I think Rust approach without GC will outperform ones with GC. There might be some use cases in GC reaching similar results but still I am biased towards not having GC and rely on Rust memory safety ownership compilation rules. I think that is one of the main reasons Rust exists.

@H2CO3 My question was more advantages of Rust besides size and I see we also have a better runtime since it is without GC. Agree about the correctness but I want both the worlds :wink: at the expense of following though a more strict compilation process.

Thanks to everyone else for the answers.

Overall without GC (resulting in better performance in general), smaller size this explains why Rust (along with C++ I guess to some extent) is leading the path to WebAssembly.:man_dancing:

2 Likes