←back to thread

517 points bkolobara | 2 comments | | HN request time: 0.002s | source
Show context
BinaryIgor ◴[] No.45042483[source]
Don't most of the benefits just come down to using a statically typed and thus compiled language? Be it Java, Go or C++; TypeScript is trickier, because it compiles to JavaScript and inherits some issues, but it's still fine.

I know that Rust provides some additional compile-time checks because of its stricter type system, but it doesn't come for free - it's harder to learn and arguably to read

replies(17): >>45042692 #>>45043045 #>>45043105 #>>45043148 #>>45043241 #>>45043589 #>>45044559 #>>45045202 #>>45045331 #>>45046496 #>>45047159 #>>45047203 #>>45047415 #>>45048640 #>>45048825 #>>45049254 #>>45050991 #
arwhatever ◴[] No.45043148[source]
I might suspect that if you are lumping all statically-typed languages into a single bucket without making particular distinction among them, then you might not have fully internalized the implications of union (aka Rust enum aka sum) typed data structures combined with exhaustive pattern matching.

I like to call it getting "union-pilled" and it's really hard to accept otherwise statically-typed languages once you become familiar.

replies(3): >>45043455 #>>45043677 #>>45044134 #
JoshTriplett ◴[] No.45043455[source]
Or the fact that Rust's type system includes things like Send and Sync, which aren't tracked and enforced in many otherwise-statically-typed languages.

C is statically typed, but its type system tracks much less.

replies(1): >>45044427 #
1. 1718627440 ◴[] No.45044427[source]
My interpretation is, that C doesn't have data types, but memory layout types.
replies(1): >>45053191 #
2. gf000 ◴[] No.45053191[source]
Arguably hardly even that, as memory layout for many in-built types are target and/or compiler-specific.