The unexpected productivity boost of Rust

80 points by matklad


matklad

Four completely unrelated thoughts:

reissbaker

I do like strongly-typed languages, and Rust can be… useful, if sometimes a bit unpleasant for non-low-level work. But I don’t think the comparison against TypeScript was particularly valid there; Rust’s typechecker wouldn’t have caught the logic bug either, since it wasn’t related to memory safety. The bug was that they thought assigning to window.href would cause the function to exit; in fact, it didn’t. But Rust wouldn’t tell you that either! The subsequent code was valid from a safety perspective… It was just undesired behavior. No unsafe code = no complaints from the borrow checker.

There are definitely footguns in TypeScript’s type system — by design it’s unsound — but it’s pretty good compared to most languages, and the borrow checker isn’t superior to it except from a performance standpoint: the borrow checker prevents memory-unsafe behavior, and TypeScript also prevents that (by using a garbage collector). The rest of Rust’s type system is in some ways superior to TS (although TS has some ergonomic tricks that make it nice in its own way, e.g. mapped and conditional types), but from a borrow-checker standpoint, I’d usually prefer a GC unless I need the perf gains. My dream productivity-focused language probably looks a lot like “Rust with a garbage collector.”

I definitely prefer either to the bad old days of big Rails monorepos, though.