Excel is the Most Functional of Programming Languages w/ Simon Peyton Jones

Rob Collie

Founder and CEO Connect with Rob on LinkedIn

Justin Mannhardt

Chief Customer Officer Connect with Justin on LinkedIn

Excel is the Most Functional of Programming Languages w/ Simon Peyton Jones

Simon Peyton Jones – Epic Games

On today’s episode, we sit down with educator, researcher, and all-around information guru Simon Peyton Jones to learn all about programming languages and their impact on hardware, software, and research/development. Simon also brings some professional insight into Excel as a programing language. Oddly enough, around the time Rob met Simon, Rob began to think of Excel as a programming language. In order to be a language, the formulas have to deal with both space and time, so Excel formula language absolutely fits the bill. Just be careful how you code. On older systems, if you perform a VLOOKUP at the same time as a nested IF, it might disrupt the space-time continuum and bring about the blue screen of death!

As an engineering fellow at Epic Games, a researcher for Microsoft Research Cambridge, and a professor at Glasgow University, Simon also brings a unique perspective on changing the educational system to include base learning on computer science as part of general education. Not only did Simon step up and suggest change, but he also followed through and created a coalition to guide the program and ensure future expansion as needed. When Simon talks about research, people listen!

As always, if you enjoyed this episode, be sure to leave us a review on your favorite podcast platform to help others find the Raw Data by P3 Adaptive Podcast.

Also in this episode:

Simon Peyton Jones’s bookmarks!

Alonzo Church – Lambda Calculus

Touring machine

Automata Theory

LAMBDA: The Ultimate Excel worksheet function. (Andy Gordon, Simon Peyton Jones)

LISP functional language

Microsoft Research – Cambridge

Arthur Norman – functional programming

John Backus Turing Award

Setting up for Success w/David McKinnis

Declarative Programing

Immutability Changes Everything

Computing at School – CAS

Scratch – Computer Programming

Logo – Apple

Estimating the value of Pi using Monte Carlo

Tesla One-Way Valve

Turing Tumble

Robo Rally Board Game

Unreal Engine

Joe Duffy on Transactional Memory

Haskell Language

Episode Transcript

Rob Collie (00:00:00): Hello, friends. Today's intro is coming to you from middle of nowhere I-70 in Ohio due to unforeseen circumstances. Don't worry though, the podcast itself was recorded on the usual high quality microphones.

Rob Collie (00:00:15): Today's guest is Simon Peyton Jones. He's an academic researcher in computer science, studying programming languages.

Rob Collie (00:00:22): In particular, he studies functional programming languages, AKA things like the Excel formula language. And I think working with Simon back in the day at Microsoft is when I first learned and really started to think of Excel formulas as a programming language.

Rob Collie (00:00:41): One of the coolest things about Simon is that he is an academic researcher, and so you think of that as being from the ivory tower.

Rob Collie (00:00:52): Over the course of my life, I've come to regard the ivory tower with disdain, but Simon does it right. Simon is just entirely too real world practical to fall prey to the things that I find off about academia.

Rob Collie (00:01:11): And he didn't even come up through the PhD ranks. So he is continuing that trend of guests on this show with their accidental careers.

Rob Collie (00:01:22): Most people don't accidentally get into academics. Most people don't accidentally become a researcher. Anyway, we talked about a lot of things.

Rob Collie (00:01:31): He's a really, really, really dynamic and interesting person. He's now working for a big video games company on a new programming language, which is just hard to wrap your head around until you hear more about the details. Had a lot of fun. It was great catching up with him. So let's get into it.

Announcer (00:01:50): Ladies and gentlemen, may I have your attention, please?

Announcer (00:01:55): This is the Raw Data by P3 Adaptive Podcast with your host Rob Collie and your cohost Thomas LaRock. Find out what the experts at P3 Adaptive can do for your business. Just go to P3adaptive.com. Raw Data by P3 Adaptive is data with the Human Element.

Rob Collie (00:02:20): Welcome to the show, Simon Peyton Jones. I'd like to say it's been a long time, but we did chat briefly before this.

Simon Peyton Jones (00:02:26): But it's been a long time since we actually worked together when we were at Microsoft, isn't it?

Rob Collie (00:02:30): That is definitely true. So yeah, that's how we met. I was working on the Excel team and suddenly one day in the hallways there's this researcher from the UK who's incredibly enthusiastic about everything we're doing on Excel.

Rob Collie (00:02:42): Even in a weird way more enthusiastic about it at the time than I think we were. Let's start there. How did you come to interacting with the Excel team back in the early 2000s when we met?

Simon Peyton Jones (00:02:55): Oh, that was pretty simple because I had started to work at Microsoft Research. I joined Microsoft Research in about 1998, but by then I'd already spent a long time studying functional programming languages.

Simon Peyton Jones (00:03:05): So I see functional languages as a radical and elegant attack on the entire enterprise of programming, and I'd like to see more programming languages become more functional over time, and that has actually been happening in the world at large.

Simon Peyton Jones (00:03:19): But on joining Microsoft, I was thinking, "Oh, what is a functional programmer to do in a company that's dominated by C plus plus programmers?"

Rob Collie (00:03:28): Yeah, yeah, yeah.

Simon Peyton Jones (00:03:29): So I thought, "Oh, well, Excel is a functional programming language. That is the place where we should work." So when I figured this out, I thought, "What I've got to do is to go and visit the Excel folks and talk to them about functional programming. As we'll probably discuss, it's a pretty weak functional language, but I think we could make it a better one."

Simon Peyton Jones (00:03:47): And so I started to pay visits to you and your colleagues in the Excel team in Redmond, which is the opportunity that I suddenly had. I never had that opportunity before I worked for Microsoft, but once I was within the belly of the beast as it will.

Rob Collie (00:03:58): So you didn't require an invitation. You're just like, "Hey, Excel."

Simon Peyton Jones (00:04:02): Oh, I just showed up. That's right.

Rob Collie (00:04:06): That's so cool. Okay, so I don't think this is coincidence that around the same time as I met you was about the same time that I started to think of Excel as a programming language.

Simon Peyton Jones (00:04:17): Oh, you'd already had that thought?

Rob Collie (00:04:20): I don't think so. I don't think it's a coincidence. I think it had something to do, even if you hadn't shown up in my office yet, there was something about your orbit getting closer and closer to your reputation preceded you.

Rob Collie (00:04:30): This idea started to come to me through like Dave Gainer and Charlie Ellis, who I think had been maybe interacting with you a little bit ahead me meeting you.

Simon Peyton Jones (00:04:39): That's true.

Rob Collie (00:04:40): Boy, it really turned my whole perception of the tool on its head. I was used to the idea that Excel was the language of business and businesses run on Excel.

Rob Collie (00:04:50): I knew all of that, but thinking of it as a relatively approachable and accessible programming language had not occurred to me until around that time that you and I met, and it really did revolutionize it.

Rob Collie (00:05:03): So just to be a 100% clear, what is a functional programming language?

Simon Peyton Jones (00:05:07): Well, a programming language is a way to explain to a computer what you want it to do. And most conventional imperative programming languages, that is normal mainstream languages, they have a step by step flavor.

Simon Peyton Jones (00:05:19): They say, "First you do this, put zero in X and then add one to X and then square X and then add it to Y." There's a sequence, there's a program counter which moves through and that's simple. It's very intuitive, it's very operational.

Simon Peyton Jones (00:05:32): But that's not what happens in Excel at all, is it? So you don't say, "Here's this location then I'm going to add one to it."

Simon Peyton Jones (00:05:39): You simply say, "Cell A1 contains 79 and cell A2 is cell A1 plus three." So A2 contains 79 plus three, which is 82. So cells have a single value and they are connected through formulae to the values of other cells.

Simon Peyton Jones (00:05:56): So any particular cell doesn't change its value over time. If you need something, you want to do something which you want to make successive changes, you tend to lay that out in space, right? In the table of values or a column of values.

Simon Peyton Jones (00:06:07): So in effect, in Excel, the computation is laid out in space rather than being laid out in time. One thing we learn from this is that functional programming languages don't have the same notion of a program counter and sequence and time that imperative languages do.

Simon Peyton Jones (00:06:20): In some ways a surprise then is that those little formulae that connect the value of one cell to another, but you don't say, "Equals A1 plus print hello." That wouldn't really make sense.

Simon Peyton Jones (00:06:31): When would that print hello, get printed? Well, whenever the Excel's computation engine decided to reevaluate that formula. But by design, we don't specify the order in which cells get reevaluated, we expect Excel to work it out using the data dependencies.

Simon Peyton Jones (00:06:46): And it could do them in parallel. Indeed, in some versions of Excel, do exactly that. So there is no notion of sequence if that's going to be done in parallel. There's no notion of side effects.

Simon Peyton Jones (00:06:55): That is evaluating a formula typically does not cause a side effect. That is something to happen elsewhere in the world, launch the missiles or print something.

Rob Collie (00:07:03): We hope not.

Simon Peyton Jones (00:07:03): That's attacking the entire fabric of computation. If you're writing a Python program, how do you compute the sum of the numbers between one and N?

Rob Collie (00:07:11): A for loop.

Simon Peyton Jones (00:07:11): You're going to write a for loop, which involves mutating a variable, which is a location that is value changes over time. So the very fabric of how you get computation done involves this mutation of state idea.

Simon Peyton Jones (00:07:26): Mathematicians don't do this. They just define functions that are simply pure functions. You give them the same input, they'll always give the same output and Excel formulae also exactly like this.

Simon Peyton Jones (00:07:36): They simply take inputs and they produce an output. And if you give them the same inputs, they'll produce the same outputs without side effects.

Simon Peyton Jones (00:07:41): I'm sweeping random numbers under the carpet here, that's a little dot corner of Excel. But to first approximation, what I'm saying is true. So Excel is in fact the world's most widely used functional programming language.

Rob Collie (00:07:52): Oh, yeah. It's the world's most widely used programming language full stop.

Simon Peyton Jones (00:07:56): Yeah. So it's quite funny that the most widely used programming language is a functional one, right?

Rob Collie (00:08:00): Yeah. I know.

Simon Peyton Jones (00:08:01): Because functional programming was previously was largely regarded as pretty niche, right?

Rob Collie (00:08:06): Yeah.

Simon Peyton Jones (00:08:06): Pretty specialist. Pretty academic. But actually it's the thing that most people do. And so I think we don't have to apologize to explain, we just say this is the very natural way to get computation done.

Simon Peyton Jones (00:08:15): Now the surprises that you can take what appears to be a very limited computational paradigm, Excel formula, and you can scale it up to do anything.

