tl;dr - Try rust.<p>The mechanic point of this article is pretty clear:<p>- it's possible to be unsafe in both Haskell and Rust when dealing with resource cleanup<p>- Rust does a bit of a better job in the general case though it has it's own warts (see the other comments, it's hard to deal with issues during `drop`-triggered cleanup)<p>I want to make a muddier meta point -- Rust is the best systems language to date (does anyone know a better one I can look at?).<p>- The person who wrote this article Michael Snoyman[0] is mainly a haskell developer, he's the lead developer behind arguably the most popular web framework, yesod[1].<p>- Haskell developers generally have a higher standard for type systems, and spend a lot of time (whether they should or not) thinking about correctness due to the pro-activity of the compiler.<p>- These are the kind of people you <i>want</i> trying to use/enjoy your language, if only because they will create/disseminate patterns/insight that make programming safer and easier for everyone down the line -- research languages (Haskell is actually probably tied for the least "researchy" these days in the ML camp) are the Mercedes Benz's of the programming world -- the safety features trickle down from there.<p>- Rust is <i>not</i> a ML family language -- it's a systems language<p>- People who write Haskell on a daily basis are finding their way to rust, because it has a pretty great type system<p>When was the last time you saw a systems language with a type system so good that people who are into type systems were working with it? When was the last time you saw a systems language that scaled comfortably and gracefully from embedded systems to web services? When have you last seen a systems language with such a helpful, vibrant, excited community (TBH I don't think this <i>can</i> last), backed by an organization with values Mozilla's?<p>You owe it to yourself to check it out. As far as I see it rust has two main problems:<p>- Learning curve for one of it's main features (ownership/borrowing)<p>- Readability/Ergonomics (sigils, etc can make rust hard to read)<p>Admittedly, I never gave D[2] a proper shake, and I've heard it's good, but the safety and the emphasis on zero-cost abstractions Rust offers me makes it a non-starter. Rust is smart so I can be dumb. C++ had it's chance and it just has too much cruft for not enough upside -- there's so much struggle required to modernize, to make decisions that rust has had from the beginning (because it's so new). It might be the more stable choice for a x hundred people big corporate project today or next month, but I can't imagine a future where Rust isn't the premier backend/systems language for performance critical (and even those that are not critical) programs in the next ~5 years.<p>I'll go even one step further and say that I think that how much rust forces you to think about ownership/borrowing and how memory is shared around your application is <i>important</i>. Just as Haskell might force you to think about types more closely/methodically (and you're often better for it), Rust's brand of pain seems instructive.<p>[0]: <a href="https://www.snoyman.com/" rel="nofollow">https://www.snoyman.com/</a><p>[1]: <a href="https://www.yesodweb.com/" rel="nofollow">https://www.yesodweb.com/</a><p>[2]: <a href="https://dlang.org/" rel="nofollow">https://dlang.org/</a>