Join Nostr
2024-09-29 03:44:38 UTC

Grégoire Locqueville on Nostr: I know it's totally subjective and I'm completely biased in favor of the latter, but ...

I know it's totally subjective and I'm completely biased in favor of the latter, but #Rust feels so much "bigger" than #Haskell

Sure, depending on your background Haskell might be very hard to grasp*, and GHC is huge and complicated, and a lot of Haskell code hurts the brain, but in terms of core concepts and syntax, I actually feel it's pretty straightforward :
- Basic function application is as simple as can be. The one complication is infix operators/functions and precedence rules
- Pattern matching is immediately understandable
- At the type level, you need to know about algebraic data types and record types
- And then there's a sugar layer on top of that, with a couple of constructs that you need to know: string literals, if-then-else, do notation... only the latter of which may be confusing.
I feel like the rest is either building on that, or not essential to the language?

Whereas in Rust you have to grasp:
- Most of that too (functions, some operators, algebraic data types, records, pattern matching)
- Plus general imperative control flow structures
- Plus low-level stuff like pointers and references
- And then Rust's own innovations (everything related to borrowing)
- ... and some confusing, ad hoc sugar too; see https://cheats.rs/#language-sugar

*Not getting into the debate of whether one of Haskell or <insert your favorite imperative language here> is easier to learn as a first programming language here