AIFeed

Not Slop: Haskell in the Age of AI

Original text(via HN AI)

At my talk at the London Haskell Meetup last week, I speculated that the good properties of Haskell that Edsko outlines, especially

  • Expressive static types
  • Rich runtime support

might make Hakell into a more productive medium for LLMs. Just possibly, an LLM might be able to write and maintain an application in Haskell faster and more cheaply, and produce code that is more reliable and more secure, than doing so in other languages. Call this the Haskell LLM Productivity Conjecture.

It’s a plausible claim. After all, Haskell makes it possible to get a lot done with a few tokens; its type system supports fearless refactoring by humans and hence a fortiori by LLMs; and there are just fewer ways to write broken programs.

I had another theory, that the absence of training data would make LLMs bad at writing Haskell. But my theory was wrong. Nowadays I’m getting an LLM to review all my GHC patches these days, and it is astonishing good at identifying flaws in my code; it’s quite a humbling experience When I get it to write code (typically small changes to a very large code base, which I audit forensically) it is spookily good. Maybe when you have a great language, you don’t need so much training!

Plausible it may be, but the Haskell LLM Productivity Conjecture is just that, a conjecture. I’d love to have evidence. Maybe some readers of the Haskell Discourse can try some experiments? Get an LLM to write application A first in Haskell and then in C or Python or Rust, and see how it goes. Then get another LLM to refactor or modify these programs, to meet a new requirement, and see how that goes. And so on.

A teaspoon of data is worth a bucketful of speculation

if we are not certain[the code is correct], can we really in good conscience ship such code to customers? [quoting Edsko]

There’s plenty of examples of unaided human-written code being incorrect, and adversely affecting customers. I think that to focus on the code-cutting abilities (alleged) of AI is to understate the importance of the full development lifecycle: requirements gathering, design/specification, testing through multiple levels.

Similarly, ‘solving’ the Riemann Hypothesis needed very close supervision by a human, feeding in all the prior work by humans; and inspecting whether the Lean verification correctly translated the proof. And we’re still awaiting (human) peer review.

If the AI hype leads to deskilling/making redundant the programmers from who AI originally stole its training data, the end-to-end process loses another ‘gate’ in verification. Where does the responsibility lie if (say) a driverless car kills someone?

You mean unsupervised?

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by HN AI
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