re: What Elm and Rust Teach us About the Future VIEW POST


This is a great post, and I agree that tagged unions and exhaustive 'match' really do seem to help with corner cases. And I also love the fact that both languages forbid null and require the use of an Option-like type to represent possibly-missing values.

However, I found that Rust's borrow checker was mostly a struggle very early on, but that I quickly learned to design code in ways that made the borrow checker almost invisible on a day-to-day basis. For Rust, I think it's useful to distinguish between:

  1. The initial learning curve: fairly steep. This is definitely steep, especially for people who've never worked in C or C++, or who have zero experience with any kind of functional programming. I think that most people will only climb this learning curve if they have a real incentive.
  2. The difficulty of Rust on a day-to-day basis once learned: not bad at all. After a few weeks of working in Rust, I found it to be a surprisingly comfortable language. It takes me maybe twice as long the write Rust code as Ruby code, but the Rust code is a lot faster, I trust it more, and I can refactor Rust code very aggressively without fear of breaking things.

For me, the actual big limitation with Rust is that the third-party library support for "work" stuff is almost there but has the occasional corner case. I find that I produce a steady stream of minor PRs to Rust crates whenever I try to do something tricky in production. Happily, Rust library maintainers seem to be a pretty friendly bunch and they process most of my PRs quickly.

code of conduct - report abuse