# linking-together

Konrad Hinsen

08/25/2023, 7:10 AM
A nice essay on programming languages, but with a message that is much more general: It's about the tension between "make better technology", "use start-of-the-art technology", and "use boring (but stable and well understood) technology". Different goals, different tools. Another example I have experienced a lot: mathematics and physics. Mathematicians work on new mathematics, mathematical physicists introduce state-of-the-art mathematics into physics, and all other physicists use 100-year-old mathematics from textbooks. And each group complains about the attitude of the two others.


08/26/2023, 4:54 AM
Some excellent quotes:
I would describe good Haskell code as “brittle”, and I mean that as a compliment. People tend to casually use “brittle” to mean “prone to breakage”, but in materials science what “brittle” means is that something breaks without bending: when a brittle material reaches the limits of its strength, it fractures instead of deforming. Haskell is a language where abstractions do not “bend” (or permit invalid programs) but rather “break” (fail to compile) in the face of problems.
And another:
I once heard it said that Haskell lets you work with functions the way Perl lets you work with strings. Lots of Haskell idioms, like monads, are perfectly expressible in other languages: Haskell just makes them feel natural, while writing a monad in many other languages feels like you have to do lots of busy-work.
I wish the critique of Haskell was as good as the love expressed for it. For my part, I just find that most attempts write Haskell programs ends up down theoretical rabbit holes. Here's a tiny, silly example. For illustration purposes, I wanted to write
take 25 (map (^2) [0..])
Copy code
  i <- [0..]
  let ii = i * i
  guard (i < 25)
  return ii
This is, of course, bad because it loops after producing the 25 squares. You keep pulling off `i`s and keep fining that they are not longer less than 25. It would be "neat" if we could replace
with some sort of
. But what sort? Could get lost for hours.

Konrad Hinsen

08/26/2023, 6:04 PM
Haskell is the formal systems lover's dream (unless they have already moved on to something more sophisticated, such as dependent types). All code defines a formal system, but Haskell programmers love to make formal systems that are about the code (types etc.) Formal systems are very precise, which is great when you can certain that they match your problem. If they don't match, or if you don't know, they are an endless source of frustration. Which means that Haskell is great language if and only if your problem has already been formlized, e.g. in mathematics.