loading...

Discussion on: Deno for JavaScript Beginners

Collapse
crabmusket profile image
Daniel Buckmaster

Unlike Node (C++), It's written in Rust, which is much faster.

Uh... leaving aside the fact that the actual JS execution is done by V8, which is a) the same as Node and b) written in C++, so really there'll be very little meaningful speed difference - I think it's highly implausible to say Rust is "much faster" than C++, and I say that as a big Rust fan.

Collapse
maximousblk profile image
Maximous Black Author

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

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