Simon Peyton Jones (00:08:27): So it looks as if Python is fundamentally more powerful than Excel, right? But it isn't really, because what we learned from the foundations of computation at the very same time that Turing was developing the Turing machine, which if you like, is the most fundamental embodiment of imperative programming, a step at a time, mutate the tape, read a cell, write a cell.

Simon Peyton Jones (00:08:47): The very same time actually in the very same place, because he was at Princeton at the time, Alonzo Church was developing the lambda calculus, which is the foundations of functional programming that didn't involve any mutation.

Simon Peyton Jones (00:08:58): So the same time these two fundamental ways of thinking about what it even means to compute were being developed at the same time.

Simon Peyton Jones (00:09:05): But it turned out that anything you could do in one, you could do in the other. So they were equally powerful. Precisely, equally powerful.

Rob Collie (00:09:11): That's fascinating, because I was going to say I was forced to, but actually I think I volunteered for it. I took a course in my computer science degree program that was on Automata theory.

Rob Collie (00:09:22): And when we learned about the tapes and the Turing machine, I don't remember really taking anything away from that experience other than I thought it was good brain candy. I didn't translate it into any professional value anyway.

Rob Collie (00:09:33): But to think that at the same time there was some other groundbreaking academic thing going on called the lambda calculus, which I had never heard of until recent conversations with you. We'll come back to how I'm sure this is related to the lambda functions in Excel.

Simon Peyton Jones (00:09:49): Oh, it is.

Rob Collie (00:09:50): And I've got a little bit of a bone to pick with that thing. Not nothing severe.

Simon Peyton Jones (00:09:54): That's a relief.

Rob Collie (00:09:56): Yeah. When I think of functional programming languages, I think of essentially equals function name open [inaudible 00:10:02].

Rob Collie (00:10:02): If I want to spot a functional programming language, that's what I'm going to be looking for. Maybe not even the equals.

Simon Peyton Jones (00:10:07): You have name functions and you can call them.

Rob Collie (00:10:09): Yeah. There's no line numbers, right?

Simon Peyton Jones (00:10:11): Sure there are. There's no program counter.

Rob Collie (00:10:13): There's line numbers, but the line numbers don't indicate flow of control.

Simon Peyton Jones (00:10:17): Exactly, yeah. There's no control flow. Not in the same way. Yeah.

Rob Collie (00:10:20): It doesn't just read from the top down and execute instructions. The nesting of things within the functions.

Simon Peyton Jones (00:10:26): It's all about data flow, not control flow.

Rob Collie (00:10:29): Now, I was subjected to Lisp in my college days, definitely a functional language, yeah?

Simon Peyton Jones (00:10:37): Yeah.

Rob Collie (00:10:38): But Lisp didn't have a grid, this concept of a two dimensional space. After a while, I enjoyed Lisp in a very impractical way. It was just a weird way to contort my brain.

Rob Collie (00:10:50): I still remember things like CDL, these functions that take the first thing out of the list or the last thing out of the list.

Rob Collie (00:10:57): But Lisp didn't come to conquer the world. Excel did as the functional programming language champion. And I'm assuming that that has a tremendous amount to do with the fact that Excel does have the visual grid to anchor people's thinking?

Simon Peyton Jones (00:11:11): Yeah. It's also a terribly weak functional programming language. It is not as expressive as Python, right? Nowhere near. Now we're fixing that, right? By adding lambda.

Simon Peyton Jones (00:11:22): But Excel is, as it were, by design, a pretty limited programming environment. It does what it does really well, and the vision that we've been developing for where Excel can go is to blow the lid off the limitations at Excel, while still keeping it's amazingness of having a visual presentation.

Simon Peyton Jones (00:11:40): Because there's a lot about Excel that's almost more fundamental than being a functional language. It's got this visual presentation, it's got this instant computation. You don't have to say compile and run. You just change some code and off it goes.

Simon Peyton Jones (00:11:50): Again, everything is laid out in space so that you can always see. In fact, interestingly with Excel, you mostly see the data, the code is mostly hidden.

Simon Peyton Jones (00:11:58): You can say show formally but mostly you see one formula at a time. And that of course is fantastic in some ways because it focuses your mind on the application.

Simon Peyton Jones (00:12:06): It's awful in others because Excel spreadsheets can grow to tens or hundreds of thousands of formulae. A nightmare to find your way around.

Simon Peyton Jones (00:12:15): Give anything to store it in a git repository. This is a major problem in deployment of Excel because people take this thing that, as it were, works really well where you've got a few hundred formulae in a small spreadsheet and starts to really creak when you get a 100,000 formulae and it becomes mission critical to your business.

Simon Peyton Jones (00:12:33): And people are just emailing around spreadsheets thinking they're going to change the world and we need git. So I think it's helpful to distinguish the computational paradigm, functional programming versus imperative programming, from its presentation.

Simon Peyton Jones (00:12:46): So Excel's presentation as a visual thing with this instant recap, that's what really made it hum.

Rob Collie (00:12:51): Within your field of study, within your academic field of study, functional programming languages were off the beaten path.

Simon Peyton Jones (00:12:59): Yeah.

Rob Collie (00:12:59): Probably looked at as such within the academic community. What is your academic core degree? Computer science? PhD?

Simon Peyton Jones (00:13:08): Wow. I wish I had a PhD. I don't. No, when I was at university, I left at the end of my undergraduate, got a job in a small company and then I ended up getting a job in a university. So in the end, I never got around to getting a PhD.

Rob Collie (00:13:21): Oh man. Now my opinion of you is now completely changed.

Simon Peyton Jones (00:13:24): That's right.

Rob Collie (00:13:25): No, you are now so much more practical and real world grounded. If you think that my opinion of you has diminished, think again.

Simon Peyton Jones (00:13:36): No PhD, definitely not worth talking to.

Rob Collie (00:13:39): No, I grew up thinking I was bound for the ivory tower, and along the way I discovered two things. Number one, I met the people who were meant for that and they didn't look like me. And I mean in terms of capability, I couldn't compete with that crowd despite my enthusiasm.

Rob Collie (00:13:55): But the other thing I discovered over time is that the overwhelming majority of ivory tower thought does not survive the test of the real world. It's just so impractical. It's almost divorced from reality.

Rob Collie (00:14:08): When I started laughing, I'm more like, I like you even more now. You're a researcher who was like, "Whatever, I don't need that." I'm not going to look down on PhDs either.

Simon Peyton Jones (00:14:16): I'm exactly the opposite. When I was growing up, I considered myself as definitely not destined for the ivory tower. And in fact, I left and discovered just how sweaty it was in the industry and ended up scuttling back to the ivory tower.

Simon Peyton Jones (00:14:34): But when I left university, when I not left after my undergraduate, my department said, "Why don't you stay and do a PhD?" And I said, "Absolutely not. I want to get a job, a real job.: None of this ivory tower nonsense. So I was like you but backwards.

Rob Collie (00:14:47): Yeah, a little zigzag there. And so then you find yourself at Microsoft. It seemed like Microsoft Research was hiring on a percentage basis in my years, probably even more aggressively than the actual R&D teams.

Simon Peyton Jones (00:14:59): Yeah. There was a time when Microsoft Research was in Cambridge, England, started in about 1997. But by that time I'd been working as a university academic for 15 years.

Simon Peyton Jones (00:15:09): Then Microsoft Research, Cambridge was starting and I was looking for a change for one reason or another. We wanted to move from Scotland to England.

Simon Peyton Jones (00:15:16): And so I just phoned them up and I thought this will be a change. I've been 15 years at university. Let's try change. MSL is starting.

Simon Peyton Jones (00:15:22): So I phoned them up and said, "Would you like to give me a job?" And after a bit they said, yes. It was great. At that stage MRS Cambridge was indeed hiring quite actively.

Simon Peyton Jones (00:15:29): But I should say they were very conscious at the time of not wanting to either be seen to or actually run around eviscerating computer science departments by offering to double the salaries of famous academics.

Simon Peyton Jones (00:15:45): So we waited for people to apply. We did not go out and head hunt them and dangle gold in front of them. I thought that was quite important because the whole point about MSL was we're trying to build trust and collegiality and warm relationships with academics. If you go out eviscerating their departments, they don't like you and rightly so.

Rob Collie (00:16:02): And then if you do that, they poison all the computer science students against working for Microsoft.

Simon Peyton Jones (00:16:08): Yeah. We didn't even want to go there.

Rob Collie (00:16:10): Yeah.

Simon Peyton Jones (00:16:11): That worked out quite well, but I was actively looking. So when I joined Microsoft Research Cambridge, about employee number six or eight or something, it was Luca Cardelli and Andy Gordon and Chris Bishop.

Rob Collie (00:16:22): That's so cool. 15 years in academia as a researcher. Did you teach lectures? What all were you doing in those 15 years?

Simon Peyton Jones (00:16:31): After this two years in industry that I mentioned, after leaving university, I then decided I did need a change of job. I thought I was going to get another job in industry, but my sister was studying at UCL in computer science as it turned out at the time.

Simon Peyton Jones (00:16:43): And she said, "Oh, they're advertising a couple of lectureships. Why don't you apply?" In US terms, that would be a very lowly professors job.

Simon Peyton Jones (00:16:51): So I thought, "Well, I could apply and see if I get an interview." And I applied. Not only did I get an interview, I actually got the job. It was a great surprise to me.

Simon Peyton Jones (00:16:57): Because I didn't have a PhD. I had one paper to my name. It would never happen today. But it turns out that in 1983, that was the time this was happening, was a time of very rapid expansion in university computer science departments.

Simon Peyton Jones (00:17:09): So roughly speaking, if you had a pulse, they would hire you. And apparently I did have a pulse or enough of one. So I was very lucky to get a tenure job as a faculty member in a really good computer science department, University College London, and I stayed there for the next seven years.

Rob Collie (00:17:23): Isn't that great? Things like this are everywhere and they cut both ways. It's instructive to think and to reflect that someone like you, who I consider to be elite in your field, if the conditions in the world had been different at the time, you would not have been hired.

Simon Peyton Jones (00:17:38): Not as a faculty member. I might well have stayed in industry, yeah.

Rob Collie (00:17:39): And the course of your career would be completely different. And that ends up even changing the course of Excel. And you don't even have a PhD, Simon.

Simon Peyton Jones (00:17:49): Sorry, I have four honorary degrees, but no PhD.

Rob Collie (00:17:54): That's four more honorary degrees than I have. I've become so much more familiar with the idea that opportunity is random.

Simon Peyton Jones (00:18:07): Yeah, yeah. Big doors swing on little hinges.

Rob Collie (00:18:11): Ah, I love that. The majority of our guests on this show are people who through one random path or another, have found their way into Power BI and not one of them were made to do it.

Rob Collie (00:18:25): No one invited them to this party. They just showed up and said, "Oh, maybe this works for me." So the notion that your path was accidental and non deliberate, I find that just delicious.

