Menu
Sign In Search Podcasts Libraries Charts People & Topics Add Podcast API Blog Pricing
Podcast Image

The Peterman Pod

Co-Creator of Haskell: Functional Programming, Thinking in Types, Useless Languages | Simon Jones

08 Jun 2026

Transcription

Transcript generated automatically by AI and may contain errors.

Chapter 1: What is functional programming and why does it matter?

0.031 - 18.867 Simon Peyton Jones

Why is the internet so insecure? Primarily because all of our software infrastructure is written in unsafe languages. This is Simon Peyton Jones, co-creator of the functional programming language Haskell, and I asked him all about programming language design. If we rewrote all of our software infrastructure in Rust, things would be way, way better.

0

18.847 - 30.284 Simon Peyton Jones

I think that statically typed languages are a huge boon for LLMs. I do large-scale systematic refactorings fearlessly because the type system keeps me safe, in fact.

0

31.146 - 41.361 Ryan Peterman

Would you recommend people learn how to program today? I think people would like to be worried in the sense that I think there's going to be considerable dislocation. Here's the full episode.

0

Chapter 2: What are the downsides of functional programming?

45.813 - 56.715 Ryan Peterman

I wanted to start by asking you, what is functional programming in your words, and why does it matter to people who might use the other languages, the imperative languages?

0

Chapter 3: How does specialized hardware benefit functional programming?

57.377 - 81.511 Simon Peyton Jones

Functional programming is about programming with values instead of mutation. So in a conventional imperative programming, computation proceeds by, like if I want to add up the numbers between 1 and 100, I have a mutable cell containing a running total. And then as computation proceeds, I keep adding to my running total. So there's a cell that changes its value over time.

0

82.211 - 96.79 Simon Peyton Jones

Computation proceeds step by step. There's a program counter. Now, that's very unlike mathematics. If I say 3 plus 4 times 7, you don't think of a mutable cell that changes its value over time. You think, well, 3 plus 4 is 7. 7 times 7 is 49. Just the answer is 49.

0

Chapter 4: Why does Simon Peyton Jones consider Haskell 'useless'?

97.631 - 122.927 Simon Peyton Jones

So in a sense, it's more declarative than imperative. Another way to think of it is it's more like what a spreadsheet does. In a spreadsheet formula, if you put in a cell, you'd say in A1, you put the formula equals A2 times A3 plus 7. Well, then, that's just a formula that is evaluated, and you expect to compute the values of a2 and a3 automatically before computing a1.

0

Chapter 5: How do Rust and C compare in terms of safety and usability?

122.947 - 133.201 Simon Peyton Jones

It wouldn't make any sense to compute a1 from the old values of a2 and a3. And there's no notion of a program counter. There's no notion of do this and then do that.

0

Chapter 6: What are the differences between Haskell and OCaml?

133.982 - 149.037 Simon Peyton Jones

It wouldn't be sensible to say equals print x plus 3. because who knows when or even whether that cell, that formula, will ever be evaluated. Now, the surprise is that it is possible to do useful things in such a limited language.

0

149.658 - 168.003 Simon Peyton Jones

When I learned programming, I learned it by writing machine code, in which the fundamental mode of computation is registers and program counters, and mutation of registers as you go along, and memory. Computation and mutation seem to be... inextricably interwoven. That's how computation gets done.

0

168.905 - 195.481 Simon Peyton Jones

So it was a surprise to me when I learned that, well, it is possible to do useful things with functional programs. I still remember that amazing revelation. Now, in fact, one way to look at it is this. Right back in the late 1920s, early 1930s, Alan Turing was doing a PhD in Princeton under the supervision of Alonzo Church.

0

196.704 - 216.864 Simon Peyton Jones

Now, Alan Turing, as we all know, invented the Turing machine, which is fundamentally about mutation. It has a little tape, and you can read things from the tape, and then you write back new things onto the tape, and it has an immutable program. Now, Alonzo Church, at the very same time, was working on something he called the lambda calculus, in which there's no motion of mutation.

0

