Hacker News new | ask | show | jobs
by JoshTriplett 3973 days ago
Rust is a larger language than C, though far smaller than C++. More importantly, with Rust you should expect to spend more of your time convincing the compiler that you've written correct code, which requires a reasonable understanding of Rust semantics. (The compiler makes that fairly easy, but it can still be a bit of a shock when you're staring at code that seems obviously correct to you but the compiler has no way to know that.)

On the other hand, once you do convince the compiler, you have an excellent chance that the code actually is correct, and you'll spend far less time chasing down crazy runtime bugs.

1 comments

> On the other hand, once you do convince the compiler, you have an excellent chance that the code actually is correct, and you'll spend far less time chasing down crazy runtime bugs.

That's what I love about Haskell as well. Know of any other languages like this?

I used to feel more strongly that way about Haskell. I still do about most types of errors, but I spent a long time debugging serious performance issues caused by unbounded laziness and insufficient strictness.

In general, I'm a big fan of static typing. I don't know any other language that manages to provide as much static memory safety as Rust, though; that's the main innovation in Rust.

The difficulty of reasoning about strictness and memory consumption in Haskell is by far its biggest flaw. This is why I stopped writing Haskell: even if you understand your own code perfectly, you can't tell how well-behaved it will be without reading your dependencies and all their dependencies.

And yet strictness typing seems to be on nobody's plan for future Haskell extensions.