|
|
|
|
|
by adastra22
42 days ago
|
|
Rust makes you be explicit about memory management. I guarantee you if you threw everything into a box inside an Arc, your copy closures would have still worked just fine and your Haskell idiom would translate cleanly. Only now everything is heap allocated and reference counted. Before LLMs took over the reins, this was the hallmark of beginner rust code because it WOULD work, just with unnecessary allocations and copying and pointer dereferencing. Rust makes the tradeoffs explicit, and Rust programmers tend to obsess over minimizing those tradeoffs to get abstractions that are zero-cost. So doing it “the rust way” is often very complicated and tricky to get right while satisfying the borrow checker and type system, but once found is lean, fast, clean, and safe. |
|
No, boxing everything does not magically make things more dyn-compatible. It will not magically solve the issue that tokio does a whole-program transformation that does its most restrictive checking only after all local checks have been resolved. It will not magically allow more reuse between datatypes. It will solve none of the problems I encountered... because if beginner-Rust could solve any of these problems, then they would have ceased to be problems for me by the time I became intermediate.
> Rust programmers tend to obsess over minimizing those tradeoffs to get abstractions that are zero-cost. So doing it “the rust way” is often very complicated and tricky to get right while satisfying the borrow checker and type system, but once found is lean, fast, clean, and safe.
You and I must be using very different definitions of "lean." For me, "complicated" and "lean" do not go together