News for hackers. Stuff that matters.
Re:Use Your Type System by folkrav on Thursday July 24, 2025 @04:13PM (#44675475)
It would be weak if that was actually mutating the first “a”. That second declaration creates a new variable using the existing name “a”. Rust lets you do the same[1].

[1] https://doc.rust-lang.org/book/ch03-01-variables-and-mutabil...

Re:Use Your Type System by johnfn on Thursday July 24, 2025 @06:45PM (#44677229)
Rust lets you do the same because the static typing keeps you safe. In Rust, treating the second 'a' like a number would be an error. In ruby, it would crash.
Re:Use Your Type System by folkrav on Thursday July 24, 2025 @11:09PM (#44679161)
Let’s rephrase: is naming a variable typing? As for runtime vs. compile errors - isn’t this just a trade off of interpreted languages?