DEV Community

Discussion on: Deno for JavaScript Beginners

Collapse
 
maximousblk profile image
Maximous Black • Edited

Agreed and fixed.

From what I have learned so far, Rust is more secure and throws error in compile time unlike C++ which does so in the runtime. This results in developers writing less explicit checks and achieving the same results.

It takes time to perform a check and also increases the binary size when compiled. Rust eliminates such cases while compiling so you don't have to perform any checks at runtime. The speed that comes from reduced runtime checks is what I was talking about, not the raw performance.

Please correct me if this is wrong.

Collapse
 
solarliner profile image
🇨🇵️ Nathan Graule • Edited

Rust still performs runtime checking - (vec![0, 1, 2])[3] will throw an error at runtime (even in release mode!), so it doesn't remove all checks. Rust's claim to fame is memory correctness; if the code compiles, the executable is free of memory and concurrency bugs without any garbage collection, however there is still a runtime to Rust (like C and C++).

You don't choose Rust because it's fast. You choose Rust because you want to get as close to the "if it compiles, it works" utopia. Which is paramount for critical software like Deno.

Some comments have been hidden by the post's author - find out more