Simon Peyton Jones (00:18:42): Even my interest in functional programming, that was pretty accidental too. It just happened that there was a very inspirational lecturer called Arthur Norman who was giving a series of four lectures at Cambridge.

Simon Peyton Jones (00:18:52): They weren't even part of the course I think that I just happened to go to. He was at four lectures about functional programming. I thought, "This is amazing."

Simon Peyton Jones (00:18:59): Wasn't instant, but over the next six months I became hooked on functional programming and I've never given up that drug.

Rob Collie (00:19:05): So to the extent that you can distill out and remember back, what was the thrill? What was the rush that you got from that? What was it that appealed?

Simon Peyton Jones (00:19:15): Well, it was an entirely new way of thinking about the whole enterprise of programming. I've been building MicroProses, MicroProses are basic computers, for some time. So I knew about programming.

Simon Peyton Jones (00:19:25): I could type X code into my computer, boot up. But this was a whole different way of thinking about the process of computation.

Simon Peyton Jones (00:19:33): It was also at a time at which John Backus won the Turing Award, which is the computer science equivalent of the Nobel Prize.

Simon Peyton Jones (00:19:40): And his Turing Award lecture was entitled, Can Programming Be Liberated from the von Neumann Style? Von Neumann style, meaning step at a time program counter update, mutate.

Simon Peyton Jones (00:19:52): Backus was saying, "Have no truck with this imperative style of programming, and we should think of programming in a de declarative way."

Simon Peyton Jones (00:19:58): He had a particular language called FP, which he used to exemplify this, and moreover, he said, "We should build new kinds of computers to execute these functional programs because they're so different. Of course, they're probably going to require different kinds of hardware to execute on."

Simon Peyton Jones (00:20:12): If you are an undergraduate, that's like, oh, now this is a great genius God person telling us to just throw everything out of the window and start again with a fresh, clean sheet of paper to think about the whole enterprise of programming and machine architecture. That's pretty exciting.

Rob Collie (00:20:29): Yeah. So many things about that would resonate with me. I would've found that very appealing as well.

Simon Peyton Jones (00:20:34): Or equally random social elements. I think citing other colleagues at Cambridge, John Hughes and Thomas Clark and Joe Stoy and Jon Fairburn, who had bitten by a similar bug and then you all bounce off each other.

Simon Peyton Jones (00:20:43): And in fact, they ended up building, I wasn't directly involved in, they ended up building a micro coded machine called the SKI Machine or SKIM, that directly executed SK Combinators, which themselves were a funny lambda calculus like machine code for functional programming.

Simon Peyton Jones (00:20:59): So they really built this thing that was a machine architecture for functional programming. It was very exciting. Totally misconceived, right, misguided as it turned out.

Rob Collie (00:21:07): Let's definitely make a note. I want to find out why that was misguided. But let me mention something first, which is in an episode that recently went live, I spoke with a former colleague of mine, David McKinnis

Rob Collie (00:21:18): And David and I worked together before I was on Excel, and the project that he and I worked together on was the Windows installer, the MSI project.

Simon Peyton Jones (00:21:28): Yeah.

Rob Collie (00:21:28): It's fundamental change as an installation engine was that installation engines had been imperative up until that point. Very linear flow of control. Go do this, go do that, go write this registry key, go install this file.

Rob Collie (00:21:43): It just turned out that installing software is primarily about desired end state. You want the machine to end up having these things in these places in the end and having the language be go put things places was incredibly clumsy.

Rob Collie (00:21:58): So instead MSI was declarative. You described your software to the MSI engine as nouns.

Simon Peyton Jones (00:22:05): Yeah. So what you want rather than how you want to get it.

Rob Collie (00:22:07): That's right. And then the verb was taken care of by the system.

Simon Peyton Jones (00:22:11): Yeah. That's the whole mantra of declarative programming. Say what not how. Yeah.

Rob Collie (00:22:15): Yeah. What not how. And so functional programming is not declarative.

Simon Peyton Jones (00:22:21): Oh, sure it is.

Rob Collie (00:22:21): Is it?

Simon Peyton Jones (00:22:21): Excel is declarative. If you say the value of cell A2 is A1 times seven.

Rob Collie (00:22:27): Okay. Yeah, you're right.

Simon Peyton Jones (00:22:28): You don't say an in step three assign into A2, read out A1 and add three to it and assign that into A2.

Rob Collie (00:22:36): Okay.

Simon Peyton Jones (00:22:36): You just declaratively say what the value of each cell is. A bit like in mathematics. You might say, "Let X be the sum of Y and Z and let PB this and let PB that."

Rob Collie (00:22:45): Oh my God. I've discovered I never get the German accent correct. But ich bin ein functional programmer, that's what I am.

Simon Peyton Jones (00:22:54): Yeah.

Rob Collie (00:22:55): I did MSI. I did Excel. I got into Power BI when it was mostly DAX. Even though I love what it can do for me, I hate M, I hate the M programming language with a passion.

Simon Peyton Jones (00:23:13): Oh, Lemon Sefersky going to turn on you. Yeah.

Rob Collie (00:23:14): Plus I just find its syntax to be inhumane. I think the inhumane has as much to do with it as anything. I love Power Query, being able to click buttons.

Rob Collie (00:23:23): If you haven't looked at Power Query and the M language in depth, it is beautiful. It is a beautiful thing. It's just that I find the raw language of M, it's like my body has an allergic response to it.

Rob Collie (00:23:36): It's like the people who would love the taste of chocolate, but their body rejects it. I feel that way about M. I don't know if you've seen it.

Simon Peyton Jones (00:23:44): Another way to view this cake is to say that functional programming and the declarative programming you're describing in MSI is about programming with values rather than programming with state.

Simon Peyton Jones (00:23:53): Instead of mutable locations, you just have immutable values. So the paper that has the best title I have ever read was Pat Helland's paper. The title is Immutability Changes Everything.

Rob Collie (00:24:10): You got to think about that for a moment.

Simon Peyton Jones (00:24:11): Exactly. Three words. It's such a great title because immutability of course means things that don't change. But actually the idea of programming with immutability reconfigures your entire view on the world.

Simon Peyton Jones (00:24:23): And his point was in this paper, I didn't like the contents of the paper so much as the title, but the story that he was trying to tell I think quite successfully is that immutability programming with values, functional programming, declarative programming is not really just a, well, this is how the way Haskell is.

Simon Peyton Jones (00:24:39): It's a way of thinking about systems and computational artifacts at large. So your MSI installer, you have the end state, the value that you want to get to.

Simon Peyton Jones (00:24:50): He's talking about file systems and say that these days, a lot of file systems are log structured. So instead of overwriting files in place, you simply keep a trail of all the diffs, something like git keeps track of everything.

Simon Peyton Jones (00:25:02): Git is entirely about immutable values. That is each commit is forever. The commit, A06923 is forever. That particular collection of bits, that large collection of bits.

Simon Peyton Jones (00:25:14): When you add another commit, you don't overwrite the previous thing. What he said, "Accountants don't use erasers." You never delete anything. You just have a value.

Simon Peyton Jones (00:25:21): But your new value is some delta to the old value. Keep track of that. So he was trying to tell a story that says, actually, once you start to take immutability seriously, it affects every system you build, not just the language you're programming.

Rob Collie (00:25:32): Yeah, yeah.

Simon Peyton Jones (00:25:33): And your MSI story is a great example.

Rob Collie (00:25:36): And that system to this day is still I think the number one most commonly used installer for software on Windows.

Simon Peyton Jones (00:25:47): And Nix. Nix is another, I don't know whether you think of MSI and Nix in the same story, but Nix is very much about system configuration as value.

Rob Collie (00:25:52): I don't know about Nix at all.

Simon Peyton Jones (00:25:53): From the sound of it, it's like MSI writ very large and much more complicated.

Rob Collie (00:25:59): I've got Stevie Nick's in my head now. Right? Here you go again. You say you want your software.

Simon Peyton Jones (00:26:08): This is N-I-X.

Rob Collie (00:26:10): Oh, I figured, I figured. But still I can go back to the 70s. My parents LPs. Let's see here. We've discovered that without ever realizing it, I have a strong preference for declarative languages.

Rob Collie (00:26:22): And I think what's funny is that why do so many non CS people, non computery types, find themselves falling in love with Excel and becoming really good at it and then eventually that love affair blossoms into a love affair with DAX and Power BI.

Rob Collie (00:26:39): I've been talking about this thing that I've called the data gene for a long time. It's either in you or it's not. It's about 5% of the population. It can lie dormant for long periods of time.

Rob Collie (00:26:52): Now, of course, I haven't done any genetic research. I'm not talking about an actual DNA sequence here.

Simon Peyton Jones (00:26:57): Every 13 years like the cicadas, it comes out.

Rob Collie (00:27:00): Yeah. Yeah. Exactly. Exactly. It's a concept that might as well be the truth as a thought concept, as a thought structure, a thought experiment.

Rob Collie (00:27:11): It describes the world perfectly. The world that I have observed for the last several decades, the data gene is just waiting for its moment.

Rob Collie (00:27:20): It's like you said the cicadas but it's not a 13 year cycle. It's more like it needs the right sunlight at the right time and then boom.

Rob Collie (00:27:29): So there's something about people's brains that the imperative stuff appeals to a certain brain, and this functional or declarative stuff appeals to a completely different brain.

Rob Collie (00:27:42): And much of the same way that you were mentioning earlier that the researchers were saying, "We need to build completely different kinds of computers to process these different languages."

Rob Collie (00:27:50): It's almost like the data gene, as I've been calling it, I'm starting to wonder maybe this is the functional programming gene.

Simon Peyton Jones (00:27:56): It's very much in the same territory. The only thing I'd wonder is whether it's really innate characteristic or whether it's environmentally derived. Nature versus nurture.

Rob Collie (00:28:06): Clearly. There's that going on. Either way by the time the collision with Excel happens, nature has already run its course at that point.

Rob Collie (00:28:14): Whatever environmental development is required to stick to this stuff has already happened. It really is very clear when you randomly collide with the Excel particle, you either bounce violently off inelastically like in classical physics, like billiard balls or you stick.

Simon Peyton Jones (00:28:33): And what was always frustrating to me, and the opportunity that I could see is that the people who stuck and there were very many of them, are then stuck with a pretty low glass ceiling.

Rob Collie (00:28:43): Yes. Yes.

Simon Peyton Jones (00:28:44): They can do quite a lot, but it becomes increasingly contortionist to do more. And there's no reason for that because we knew exactly what to do and it wasn't even hard in principle. It's always hard in practice. So that was a massive opportunity.

