3 ms·
Monads are there in computations that we care about, regardless of the implementing programming languages (e.g., Python, C, Assembly, Turing Machines). Just tha
by one-punch 3y ago
Monads are there in computations that we care about, regardless of the implementing programming languages (e.g., Python, C, Assembly, Turing Machines). Just that Haskell is famous for considering Monads as a first class concept, while many programming languages do not name and reason about them (in Python, C, Assembly, etc.).
This is similar to structured loops and function calls (not GOTO), which are in computations that we care about, regardless of the implementing programming languages. Some languages do not name and reason about them (e.g., Assembly, Turing Machines).
While it is possible to program without raising the level of discourse, this is discouraged (considered harmful), as it lacks safety, hurts productivity (developer velocity/experience), and scales worse.
> > when you start considering effectful computation at a deep level, monads come up pretty quickly
> You say that, but they only seem to come up when dealing with haskell.
"when you start considering structured computation at a deep level, loops and function calls come up pretty quickly"
"You say that, but structured loops only seem to come up when dealing with high level languages."
This situation, where a higher level programming language delivers more power (in this case, scales with better developer velocity/experience) but a lower level programmer resists, has been observed many times. Paul Graham calls this the Blub Paradox [1].
What's so great about Lisp? And if Lisp is so great, why doesn't everyone use it?...
I'll begin with a shockingly controversial statement: programming languages vary in power.
... But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he doesn't realize he's looking up. What he sees are merely weird languages. He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub.
And using a powerful high level language is "The Secret Weapon" behind the success of Viaweb [1]. Haskell is also a secret weapon for those who know how to use it.
[1]: http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html "Beating the Averages"
- CyberDildonics 3y agoI can show you the assembly language for a loop and a function call in a dozen instructions. What is the assembly language for a monad? our hypothetical Blub programmer This is all patronizing rationalization to believe that people aren't picking someone else's favorite language because they "just aren't smart enough to get it". Programming is hard enough without constantly trying to make languages themselves a silver bullet. Fancy macros, fance meta programming, 'pure mathematics' etc. never equals productivity over the long term. Library writers can get away with it, but simplicity wins overall because people can focus on making programs and making tools surrounding the language. Lisp and Haskell were influential, but that doesn't make them good tools by modern standards. They had ideas that made it into other programming languages and that's enough. They did their jobs. Haskell has major programs with controlling order of execution because it pretends it can be abstracted away. "The Secret Weapon" behind the success of Viaweb Haskell users always talk about the same handful of programs that no one would have heard about if they weren't made in haskell. Meanwhile 90% of software that people actually use is basically made in C++, python and javascript. The languages aren't perfect, but when people sit down to program they can move past the language and actually write software.