3 ms·
> Does 'the language prevents errors at compile time' really mean 'better function signatures in the standard library'? No, it means there's memory safety and
by vertex-four 12y ago
> Does 'the language prevents errors at compile time' really mean 'better function signatures in the standard library'?
No, it means there's memory safety and a strong type system. Unless you specifically and explicitly break that, the language prevents you from doing things like accessing undefined memory or returning nulls where you haven't explicitly said you can return nulls, and the strong type system allows libraries to prevent you from accessing closed resources.
People say Haskell prevents lots of classes of errors at compile time, and yet even that has escape hatches. panic!() shouldn't be a part of idiomatic Rust code, it's primarily for use during initialisation, small scripts, and the odd place where an application design would be a pain to deal with if it had to deal with a one-in-a-million chance that something particularly odd happens, and the application can't continue if it does.