How has learning and working in Rust influenced how you think about writing software?

  • Rust has forced me to think more about data flow in applications. The borrow checker wants application data to be tree-shaped, so I need to think twice whether the problem really requires more complicated architecture, or am I just making things tangled for no reason.

  • Rust gave me vocabulary for things that exist in informally in other languages. For example, Send and Sync exist in all languages with shared memory, but other languages tend to just call functions (not types!) "(not) thread-safe" with more ad-hoc explanation of caveats and exceptions. Things that are programming patterns in C are types in Rust.

  • I did not expect that giving a separate type to memory returned from malloc (Box) would make sense. To me memory was just memory, and I would require it to be interchangeable with other pointer types. But now I see Rust's "static ownership" as an aspect of static typing, and other languages without this distinction feel "dynamically owned (typed)" in comparison.

  • Rust has proven to me that multi-threaded programming can be practical. I've got so many scars from trying that in C that I was starting to doubt whether that would ever work.

  • Rust has enforced my belief that dependencies can be helpful and easy to use. JS/npm was to me the first that changed my mind from "dependencies are a pain and a liability" to "are easy and useful", but in JS abstractions still have a cost. With zero-cost abstractions I have no excuse.

  • I don't want to write makefile/automake/cmake/bazel/mason build script ever again. In C I've spent so much time on maintaining my artisanal snowflake build, fighting with other people's preciously crafted snowflake builds. Cargo shows this is all useless busywork that doesn't need to exist.

30 Likes