Rob Collie (00:28:56): So Excel comes with this easy on ramp for so many people, but it becomes your opponent, traditional Excel anyway, that thing that you love, it becomes your opponent one week after the love affair begins.

Rob Collie (00:29:08): You're not even really thinking about it, but you're already suffering from Excel's limitations in the early going. One of the things that I like to tell people in this way is Excel is the only programming language in the world that randomly names your variables, that randomly names your data structure. What cell did I put tax rate in? B7.

Simon Peyton Jones (00:29:28): Yeah.

Rob Collie (00:29:31): B7 doesn't help me read my formula.

Simon Peyton Jones (00:29:33): Well, you can give it a name.

Rob Collie (00:29:36): Exactly. Right. So no one ever does or not reliably enough. The thing that made it so appealing was that A1 notation at the beginning, the A1 notation even a few days later has already metastasized into this mess. You can't read your formulas.

Simon Peyton Jones (00:29:54): I've always thought I wrote white papers for the Excel team about how we should put effort into making naming of cells and cell regions into something that was simple and fluid and didn't involve lots of right clicking and entering the name manager.

Simon Peyton Jones (00:30:08): But that particular part never got traction. But the other thing that you would never accept in a normal programming language is that in Excel you do this copy paste of formulae and these very clever formula adjusts things.

Simon Peyton Jones (00:30:20): The analogy is, if you imagine writing a C program, instead of providing procedures, you just get clever copy paste. So if you want to call square root, you don't call square root, you go to the square root function, you copy the code and you paste it into the code for the place where you would've called it with some clever copy paste that substitutes your actual parameter.

Simon Peyton Jones (00:30:39): And then you do that everywhere you call square root. So not only does your program become big because of all this copying, but also if you've got a bug in the square root function, then good luck if you're finding all the places you've copy pasted it to.

Simon Peyton Jones (00:30:50): It just would be so completely and utterly unacceptable to anybody who'd ever written more than 10 lines of code that I think it's astonishing that we have accepted it for so long without even thinking about it in Excel. And it's easy to fix.

Rob Collie (00:31:06): Easy.

Simon Peyton Jones (00:31:08): Easy in principle. Because Excel is a big old product and it has rather a lot of users. It's like a super tag, it has an incredible amount of mass and a very small crew.

Simon Peyton Jones (00:31:17): So changing course is hard, even if it's obvious what the course should be, and there are no rocks. The mass is enormous.

Rob Collie (00:31:24): Yeah. It is, it is. So let me talk you through my experience getting to know DAX and coming to terms with even explaining it to myself, what I was experiencing and why it was so amazing after having been in the Excel environment for a while.

Rob Collie (00:31:40): When Power Pivot first came out, the demos that Microsoft gave, we leaned into the visceral. Who wouldn't be excited by seeing a formula run against a 100 million rows of source data and seeing the results calculated in a pivot table in a split second?

Rob Collie (00:31:55): That would be exciting to see. So we did that. Excel could have never done anything remotely like that in the past. So we leaned into that.

Rob Collie (00:32:02): And it was a mistake because then people thought that the word power in Power Pivot meant a 100 million rows. People said, "Well, I don't have a 100 million rows of data, I've got 50,000. So Power Pivot is not for me," was the unconscious conclusion they came to.

Rob Collie (00:32:19): But along the way, as I was just playing around with this tool set for the first time and getting to know it and using it for things, I was discovering that I liked it even for single tables.

Rob Collie (00:32:31): The other big advantage of Power Pivot was that it had a star schema dimensional model. Didn't require everything to be V look upped into one table before it could aggregate.

Rob Collie (00:32:42): But even if I had a single table of 50 rows of data, I was preferring DAX as my analysis language rather than Excel formula paired with traditional pivots.

Rob Collie (00:32:55): In a landslide I was preferring it. It was like an intuitive decision to prefer it that was hard to put into words. I eventually came around to describing it as when I teach classes, I would say, again, because my classes would be people who are making the transition from Excel to DAX.

Rob Collie (00:33:12): I would describe it to people as portable formulas. The idea that you write a formula one time once and you use it everywhere.

Rob Collie (00:33:22): So there was no copying and pasting. There wasn't any, if I need to fix it or adjust it, the logic of it, I have to go find all the places I used it. I just edit it one place. That's really awesome.

Rob Collie (00:33:34): Just as importantly, it was not tied to the geographical layout of my data. So if I wanted to use it in different contexts, like a report that grouped by region as opposed to grouping by year, the same formula worked in that environment.

Rob Collie (00:33:50): So I could just deploy this logic in every possible direction effortlessly. Excel wasn't like that at all.

Simon Peyton Jones (00:33:58): It's much more like that when you have lambda.

Rob Collie (00:34:00): Okay. All right, here we go. All right, here we go. So when I was on the Excel team, I was writing a specification that originally Charlie had been in charge of it and then it got handed off to me. This is a load balancing thing.

Rob Collie (00:34:14): I was calling the specification codeless UDFs. All right. So this requires some parsing. So a UDF is a user defined function that up until this point, you could write them in VBA. You could also write them in other languages.

Simon Peyton Jones (00:34:32): Which is also somewhat hilarious when you think about it. It's a bit like saying, "I'm going to give you a Java language, but as soon as you want to define a function or a method, you can't write that in Java. You can write it in VBA."

Rob Collie (00:34:43): Yeah. Yeah.

Simon Peyton Jones (00:34:45): The only language you can't write it in is the language you are calling it in.

Rob Collie (00:34:48): That's right. That's right.

Simon Peyton Jones (00:34:50): Very weird.

Rob Collie (00:34:50): The V lookup function under the hood was written in CC plus plus. So we'll just make the UDF capability and UDFs are pretty interesting.

Rob Collie (00:35:00): In theory, I could have written a UDF for fantasy football scoring that takes references to various statistics and produces a point value.

Simon Peyton Jones (00:35:10): So you want to write new functions, it just seems madness to require you to write new functions in a language other than the language you are wanting to call it in.

Simon Peyton Jones (00:35:19): So of course, yes, once you write it in some other language, then well you could do whatever you like. So you were writing this spec for codeless UDFs. Codeless meaning not switching to another language.

Rob Collie (00:35:30): Yeah. See that betrays that I hadn't quite fully embraced the notion of Excel's a programming language. Of course, it's code.

Simon Peyton Jones (00:35:36): That's right. The formulae is code. So you just mean Excel code full UDFs.

Rob Collie (00:35:44): I was so young. But that didn't happen. Codeless UDFs didn't happen. We ran out of budget and resources and time, and so that feature got canned and then many years later, this thing shows up called lambda functions.

Rob Collie (00:36:02): I'm sure it doesn't resemble my specification at all, but in principle, it's the same idea, right? I can use the spreadsheet grid to create a complex series of cascading calculations even, that ultimately produces some output.

Rob Collie (00:36:21): And then turn that into a reusable chunk of logic that can be called from all kinds of other places in the spreadsheet without copy paste.

Simon Peyton Jones (00:36:29): It's actually interesting why did it not get traction when you were there but did later? We should ask Dave Gainer, maybe you did when you interviewed him.

Rob Collie (00:36:38): I know that we were focused all in on BI as our mission for that release. And so whenever we ran out of budget, we cannibalized anything that wasn't BI.

Simon Peyton Jones (00:36:48): So my perception was that I would repeatedly go to visit you and your colleagues because at that stage there were releases every two years, every three years.

Rob Collie (00:36:56): Three. It was long.

Simon Peyton Jones (00:36:57): Three. Right. And so then there would be a period of about nine months in which you would sort be at least nominally receptive to ideas.

Simon Peyton Jones (00:37:04): And then there would follow another few months of, well, we'll refine them and then I'd get a phone call that said, "I'm very sorry, Simon. We're not going to do it this time around because we got to do the 64 bit version or the BI stuff or Google compete or something."

Simon Peyton Jones (00:37:17): There was always good reason and not for me to agree with that, it's a business decision. So then what happened, I became discouraged and went away because I thought it was never going to happen.

Simon Peyton Jones (00:37:26): And during that time I was away, was about eight years or something, maybe longer. Two things happened. The first is Excel moved to a continuous release model in the cloud. So every three months something else would come out.

Simon Peyton Jones (00:37:38): So suddenly instead of a three year cycle in which there was a period of brainstorming and then a cutoff, and then a throwing away most of the things and we'll focus on one or two things and anything we throw away, we're not going to think about for another two years.

Simon Peyton Jones (00:37:49): Instead with a three month cycle, well obviously it will be silly to not think about anything for the next two weeks. So despite the timeframe in some ways becoming a factor of 10 shorter, the thinking became a factor of five longer because you could embrace longer timescale processes. But you just needed to think about intermediate milestones to get to, so that was very interesting.

Simon Peyton Jones (00:38:11): And the second thing that happened was the people that I had been interacting with like yourself and Dave Gainer and Charlie, who were at that time relatively junior, were being promoted.

Simon Peyton Jones (00:38:20): So by the time I came back, Dave Gainer was in charge of Excel. So I said, "Dave, we talked all those years ago about this. We should put lambda in Excel." And Dave said, "Oh, yes, we should." And then we did because he was in charge.

Simon Peyton Jones (00:38:33): So it was an unusual tech transfer strategy, which was a bit of a long play. But you go and talk to everybody for a time and then you go away for a decade and wait for them to get promoted. And if you talk to enough people and one of them's got promoted, then you're in good.

Rob Collie (00:38:46): Yeah. Plant an idea. Wait a decade. Wait for the entire paradigm of software development at all large software companies. Wait for the paradigm to change.

Rob Collie (00:38:57): Wait for that careful investment in those people as they mature and get promoted within the organization. Simon Peyton Jones plays the long game. He's like the Lannister's.

Simon Peyton Jones (00:39:06): I should be clear, this was absolutely not my plan.

Rob Collie (00:39:09): I know, I know.

Simon Peyton Jones (00:39:09): It was just the way it worked out.

Rob Collie (00:39:13): Just like coach drew it up.

Simon Peyton Jones (00:39:14): Yeah, that's right. Just the retrospective rationalization of what happened.

Rob Collie (00:39:21): Yeah. Just bouncing around a little bit. Now you're also involved with a couple of interesting things. Let's talk about your involvement with computer science education for children.

Simon Peyton Jones (00:39:33): Yeah.

Rob Collie (00:39:34): So this has become a matter of policy in the UK?

Simon Peyton Jones (00:39:40): Yeah, it has, yeah. So this started actually, curiously, there is a connection with Excel here as well as it happens. So around 2005, six, seven my children were at school.

Simon Peyton Jones (00:39:49): So like parents do, I would talk to them over dinner about what they'd been doing at school. And I was particularly interested in what they were doing in what was then called ICT, Information and Communication Technology, which was one of the subjects that they were studying and they treated it with contempt.