216.924 - 237.904 Simon Peyton Jones

The lambda calculus is like the essence of functional programming. Programs execute just by reduction. Now, so these were two different models of computation. You might ask, what can you compute with a Turing machine, and what can you compute with a lambda term? And the astonishing thing that turned out, which is completely non-obvious,

238.323 - 260.038 Simon Peyton Jones

is that anything you compute with a lambda term, you can compute with a Turing machine, and anything you compute with a Turing machine, you can compute with lambda calculus. So that means that the two are identical from the point of view of their computational power. Big surprise to me. Okay, so they're equally powerful. And then the question is, which might you want to choose?

260.639 - 272.515 Simon Peyton Jones

As I say, I started life from my baseline of imperative programming. Of course, that's the way you write programs. And functional programming is a kind of weird, anomalous, rather nerdy academic thing.

274.3 - 288.193 Simon Peyton Jones

I became hooked on the idea that by excluding side effects by default, that is, imperative programming has side effects by default, by excluding side effects by default, we could make programs that are easier to write, easier to maintain, easier to reason about.

Chapter 7: How does the Haskell compiler work?

288.955 - 313.127 Simon Peyton Jones

And then the question is, What are the practical obstacles? Is it slower? Is it less convenient? And so forth. So in effect, I've devoted my research life to exploring that hypothesis. The wonderful thing about being a researcher is you can take something which at the time, this is back in 1980. Back in 1980, functional program was very nerdy, geeky, academic.

0

Chapter 8: What advice does Simon have for aspiring programmers today?

313.988 - 327.464 Simon Peyton Jones

But I was allowed to spend my professional life just saying, what would happen if you took that one idea, programming with values, and just ran with it, where would you get? And I think we've got somebody somewhere pretty interesting.

0

327.864 - 344.065 Simon Peyton Jones

I don't want to say that it's better fundamentally because after all Haskell on that journey started with functional programming, then we learned how to mix functional imperative programming together in a way that we might talk about later, right? So it's not really an either or, it's more of a both and in the end.

0

344.602 - 366.855 Simon Peyton Jones

But my position now is, as I often say, when the limestone of imperative programming is worn away, the granite of functional programming will be revealed underneath. And why do you say that? Well, functional programming is the language of mathematics. That's how we fundamentally think about things when we want to be formal.

0

367.015 - 381.578 Simon Peyton Jones

Indeed, if we want to reason about and say, what does this imperative program do? We have to wheel out a lot of mathematics and, you know, whole triples and so forth. But that's all in the world of maths, which is just functional programming. Functional programming is just mathematics brought to life and made executable.

0

382.874 - 409.219 Simon Peyton Jones

So you might wonder, I suppose, you may be saying, well, isn't imperative programming just enough? And I think that there you have to look at the broad sweep of things. I think what's happened is that from the world of functional programming, lots of ideas have got adopted into the imperative arena. So they grew up over here in functional programming.

409.992 - 425.53 Simon Peyton Jones

and then they have been adopted by the imperative programming thing. So you might think garbage collection, you might think lambdas, you might think language integrated query, you might think about lots about type systems, polymorphism and static typing, tons of that.

425.931 - 443.711 Simon Peyton Jones

So at least it has been an intellectually interesting experiment that has been a very fertile laboratory which to grow up ideas that can infect the mainstream. My instinct now is that we should start from functional programming and do imperative programming where necessary.

444.412 - 464.828 Simon Peyton Jones

I think probably the mainstream is we should start with imperative programming and sort of add bits of functional programming where possible. And I'm not going to say that they're wrong to do that, just to say that I think there's a pretty interesting dialogue. Now, you do have to think very differently about the act of programming. You do have to rewire your brain quite a bit.

465.789 - 483.334 Simon Peyton Jones

But just let me, this is something we might want to come back to. I said easier to maintain. As programs get old, think of a 10-year-old program. If you have a piece of 10-year-old code written by somebody who's long since left your company that mutates some more or less global variables,

Comments

There are no comments yet.

Please log in to write the first comment.