2 ms·
Why Rust? Haskell is gold standard here.
by vbezhenar 11mo ago
Why Rust? Haskell is gold standard here.
- gkfasdfasdf 11mo agoCan you elaborate? What is it about Haskell that makes it better?
- vbezhenar 11mo agoVery advanced type system which allows to move a lot of program correctness to typing system. So basically if your program compiles, it probably works. It's also has GC which makes it better suited for most programs, compared to Rust with its manual memory management.
- ModernMech 11mo agoRust does not have manual memory management, and its type system also has the property that if your program compiles it probably works, IME.
- atilaneves 11mo agoI hear this about both Haskell and Rust, and yet, when I tried both in the former I wrote a useless program because I didn't handle state (and yet passed all tests!) while in the latter I immediately wrote a deadlock. So...yeah.
- tome 11mo agoHow did your tests pass if you didn't handle state?
- atilaneves 11mo agoBecause it is also possible to write tests that don't adequately capture real-life requirements. It was an MQTT server, and the tests basically went "if we have these subscriptions, then...", but no subscriptions ever got actually stored by the server.
- ModernMech 11mo agoIt is still possible to write bugs in both Haskell and Rust.
- atilaneves 11mo agoYes, that's my point. I'm replying to claims that "if it compiles it probably works". My limited experience with both is "nah".
- tome 11mo agoI prefer the slogan without "probably", "If it compiles it works", because then at least it's clear it's a slogan and not a formal claim. Everyone knows that if you write multiply x y = x + y then it will compile but not work, so they don't take it literally. But it is a pithy statement of the lived experience of many users of strongly typed programming, which is more accurately described by something like "if it compiles then it will probably do something at least basically sensible and often be pretty close to what you actually wanted".
- throw-qqqqq 11mo agoPurely functional code is easier to test because of its referential transparency and lack of shared state. Haskell is also nice because of quickcheck.
- IshKebab 11mo agoI would think Lean and other formal languages are the real gold standard. But none of them really have enough training data for LLMs to be any good at them.
- stared 11mo agoI guess there is a reason why Linux kernel accepts Rust not Haskell.
- przemub 11mo agoThere isn’t enough code and resources to <s>steal</s> learn from. And I mean not only the language but the paradigm.