Simon Peyton Jones (00:40:04): They thought it was dull and boring, but it turned out that it was mainly about how to use Microsoft Office, including Excel, but also Word and PowerPoint.

Simon Peyton Jones (00:40:11): And they felt as if they either already knew this or that it wasn't very interesting. And 10 years previous when computers were not in everybody's home, it might have made sense, but by then the problem was in the very title of the subject, information and communication technology.

Simon Peyton Jones (00:40:24): So ICT was seen as a vocational subject or a skills based subject that you would do as a useful skill that would equip you for the world of work and possibly for using Excel or Word or something in writing essays or doing something in physics.

Simon Peyton Jones (00:40:38): But very instrumental, if you like, wasn't an educational process. So if I'd been a biologist, then I would've been able to connect my professional life with what my children were doing at school.

Simon Peyton Jones (00:40:48): But for me, I had the subject that I thought was the most interesting and fascinating subject on the planet, and therefore that I devoted my professional life to it.

Simon Peyton Jones (00:40:56): And on the other hand, what my children were doing at school, which was dull and boring and had no connection with this subject that I thought was so interesting.

Simon Peyton Jones (00:41:04): And so I started to talk to a bunch of other people and everybody I met thought the same thing. They thought it was completely broken, but they said, "Well, but what can you do? It's the education system."

Simon Peyton Jones (00:41:13): So I began to wonder if nobody is actually arguing for the status quo, maybe the only thing holding the status quo in place is inertia, which is more easy to deal with.

Simon Peyton Jones (00:41:24): It's like a big castle with no defenders perhaps. So then maybe you can take the castle to bits. There's a lot of mass in it, but still it's movable.

Simon Peyton Jones (00:41:34): So we formed this group called Computing at School, which was a guerrilla group of volunteers. It was initially four people. I was one of them.

Simon Peyton Jones (00:41:41): And then we gradually grew. I maintained the membership list honor on a spreadsheet in fact, for a long time.

Rob Collie (00:41:46): Of course.

Simon Peyton Jones (00:41:47): Now CAS has about, I don't know, over time it certainly had more than 30,000 members and maybe 10,000 active members at the moment. It's a fairly large group.

Simon Peyton Jones (00:41:54): But it's very much bottom up guerrilla movement. Our first order of business is, well, what do we want? If we don't like the status quo, what do we want?

Simon Peyton Jones (00:42:01): And it wasn't long before we came to the conclusion what we wanted was to say, "Computer science is a foundational discipline that all children should learn in the same way that they learn natural science."

Simon Peyton Jones (00:42:12): It's not because we teach children a bit about biology and a bit about chemistry and a bit about physics. All children this is, not just the future physicists.

Simon Peyton Jones (00:42:19): And we teach them not because they're going to become the physicist of the future, though some of them will be, but because understanding something about just your mass or combustion or volume equips you to have agency and be empowered in make critically aware decisions in the natural world that surrounds you to be an empowered citizen, if you like.

Simon Peyton Jones (00:42:39): And computer science is like that, right? If anything, the digital world surrounds us and presses in on us even more pervasively than the natural world sometimes.

Rob Collie (00:42:48): Yes.

Simon Peyton Jones (00:42:49): So if you have some perhaps elementary understanding of both the capabilities of and the risks of and how you can affect the digital world that surrounds you, that puts you in a position of having more agency and power than if you are just ignorant.

Simon Peyton Jones (00:43:04): So if our children think of the sleek devices that surround them as being essentially magic created by magicians far away over the water in which if you intone the right spell, they will do wonderful things for you, but over which you have no agency or control.

Simon Peyton Jones (00:43:21): I think that's not a healthy state. So that was CAS' mission to make computer science be a foundational discipline that all children study at elementary level initially from primary school onwards, just as they do mathematics and natural science. So that's pretty radical. That was a very radical thing to say at the time.

Rob Collie (00:43:38): Super radical. It still sounds radical to me now.

Simon Peyton Jones (00:43:42): Right. And at the time it was like, "Oh, commuter science's like a university subject," right? At best. A primary school subject? This is crazy.

Rob Collie (00:43:51): So what does that look like? In the same way that I can imagine a class on Microsoft Office being very practical while at the same time not practical for any of the problems that an elementary school kid faces.

Rob Collie (00:44:07): What is the very first computer science concept that is taught to a child in the UK now?

Simon Peyton Jones (00:44:14): Just as maths surfaces at primary school, mainly in the form of numeracy and arithmetic. So computer science surfaces at primary school a lot in the form of programming and particularly programming in visual languages. Scratch has an absolute arm lock on the market.

Rob Collie (00:44:29): Scratch?

Simon Peyton Jones (00:44:30): Have you come across Scratch?

Rob Collie (00:44:31): I have not.

Simon Peyton Jones (00:44:31): Google Scratch and it's from MIT and it completely dominates early stage programming.

Rob Collie (00:44:37): Okay. What does it look like? It says the visual language.

Simon Peyton Jones (00:44:40): Instead of looking textual, it looks like blocks. You have little jigsaw like blocks in a little menu or palette on the left of your screen and you drag them to the main bit of your screen.

Simon Peyton Jones (00:44:49): And they say things like move forward three steps or turn to the right and it's like turtle graphicsy kind of things, or perhaps add one to this variable.

Simon Peyton Jones (00:44:58): It is an imperative programming language Scratch, but it also has things like if the mouse button is down, then turn to the left so you can make interactive gains very easily.

Simon Peyton Jones (00:45:06): So it definitely is programming. It's programming in a visual language in which you can't get the wrong syntax because these blocks fit together like jigsaw puzzle things.

Simon Peyton Jones (00:45:15): That sweeps away a large class of problems. And it also has this immediate feedback thing a bit like Excel in that even when your program's half built, you can run it.

Simon Peyton Jones (00:45:23): There's a little screen at the side, it's a little two dimensional world Scratch has. You can watch your turtle moving around or your cat dancing or space invader game playing.

Simon Peyton Jones (00:45:32): And so it's really not long before your primary school children are building quite elaborate things. So my son is now 11, but he's been doing this Scratch for a while.

Simon Peyton Jones (00:45:40): He's building Scratch programs that have thousands of blocks in them and they're all a bit spaghetti like, but he's been quite ambitious because he can.

Simon Peyton Jones (00:45:48): It's like you're giving young people the clay out of which to build well, anything. That's one way in which computer science surfaces in primary school.

Simon Peyton Jones (00:45:57): Another way that computer science can surface in primary school is by thinking about things like, well, the computer presents this list to you in as sorted way. How does it sort? How does it sort or how does it look up?

Simon Peyton Jones (00:46:09): Even without computers at all you can say when you're looking up a name in a telephone directory, do you just look from the beginning? Linear search? No, you look in the middle and then you zigzag back.

Simon Peyton Jones (00:46:20): A child, even a eight year old child, would do binary search by instinct. If you draw that out and say, "Oh, this is something like what a computer might do," something that would take more than their lifetime of the universe to do to something that happens in a flash.

Rob Collie (00:46:34): Yeah.

Simon Peyton Jones (00:46:34): There's an enormous body of ideas now about how to introduce some of the foundational ideas of computer science at a very early stage.

Simon Peyton Jones (00:46:43): It still is to be completely honest, it's like an experiment. We don't have centuries of experience like the mathematicians do on what it means to teach early stage mathematics.

Simon Peyton Jones (00:46:52): And even the mathematicians after centuries of experience still argue about how they should do it.

Rob Collie (00:46:56): Oh yeah.

Simon Peyton Jones (00:46:57): Should we do algebra first or arithmetic first? So I'm sure we'll be arguing about this for a long time. But I think what's unarguable is that some form of elementary understanding for all children will equip them for a rich life as a plumber or a brain surgeon or a hairdresser or lawyer. All of these things.

Rob Collie (00:47:16): Did you ever encounter Logo?

Simon Peyton Jones (00:47:18): Yes. Logo also came out of MIT I think. I think it was precursor to Scratch. Still quite widely used but I think Scratch is more or less eaten Logo's breakfast as far as the mass market.

Rob Collie (00:47:28): It certainly sounds like it. Luke and I were like in third and fourth grade exposed to Logo.

Simon Peyton Jones (00:47:35): Yeah, there you go. So it's a textual language. Scratch is more visual. Many of the things you can do in Scratch are completely the same. Everything you can do in Logo, you can probably directly do in Scratch or send a different syntax.

Rob Collie (00:47:45): And Scratch is imperative?

Simon Peyton Jones (00:47:47): Yes, it is. Yes. So it does have variables.

Rob Collie (00:47:49): It has a variables. It has linear flow of control.

Simon Peyton Jones (00:47:52): Yes, it has linear flow of control. The interesting thing is that it's reactive in the sense that each of your sprites on your screen has its own program counters, its own flow of control. In fact, maybe several of them.

Simon Peyton Jones (00:48:04): So as it were, all of these guys start and are running concurrently with each other in response to events. So it's more event driven or reactive than it is a single program counter. It's intriguing. And all of that seems very simple and natural to children.

Simon Peyton Jones (00:48:16): Anyway, that was the prospectus, right? Let's change the way we teach computing. So then we had to execute on it. We did get lucky. We ended up being able to change the national curriculum in Britain.

Simon Peyton Jones (00:48:26): So another thing that's different about Britain and the United States is that we have a very centralized education system. So we have a national curriculum.

Simon Peyton Jones (00:48:34): In the United States, you don't have a national curriculum. In fact, every state is responsible for its own education and is fiercely resistant of federal oversight.

Simon Peyton Jones (00:48:41): You take decentralization to an absolute mad degree. Usually I like decentralization, but when you do centralized to the individual school level, it's madness.

Simon Peyton Jones (00:48:53): An advantage we had is we had a central control point and actually we managed to influence it. So in fact I spend about a day a week doing computing education stuff these days.

Rob Collie (00:49:02): Decentralization, it's impact varies quite a bit depending upon just how thoughtful people are, right?

Simon Peyton Jones (00:49:08): Yeah.

Rob Collie (00:49:10): If you've got a tyrannical central control, decentralization is awesome. But if you run into less and less thoughtfulness as you go further out, decentralization? Maybe we should centralize a little more.

Simon Peyton Jones (00:49:21): Usually I'm in favor of decentralization, but in education it's worked quite well for us being somewhat centralized.

Rob Collie (00:49:26): Well, I'm fascinated, and I love the notion that the first time you hear the phrase information science, the very first time it sounds cool. It really does sound super compelling.

Rob Collie (00:49:39): The science of information, because it is a property of the universe. The line between physics and information gets very, very blurry the farther out you go.

Rob Collie (00:49:53): When you get into places in physics that I am not qualified to really have opinions, you find that it becomes an information game.

