News for hackers. Stuff that matters.
Re:Thoughts on Go vs. Rust vs. Zig by masklinn on Friday December 05, 2025 @12:38AM (#46157152)
That is correct. Kinda. Refcell can not work because Rust considers globals to be shared by multiple threads so requires thread safety.

And that’s where a number of people blow a gasket.

Re:Thoughts on Go vs. Rust vs. Zig by masklinn on Friday December 05, 2025 @04:53AM (#46159167)
A second component is that statics require const initializers, so for most of rust’s history if you wanted a non-trivial global it was either a lot of faffing about or using third party packages (lazy_static, once_cell).

Since 1.80 the vast majority of uses are a LazyLock away.