Simon Peyton Jones (00:50:01): Quantum mechanics is all about information. When you know the place it is, you don't know it's velocity or something.

Rob Collie (00:50:06): Yeah. They even get to the point where they use information as ways to prove and disprove theories. We know that information is not destroyed so something must be going on here.

Rob Collie (00:50:16): Getting at that is almost like a natural science type of thing. That would've been so compelling to me as a youngster. But of course, when you hear the words information science today, you invariably think of really boring corporate IT type training or card catalogs and things like that.

Simon Peyton Jones (00:50:35): Well, I often characterize because I've spent quite a bit of a while trying to talk about computer science to lay people, to parents, to school governors, to government ministers to civil servants. I often characterize computer science now as the study of computation, information and communication.

Rob Collie (00:50:54): Ah. that last one.

Simon Peyton Jones (00:50:55): Not the study of algorithms, data and networks, because those are more technological things. The first words I use were all ION words. Computation.

Simon Peyton Jones (00:51:08): And I think computation is super important, but we tend to over fixate on it. Information for exactly the reasons you're describing and communication because actually the way in which computer systems communicate with each other and how we can harness that communication to build collective behavior, super important.

Simon Peyton Jones (00:51:22): So I like that characterization and it does suggest so what is the study of information in computer science? Well, it certainly includes things like is information a quantity that you could measure?

Simon Peyton Jones (00:51:32): If we had just sound waves connecting us and I wanted you to reproduce the Star of David, I could give you three or four coordinates and you could join it in a jiffy.

Simon Peyton Jones (00:51:42): If I wanted you to reproduce the Mona Lisa, I would need to take a lot longer dictating pixel values. So somehow the Mona Lisa has more information.

Simon Peyton Jones (00:51:50): So when I say more, I mean something quantitative. So then you think, "Well, what units would I measure information in?" Well, bits. So bits are somehow fundamental.

Simon Peyton Jones (00:51:58): This is what I mean by the study of computer science as a subject discipline at school. Now, of course a lot of this gets very deep very quickly.

Simon Peyton Jones (00:52:05): I wouldn't expect that to show up in primary school curriculum. But nevertheless, that's the frame. You want to have a big frame for an educational purpose.

Rob Collie (00:52:12): Yeah. I would've loved to have been exposed to some of the deeper concepts like bits and information density and things like that.

Rob Collie (00:52:21): To have been exposed to that when I was 17 or 16 would've been a really cool culmination of things that would start out with Scratch when I was eight or something, if I was programming in Scratch. I just found it boring. I didn't want to go get exposed to that.

Simon Peyton Jones (00:52:38): I don't just want Scratch and from Scratch we move on to Python. I actually want Excel to be in there. So this would bring all the parts of my life together.

Simon Peyton Jones (00:52:46): Functional programming, Excel, and education will be when we're teaching the first textual programming language that students learn at school after or concurrently as they learn Scratch is Excel, but it's thought of as a programming language, not as a mechanism for doing business plans.

Rob Collie (00:53:04): Okay. How do you do that?

Simon Peyton Jones (00:53:06): Well, if we had lambda's, which we now do in perfectly sheet defined functions, which we might want to talk about, then you can really say, "We're doing some elementary programming here."

Simon Peyton Jones (00:53:14): And you could get students to actually write little programs to do useful things using Excel. Just as with Scratch, they mainly think they're programming a game or something.

Rob Collie (00:53:25): Yes.

Simon Peyton Jones (00:53:25): But incidentally they're learning to program. With Excel, they might be statistically working out the value of pi, but actually they're writing a program.

Rob Collie (00:53:32): That's the thing that I'm really interested in is what are the problems that you can get really anyone interested in with Excel.

Rob Collie (00:53:42): I got to text this morning from a mother that reached out to me on LinkedIn randomly and was asking about what should my daughter do professionally? And she's asking me specifically about things like Power BI and Excel. Because her daughter isn't taking to university.

Rob Collie (00:53:57): I'm increasingly sympathetic to this. The idea that a university program, especially a traditional one, doesn't appeal to everybody. And that doesn't mean that they're not going to be capable through the information age or whatever. They've got a lot to contribute.

Rob Collie (00:54:13): But this university thing is an arbitrary selection criteria in the same way that the PhD would've been a very arbitrary gate for them to have used to keep you out.

Rob Collie (00:54:25): And so the thing I keep telling her is that, yeah, your daughter might be one of these people who really takes to this stuff, but she's going to need some real problems that are interesting to her to apply this technology to.

Rob Collie (00:54:38): Just giving her abstract sample data sets like Adventure Works or whatever and saying work out the blah blah blah is not going to scratch anyone's itch. In that same way I would think that calculating pi would be boring.

Simon Peyton Jones (00:54:51): I don't know. This maybe also depends on the student. The kind of thing I'm thinking of incidentally is that I really like this example because it was always very mysterious to me where pi came from and why is the area of a circle pi R squared?

Simon Peyton Jones (00:55:03): But do the following thought experiment. Imagine a circle of radius one centered at the origin and now draw a square box around it, its sides will have length too.

Simon Peyton Jones (00:55:14): Now imagine throwing dots at this square grid. Choose a random X and a random Y between minus one and plus one. That's your dot. Is it inside the circle or not?

Simon Peyton Jones (00:55:25): Well, that's easy to tell because we can do a bit of pythagoras. Already a useful a little bit of maths, a little bit of calculation you do with your spreadsheet that says, is X squared plus Y squared, is that less than one?

Simon Peyton Jones (00:55:37): So it's inside the circle, otherwise it's not. And then you can just make a big column of random numbers, random Xs and Ys in your spreadsheet. Maybe 10 of them, maybe a 100, maybe 10,000 of them.

Simon Peyton Jones (00:55:47): For each of them you say, is it inside or outside the circle? And the proportion of them that land inside the circle, well of course is the area of the circle divided by the area of the enclosing square, which is two times two, which is four.

Simon Peyton Jones (00:55:58): So you can effectively get an estimate of pi this way. And for me that gives you a much more executable and visceral sense of where pi comes from.

Simon Peyton Jones (00:56:07): Because you see, oh, it has to be R squared, but it's some proportion of those what's R? That's the radius of the circle. So the area of the enclosing square, that's four R squared. So it has to be a proportion of R squared. It has to be something times R squared.

Simon Peyton Jones (00:56:22): But I feel as if we could use spreadsheets in a way that animates or brings to life or makes concrete or executable or experimental stuff that we otherwise would say, "Well, here's the formula for the circle and you can crank the formula up."

Simon Peyton Jones (00:56:35): You don't get any visceral understandings. Be much more visceral sense. And of course then it encourages you to beg the question, well how much position do I get for how many dots?

Simon Peyton Jones (00:56:45): So that's a statistical question that might be quite hard to answer. But the fact that you can try it out and see how many significant places you get is already a step forward.

Rob Collie (00:56:54): So I was semi deliberately baiting you there, right? Calculating pi. How boring. I was halfway expecting that it was going to be essentially what we call the Monte Carlo simulation of calculating pi. Some problems are just so difficult, if you just go and simulate them.

Simon Peyton Jones (00:57:09): Yeah. And it's great to be able to do an experiment. I love the idea of maths being more experimental and playful. So the other connection, just to finish the thought, you said how to make this relevant and interesting and applicable.

Simon Peyton Jones (00:57:20): One thing that we can do today that we really couldn't do 20 years ago is connect to large curated data sources that are external. We can do this from within schools.

Simon Peyton Jones (00:57:30): I think this is a very under exploited resource. There are tons of such ranging from Wiki data to the Office for National Statistics. So there's tons of curated data available that Excel brilliantly and for free can connect to.

Simon Peyton Jones (00:57:43): Now you've got this data source that's actually live in your spreadsheet of muggings in your city. You could plot them on a map or visualize them over time.

Simon Peyton Jones (00:57:52): And you do some things that as built in tools would but if I was a teacher, I'd then be saying, "Okay, so how can we filter out just the ones that are within this distance of this point?"

Simon Peyton Jones (00:58:03): And now you're back to doing a bit of pythagoras. I'd figure out ways of forcing the children to start writing formulae. So soon you are doing a pipeline of data processing operations on them.

Simon Peyton Jones (00:58:12): Before long you're doing programming with data in exactly the way an analyst might do using Power BI. But perhaps using less sophisticated and more visceral tools in Excel.

Rob Collie (00:58:21): There's something about a captive audience when paired with a teacher or a curriculum that has actually been very, very well designed to be appealing to that captive audience. There's a lot of things you can do in that environment.

Rob Collie (00:58:34): But by the time you get to the teenager, you're like a parent trying to get your teen interested in something that you think they would like. They're not quite so captive.

Simon Peyton Jones (00:58:43): Yeah, that's right. I capture it all.

Rob Collie (00:58:47): I've tried a million different things and it turns out that just exposure to real world problems ends up being the most powerful thing.

Rob Collie (00:58:54): I've been working with my son on some things where we're doing remove dupes, trying to whittle down a list and find maximums and things like that.

Rob Collie (00:59:02): And so he's getting into pivot tables, he's getting into remove dupes and Excel tables and everything. And I can see the itch.

Rob Collie (00:59:09): Whereas we're on vacation in Iceland and listening to this playlist that we've made of 60 songs, and I'm the only one that's really interested in this it turns out, how many songs do we have to listen to before we've probably heard them all?

Rob Collie (00:59:22): Assuming some very simple assumptions about how long it'll wait before it repeats a song. Because it was randomly jumping around and we were hearing repeats.

Simon Peyton Jones (00:59:31): Yeah.

Rob Collie (00:59:31): We get to the hotel and I'm sitting down with my son, say, "Okay, let's write the VBA Monte Carlo simulation." Because it turned out to compute this was very difficult, but to simulate it was much easier. I wrote the whole thing with him watching. He didn't care.

Simon Peyton Jones (00:59:48): Yeah, that's right. Just come back to education for a sec. I do think that what's happening in the UK is I think it's pretty exciting. I'm very committed to it and I'm spending some time on it.

Simon Peyton Jones (00:59:58): But it is happening everywhere in the world. So across the planet, including across the United States, teachers and academics and schools are thinking about what does a good computing education look like and how could we deliver it?

Simon Peyton Jones (01:00:12): So in a way the ice has melted. We're not stuck in a rut. Everybody's trying to figure out what does good look like. And moreover, they're quite open to IT professional, software developers and indeed companies like Microsoft or your company or Epic, my company, becoming involved, playing a leadership role.

Simon Peyton Jones (01:00:30): So everybody listening to the podcast, I'd like them to be talking to their local school to think about how can each of us individually contribute to this seismic, because it's a big reorientation of what we think about as good in education, this seismic change in education, at least as far as computing's concerned?

Simon Peyton Jones (01:00:48): So that in 10 years time when we're back to business as usual and something has landed, it's something that we're proud of. But if we just leave it to everybody else, well then something like land that we're not very proud of.

Simon Peyton Jones (01:00:59): If all the people who know about computer science don't pay any attention we're likely to end up with some vandalized version of it. We got to get engaged both individually and I think as companies.

Rob Collie (01:01:09): If a local elementary school would let me come in and teach something in Excel one or two days a month, I would throw myself into designing something that they've found interesting and compelling. Like you say, the curated data sets that are out there. It's not trivial to come up with something to teach them.

Simon Peyton Jones (01:01:27): But I wouldn't start from there, Rob. I would go to your local elementary school, find out who the computing lead is, the person, if anybody, is most responsible for what's taught by way of computing in the school.

Simon Peyton Jones (01:01:38): And sit alongside them and say, "What is your problem? What are the challenges that you face? What do you find difficult and challenging about teacher computing? Are you satisfied with what you're doing or do you think it could be better? And in what ways? And how could I help?"

Simon Peyton Jones (01:01:50): I think that a conversation like that is much more likely to be rewarding and helpful to a teacher because they feel, oh, somebody getting alongside me to try to help me solve my problems rather than to offer me something that I might or might not want.

Simon Peyton Jones (01:02:03): And indeed it's going to take me extra work to figure out whether I do want it. See the difference?

Rob Collie (01:02:07): Yeah. I totally see the difference. And these are two different flavors of how to develop software even, right? There's the I know better, I'm just going to go come up with something. Come on. My goodness, Simon.

Simon Peyton Jones (01:02:19): Yeah. Actually talk to them. Get alongside them. Be their ally.

Rob Collie (01:02:22): Okay. Fine.

Simon Peyton Jones (01:02:23): Tell them how wonderful they are because teachers are wonderful. They do amazing things and many of them are fantastic.

Simon Peyton Jones (01:02:31): And of course, there are duff teachers, but many of them are just amazing and they deserve a lot more respect.

Rob Collie (01:02:36): Agreed.

Simon Peyton Jones (01:02:37): Than they actually get I think.

Rob Collie (01:02:37): You mentioned talking about computer science as computation, information and communication. And so I wanted to do the nerdy thing and say, well, information is a noun. The other two are verbs. Computation and communication.

Simon Peyton Jones (01:02:57): Yes, they are. But they're also objects of study.

Rob Collie (01:03:00): Of course. Yes. It's computation technically-

Simon Peyton Jones (01:03:03): It's like you might say conversation would be an object of study for a social scientist.

Rob Collie (01:03:07): Yeah. So I'm not suggesting that we would rebrand that pitch in the following way. I heard that list and immediately went, "Oh, it's all about information."

Rob Collie (01:03:18): And then the transformation and or improvement of information, which is computation. And then the transmission of information, which is communication.

Rob Collie (01:03:29): When I think of it that way, this is what the brain is about too. Everything that we do, of course, I'm sure that this won't be controversial to you, that the brain is itself a computation engine.

Rob Collie (01:03:39): It's just implemented in a completely different hardware. I spent a lot of time thinking about these sorts of things in college.

Rob Collie (01:03:46): These were the things that were most fascinating to me. And I really couldn't find any courses that were focused on it. But it's so incredibly fundamental and I really, really love that the UK has leaned into this.

Rob Collie (01:03:57): I have very little optimism that the USA will follow suit. Even just the decentralization of it makes it a difficult problem.

Simon Peyton Jones (01:04:04): It does. It does.

Rob Collie (01:04:04): You can do it locally.

Simon Peyton Jones (01:04:06): The organizations in USA they're working hard on this kind of thing. Co.org and the Computer Science Teachers Association and the building curricular and resources.

Simon Peyton Jones (01:04:13): So there's tons going on. What's at the common core and state by state computer science mandates. It's more complicated.

Rob Collie (01:04:20): It very much is. I don't think these would be necessarily relevant or useful in the education of children. There's some very, very, very interesting physical computer sorts of things that some of them present, some of them past.

Rob Collie (01:04:35): I have a 20 kilogram, 50 pound physical mechanical calculator that's just the densest, heaviest object you would ever imagine and all these gears.

Rob Collie (01:04:46): And I've also recently seen a couple of things that tickled me. I saw a picture of an old automobile transmission that had no moving parts. It's a pneumatic circuit board. All of these pathways through it. It looks like a circuit board when it's cut open in profile.

Rob Collie (01:05:04): And it literally used various pressure inputs coming off of the engine to calculate an outgoing pressure to set the transmission gear.

Simon Peyton Jones (01:05:16): So it was a analog computer?

Rob Collie (01:05:17): An analog computer. No moving parts. Just using air pressure. Oh my gosh. That is so cool. And there's also, have you seen, I think they might just be called Tesla valves.

Rob Collie (01:05:28): Have you seen his zero moving part design to make one way flow through a-

Simon Peyton Jones (01:05:35): Tefla?

Rob Collie (01:05:35): Tesla. Like Nikola Tesla. He designed a one way plumbing valve so water will only flow one direction. It won't siphon back. And it has no moving parts.

Simon Peyton Jones (01:05:46): No, right.

Rob Collie (01:05:47): Look that up.

Simon Peyton Jones (01:05:48): No, I'm looking at it now. A valvular conduit. Wow.

Rob Collie (01:05:53): It is a form of analog computer in itself.

Simon Peyton Jones (01:05:56): Interesting.

Rob Collie (01:05:56): It's just brain candy.

Simon Peyton Jones (01:05:58): Yes.

Rob Collie (01:05:59): Doesn't always have a practical application.

Simon Peyton Jones (01:06:03): You might enjoy a game that's available. I think it was maybe developed in the UK. It's called Turing Tumble.

Rob Collie (01:06:09): Okay.

Simon Peyton Jones (01:06:10): Marble game. It does have moving parts, but it has little metal marble and a grid but a grid of little posts and the marbles can fall down, little posts are mounted on a sloping board.

Simon Peyton Jones (01:06:23): And then on the little posts, you mount devices that sometimes can flip from one way or the other and sometimes just push the ball in one way.

Simon Peyton Jones (01:06:31): And it turns out that with a couple of dozen of these devices, you can build counters and norgates and things. So you can literally build a full adder out of mechanical parts and you can watch it adding as you drop more and more balls down.

Rob Collie (01:06:45): That's amazing.

Simon Peyton Jones (01:06:47): So I even bought it. It cost me £60 and could I persuade my children to play with it? I cannot persuade them. I'm the only one who's played with it. It's very annoying.

Rob Collie (01:06:57): Have you seen the board game RoboRally?

Simon Peyton Jones (01:07:00): No, I don't think that one.

Rob Collie (01:07:02): So that one reminded me a lot of what you were talking about with Scratch. So RoboRally, you essentially program ahead of time what your robot's going to do on each move with a sequence of card tiles.

Rob Collie (01:07:18): Even for an adult like me who spent a reasonable amount of his time programming in his life, I found this game to be very unpredictably challenging.

Rob Collie (01:07:28): I don't know if they've made an electronic version of RoboRally. Many board games have been turned into online board games.

Rob Collie (01:07:35): An electronic version of RoboRally might actually end up being an interesting teaching tool for a certain age group. I can't imagine the board game itself being great in a school environment. You lose pieces and all that stuff.

Rob Collie (01:07:47): But of course you have nothing to show for it afterwards. You've played a game, you haven't built anything.

Simon Peyton Jones (01:07:52): One of Scratch's is most amazing things, one reason it's so incredibly popular is because as soon as you built something, you put it in the cloud and other people can use it.

Simon Peyton Jones (01:08:00): And moreover, it's very open source. Everything. You cannot have a closed source game. You just look at somebody else's game, you press remix and effectively you clone a copy of it that you can then modify.

Rob Collie (01:08:10): Oh, I think that's awesome. Brings that sharing and social media.

Simon Peyton Jones (01:08:15): Yeah, exactly.

Rob Collie (01:08:16): Yeah. So RoboRally doesn't hold a candle to it. There's a lot of board games like that now though, where you're essentially programming future steps.

Rob Collie (01:08:24): We played one recently where there's a collaborative game against the AI and you're all writing programs, but there's random chance introduced into your programs.

Rob Collie (01:08:34): So certain steps will get deleted. The next thing you know your character's going the wrong way on the board or whatever. Good chaotic fun. We've covered a lot of ground. Oh, you're designing a new programming language.

Simon Peyton Jones (01:08:45): Yes.

Rob Collie (01:08:46): Let's talk about that and working for a games company, but not on games.

Simon Peyton Jones (01:08:53): Not on games, not directly. I'm working on the language in which you will program games.

Rob Collie (01:08:57): Okay. So how did this come to pass and what is it?

Simon Peyton Jones (01:09:00): Epic Games is a company of about 4,000 plus people founded and still run by Tim Sweeney, who is a computer scientist really, largely self taught computer scientist, but an extremely smart one.

Simon Peyton Jones (01:09:11): So he was the originator and author of the Unreal Engine, which is Epic's core piece of intellectual property on which everything else is built.

Simon Peyton Jones (01:09:18): Fortnite, for example, runs on the Unreal Engine and it's been wildly successful, which is why Epic's growing smartly and can afford to just employ parasites like me.

Simon Peyton Jones (01:09:27): So Tim wants to have a programming language in which both programmers and in due course end users describe the behavior of their pieces of virtual reality.

Simon Peyton Jones (01:09:37): So Epic sees itself not primarily as a games company in the end, but as a virtual reality company.

Rob Collie (01:09:41): Okay.

Simon Peyton Jones (01:09:42): Right. So Unreal has a big physics engine. You can program any virtual reality. You can walk through buildings you haven't built yet or design cars, but everything needs to be programmed. You've got to program it in some language.

Simon Peyton Jones (01:09:52): And so that language is going to be Verse. But Tim, he's been busy running a company and running like crazy for the last few years, but he's been designing in his head this programming language for the last 10 or 15 years.

Simon Peyton Jones (01:10:03): My job and the job my colleagues, Lermit Augisson and some others, is to reverse engineer Verse out of Tim's head. Because after all, if we're going to build an implementation of Verse, it's no good just saying, "I wonder what this program does. We better ask Tim." That doesn't scale very well.

Simon Peyton Jones (01:10:19): If you need a language, you need a blooming language specification. But it turns out that Verse is not just a functional language, it's a functional logic language.

Simon Peyton Jones (01:10:27): So if you think functional programming is niche, functional logic programming is even more exotic. But Verse, because it has this very big built in user base, I think Verse is going to kick functional logic programming from a corner of the programming language space into mainstream.

Rob Collie (01:10:40): In the same way that Excel brought functional?

Simon Peyton Jones (01:10:43): Exactly. Yeah. So that's quite an exciting prospectus. And Tim's design is very interesting. And the name of the game now is to try to use all the toolbox of techniques of how to precisely describe programming language of semantics and denotational semantics and rewrite systems and operational semantics and comparative technology and verification technology.

Simon Peyton Jones (01:11:04): And apply all of that to Verse and get a precise specification. And then that will in turn feed into what the implementation looks like.

Simon Peyton Jones (01:11:11): The initial implementation will be of other small subset, not the full glory of Verse in Tim's mind, but a small subset. And then we'll grow that.

Simon Peyton Jones (01:11:20): Meanwhile, we're busy writing papers, which we'll publish openly. There's nothing secret about Verse, it's just that we haven't until now, until fairly recently, we haven't really had anything to say that we could feel sufficiently proud of to show to anybody else.

Simon Peyton Jones (01:11:33): But we're getting past that stage now. We're getting stuff that we can show to other people. Writing papers, making conference submissions.

Simon Peyton Jones (01:11:39): So I hope that there'll be a lot more information about Verse will be coming out. I'm very keen that we should engage in a dialogue with the programming language community, both academic and industrial, about what Verse might look like and what's good about it and what's not so good about it. And idea is hopefully before it all gets set in stone.

Rob Collie (01:11:56): What is its intended purpose? It's clearly meant to do something that either other languages can't do or that aren't very appropriate for. Is it meant to be like a better everything language?

Simon Peyton Jones (01:12:10): I think it's mainly a better everything language really.

Rob Collie (01:12:13): Okay.

Simon Peyton Jones (01:12:13): Yeah. We could use Python for this purpose, or Lua. Roblox uses Lua for this purpose, modifying and upgrading, giving a type system to Lua.

Simon Peyton Jones (01:12:21): But basically they're taking on an existing language and repurposing it a bit. Tim's being more ambitious by starting a whole new language.

Simon Peyton Jones (01:12:28): But I think there's no utter killer reason why we have to have a new language. But Verse is certainly a very interesting one. Very deeply built in transactional memory, for example, that I think is not very well suited to the conventional imperative programming paradigm. That's an interesting story in its own right.

Simon Peyton Jones (01:12:46): Did you ever read Joe Duffy's blog about transactional memory at Microsoft?

Rob Collie (01:12:49): No. Definitely not.

Simon Peyton Jones (01:12:50): Joe Duffy was the right at the heart of Microsoft's attempt to, we built a whole SDK for transactional memory. So the idea of transactional memory is just as a database, you can remove a record from there, put one in there and change this and that, and then do all of that in one transaction.

Simon Peyton Jones (01:13:03): Maybe you could do the same with memory and this could be a way in which two different threads in a concurrent imperative system could talk to each other.

Simon Peyton Jones (01:13:12): So instead of taking two locks and modifying something and worrying about whether you get deadlock. You instead just say, "Atomically read that and write that. Blam."

Simon Peyton Jones (01:13:20): So there was a lot of heated noise about this in the 2000s. But it turns out that it's very difficult to make that paradigm work sufficiently smoothly and sufficiently performantly if you use an imperative language.

Rob Collie (01:13:33): Okay.

Simon Peyton Jones (01:13:33): Because in an imperative language, these mutations, the very thing that transactional memory must track, are the fabric of computations so they're extremely common.

Simon Peyton Jones (01:13:42): But if you program in a functional language, then mutations are the exception, not the rule. So tracking them as transactional memory must do is much cheaper. So there is, I think a good reason.

Rob Collie (01:13:56): That's awesome.

Simon Peyton Jones (01:13:57): Gaming environments are a lot about lots of interacting things. So two characters, if they're in different parts of the world, they don't interact with each other at all.

Simon Peyton Jones (01:14:05): When they come close to each other, they may interact more, but they're independent. You could think of them as independent concurrent threads and they are mutating the world.

Simon Peyton Jones (01:14:12): If they put a block somewhere that the other guys meant to trip over it, there is some shared state there that is part of what you are trying to achieve.

Simon Peyton Jones (01:14:20): But we want to achieve that in a transactional way. But having a functional language is the basis. Makes it a functional logic language, makes it much easier to achieve that I think.

Rob Collie (01:14:27): This is a core problem in software in today's era, because it wasn't that long ago where the CPU in your computer, it was just one CPU.

Rob Collie (01:14:39): It would process literally one thing at a time. It only had one core as recent as like 2007 that Excel finally became able to take advantage of more than one core in the CPU and be able to run things in parallel.

Rob Collie (01:14:56): And given that it used to be that you could make CPUs faster every year just by making the single core faster, we ran up against the limits of that. And so now it's gone parallel.

Rob Collie (01:15:08): The way to bring more computing power to bear is to bring more concurrent cores to bear on the problem. And this leads to a tremendous explosion in complexity of writing software.

Simon Peyton Jones (01:15:21): Oh, yeah.

Rob Collie (01:15:21): Writing multi-threaded software is next level difficulty. There are many, many, many professional developers who are otherwise incredibly competent, who when they get into the deep end of the pool of writing multi threaded software, they hit the wall. And so it sounds like Verse might make multi threaded computing more accessible.

Simon Peyton Jones (01:15:42): So for multi threaded computing, yes, and the whole game area is inherently multi threaded.

Rob Collie (01:15:47): Massively multi threaded. Yeah.

Simon Peyton Jones (01:15:50): The base starting point is not something you add later. It's a place you start, all these little characters and objects and machines are doing things by themselves.

Simon Peyton Jones (01:15:57): But what it isn't is parallelism for the sake of performance. That was where you started. We came across the performance wars, we have multi threads, they're the goal of parallelism is to gain performance for what would be most easily written as a single threaded program in the gaming world and indeed in lots of other applications.

Simon Peyton Jones (01:16:13): The programming is inherently multi threaded. And the name of the game is to try to make the bits that need to interact interact a way that is one, easy to program and two, performance enough.

Simon Peyton Jones (01:16:25): That's the target for Verse, I think. I don't think Verse particularly in the business of HPC, high performance computing. That's a very high bar to jump and a lot of people have worked really hard on things like that.

Rob Collie (01:16:34): Yeah, okay. Well, my dream of becoming a multi threaded high performance computing software developer just dashed on the rocks.

Simon Peyton Jones (01:16:41): But multi-threaded, absolutely. Yeah. And transactional memory really is the way to go though. Interestingly, transactional memory comes out of the box with Haskell and we get very few bug reports about it.

Simon Peyton Jones (01:16:50): People use it a lot. It's a standard way for multi threaded programs in Haskell to interact with each other. It's incredibly robust and efficient and it's amazing.

Simon Peyton Jones (01:16:58): And there's no other in no imperative language that I think does STM come out of the box. And indeed, as I was saying, Microsoft having put a lot of effort into it, ended up withdrawing from that as a plan.

Rob Collie (01:17:09): Even things like that, failures like that are still information. They advance the state of the art.

Simon Peyton Jones (01:17:14): We wouldn't regard it as a failure. I would regard as a good faith, intellectual adventure.

Rob Collie (01:17:18): And we came out of that going, "Okay. At least with imperative programming language, we did not find this to be attractable problem."

Rob Collie (01:17:26): And it does, it leads to additional ways of thinking later, doesn't it?

Simon Peyton Jones (01:17:29): Yeah.

Rob Collie (01:17:29): Well that's amazing. What a wide range of things.

Simon Peyton Jones (01:17:32): It's a lot of fun and Epic very generously willing to let me continue to do some work in education, continue to do some work on Haskell and GHC and functional programming research and work on this Verse programming language. So I feel very fortunate in having landed on a good perch.

Rob Collie (01:17:45): Yeah. What a stimulating mix of things to be thinking about.

Simon Peyton Jones (01:17:48): Yeah.

Rob Collie (01:17:49): Do you multitask all of that in a single day? Or do you say, "Okay, today I'm going to do X and tomorrow." How do you do your processor scheduling?

Simon Peyton Jones (01:17:57): Probably, yes, in any one day I'll probably have one main thing. Some tasks reward sustained thinking time and some you just need to keep plates spinning, right?

Simon Peyton Jones (01:18:04): Just do a little bit now, a little bit there. So I tend to do a little bit on two of those three things and a lot on one of the others, on the third.

Rob Collie (01:18:12): Well, Simon, thank you so much. I really appreciate you taking the time to talk with us. It's great catching up.

Simon Peyton Jones (01:18:17): Been a lot of fun.

Rob Collie (01:18:18): Oh my goodness are you involved in a bunch of cool things.

Simon Peyton Jones (01:18:22): Well, I feel very fortunate actually to be so.

Rob Collie (01:18:25): Yeah. Yeah. It's that intersection of opportunity, passion, and talent. If you keep bouncing around, you tend to stop in places that you like, the random walk thing.

Rob Collie (01:18:33): If you keep moving and you keep an open mind, you're going to find really cool things to do in your life. So I can't think of a better example of that than the path that you followed.

Simon Peyton Jones (01:18:41): I gave a talk to, as part of one of these honorary degrees, I had to give a talk to 500 graduates who are just graduating, inspirational talk thing. It's quite a hard thing to do actually.

Simon Peyton Jones (01:18:52): But one of the things I said to them is that you may look as if the people you admire are cruising through life in a very thoughtful way, and actually they're all making it up as they go along.

Simon Peyton Jones (01:19:01): Most of it happened by accident, but that if many things happen to you by accident, then you want to put yourself in the position of being a person to whom accidents happen a lot.

Rob Collie (01:19:11): Yeah. And that you're prepared to bounce off of those accidents.

Simon Peyton Jones (01:19:15): Carpe diem mean taking risks. Risks that you could manage. But we're fortunate to be in a profession in which risk taking is possible.

Simon Peyton Jones (01:19:23): The very fact that I'm in computer science means that I can work for a company that is profitable enough to allow somebody like me to have a lot of freedom in what I do. I think we're very fortunate in that, shouldn't take it for granted.

Rob Collie (01:19:32): And there are other professions where taking risks mean you lose an arm.

Simon Peyton Jones (01:19:36): Exactly. Yeah. Yeah.

Rob Collie (01:19:39): All right. Well, again, thank you so much.

Simon Peyton Jones (01:19:40): Great.

Speaker 3 (01:19:41): Thanks for listening to the Raw Data by P3 Adaptive podcast. Let the experts at P3 Adaptive help your business. Just go to P3adaptive.com. Have a day today.

Check out other popular episodes

Get in touch with a P3 team member

  • This field is hidden when viewing the form
  • This field is hidden when viewing the form
  • This field is for validation purposes and should be left unchanged.

Subscribe on your favorite platform.