06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Hacker Culture · Lobsters · · 10:13:03 runtime

Haskell: origins, evolution, and future

Comments

In the wiki Julia
Transcript 7511 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

Okay, welcome everybody. Welcome to Germany. Welcome to Mines and welcome to Ger Julia Con 2026. It's great to have you all here and uh yeah, it's my pleasure to hold this opening ceremony. I want to hold it short because I mean you're mainly here for the main conference program. So, let's get started. Uh first of all, of course, thank you all for being here. It's great to have so many people here. Without you, Julia Con wouldn't be possible, but also Julia Con wouldn't be possible without all of our sponsors and in particular also our local volunteers, the organizers, the finance chair, the program committee, and everybody else.

So, let's thank all of these people who made Julia Con possible at all. Thank you,

[applause] Ben. It's great to have you here. So, you already know at least where this building is. And I see also a lot of badges. So, you found some other building. We have campus plans like this one here uh scattered uh around in the

rooms. So, for example, here this green room building is the one where you've got your badges. We will also have coffee break in there. We will have a room HS1 reserved if you just want to talk to people and uh you can do so in that room. It's in the same building over here. We will also have two lecture halls over there. So after the keynote, people can go over there. Then we have a few keynotes over here. It's the building directly next to our tent here in this direction. Uh there are three rooms N1 and two and three with a lot of talks. Then we have the big tent. All of the keynotes will be in here. And then if you follow along the same street and you walk over here, you go to the canteen where we will have lunch. So you have got received these vouchers, the blue ones. You can get lunch over there at counter three and counter four and it's a menu. So, you get a soup and you get a main dish and a salad, a dessert, and you can grab a bottle of water or something to drink like that.

If you arrived already on Monday or even earlier, you may have missed the Julia stickers that we uh distribute there. So, you can go back to the um Altomenza, the green building where the registration desk is, and grab some stickers that you may want to have. Yeah. So here we are. Um

then there are some things that I would like to know or to tell you. First of all, I mean Julia is a great software and that's one part why we're all here. But the other important part is that the community is a great community. It's great to have so many people here. So please let's continue this. Let's make it a welcoming and great experience for everybody. Adhere to our code of conduct, the Julon code of conduct, the dual community code of conduct, nim focus and so on and so forth. Then there's something else. The schedule. I mean you're here so you know about the schedule. Um there may have been some last minute changes. So just in case please check the schedule online. Um you can do so also using the Juliaon.jl package at least if you wait maybe a little bit until the uh package servers have been updated. Right now you can add it only if you add it at the specific tag of it but then it will also work and it will tell you what you can see where and so on. Uh then a few additional things we will have the conference picture. So you see we have a photographer around here for today and uh we will also take a conference picture. It is happening this afternoon.

It's at half past 5 and the conference picture will be taken over there at the building where the registration is. So there there are a few stairs. Please be there half past 5 for the conference picture. Then a few additional uh special things on the agenda. We have a poster session happening tomorrow afternoon, tomorrow evening. Um it is after the last keynote

after the talks. So there's nothing in parallel to the poster session on Thursday. And we will also have some catering, some food, something to drink for uh all of this poster session. It's in the same building as the registration desk. During the conference, uh in the room next to the registration desk, we will also have some food like cakes and cookies and fruits and so on. Uh so during the coffee breaks, you can go over there, find something to drink, find some coffee and just chat to people and uh enjoy the conference. And then after the main part of the conference, the talks on Saturday, we'll also have another big part of it, the hackathon.

So you can stay here. Uh the hackathon will be mainly hosted in the same building as the registration. So it's everything over there. Uh in one of the rooms we will have uh chairs, we will have tables though you can sit down and work together. And for catering we don't have anything special for that. You just need to go out of the building and if you go down the stairs on the right hand side there's a beer garden which will be opened where you can buy something to drink, something to eat during the hackathon. Then uh yeah photographer I already told you about that. If you want to take some pictures on your own for example same building where the registration desk is we have a photo wall in there so you can take some photos there please feel free to share them and uh yeah I don't know if you want to take a photo on your own share it on LinkedIn or whatever or share it with the organizers share it on Slack Zulip so that we can also advertise Julon better and then Julacon will be streamed on YouTube as we did in the last years. So the live streams include all the talks that we have starting today until Friday. The live streams didn't include the workshops that we had yesterday and the day before but everything that's going on now will be live streamed and it will also be uh on YouTube visible for everybody around the world and uh yeah some sessions like

for example the buffs will not be livereamed but all the talks and the main things will be there. So this also means for you uh if there are questions in the audience I mean here um if there are questions at the end you can just raise your hand and then shout loud enough so that everybody here in the room at least understands your question or at least the person standing in front of you can understand it but for everybody giving a talk and answering them questions because we want the online audience to also be able to understand the question. Please first repeat the question and then answer it so that everybody understands what's going on, what was asked.

And uh for live streams, well, we just mentioned questions. This means you must leave room for questions in your talk, right? So if you have a talk of 15 minutes, please reserve at least three minutes for the questions. If you have a longer talk for half an hour, please reserve at least five minutes for questions so that there can be some interaction because interaction is why we are here, right? So otherwise you could just be on YouTube and watch it. We are here for the interaction. So please leave room for questions in your talks. The session chairs will also have some cards maybe to really show you.

Okay, five minutes left or 10 minutes left and you must stop now. And please really if you they show you the sign stop now then you really stop. Are there any last minute questions from your side?

Doesn't seem to be the case. Great. So

thank you again. And now it's time for our first keynote speaker today. It's uh Simon Peter Jones. You can see him over there. and he will come up to the stage immediately. He's very well known in the computer science community in particular for a functional programming and today I'm really excited to have him here to talk about Haskell origins evolution and future. Thank you. >> Thanks. [clears throat] Um how long timing is perfectly fine. including questions. >> And now including questions. Good. Yeah. Okay. Uh

All right.

Good morning, Julia Con. WHOA.

>> [applause] >> I BRING YOU greetings from your brothers and sisters in the land of Haskell and I have come to dwell in the belly of the Julia beast. So I'm going to uh learn a lot about Julia in the next 48 hours. Um, but I've been asked by the program committee to um speak to you a bit about Haskell, which the language that um I help design and to tell you a bit about its um how it came to be, some of the human stories behind it and uh and where it's going um and what's what's important and interesting about it. So, uh, as I'm speaking, it will be more fun for me if you, um, ask questions or or, um, uh, as we went along, you know, I want to see your eyes and I will, uh, keep an eye on you and we can have quick questions for clarification as we go.

You don't need to save them up to the end and that would reassure me that you are actually listening to me. Okay? All right. So, I want to take you back a long way to 1976.

50 years ago, John Hughes and I went to Cambridge University to study mathematics. Um, at that stage, 4 kilobytes was a lot of memory. The university had one computer um that we could was a big-time show in computer u which we used a night exclusively. Uh John was a very good mathematician, had no problem with math. I was a terrible mathematician, had great problems with math, ended up doing electronics. At the time we learned about functional programming from a guy called Arthur Norman who was a professor there and we learned about bits about this weird idea about programming without assignment which seemed completely bizarre to us at the time and at that time also a guy called David Turner was writing papers about so-called SK combinators as a way of executing functional programs. I think I'm going to have more fun down here uh if that's all right. And um and there was also a big buzz around lazy functional programming in the United States with Dan Friedman, David Weise.

There was a big research group at MIT doing data flow architectures and something called the the id language and the monsoon processor. There was a lot that was sort of in the air. So we inhaled deeply and we were intoxicated.

And then this remember we were like 19 at the time. So it's easier to intoxicate 19 year olds. Um at that time then John Bakus the guy who invented Fortran or one of the guys who invented Fortran um got the ACM Turing award which is like the Nobel Prize for computer science and his talk at the Turing Turing award lecture was this can programming be liberated from the vonoman style and he was essentially advocating functional pro the guy who invented this extremely imperative low-level language for China was saying no no no functional programming is way of the future. Moreover, he said we should design new computer architectures

to execute those programs.

Can you see how excited that was? He was kind of coming, guys, let's reinvent programming and let's reinvent computers. So, we became uh John Bakus's

prophets. You he was God and we were his prophets in the wilderness and he was saying, you know, have no truck with the grubby compromises of imperative programming. let's just transform the world with functional product. So this is very exciting very exciting. So um what then happens there was a lot of chaos lots of research groups around the country. By this time I'd left I was working in a small company though I came back to university in about 19 uh 84 or

so. Um lots of functional programming languages were designed lots of bright young things in different research groups. There was even there were new conferences. There was even a conference called functional programming and computer architecture. That was the title of the content. Do you see how much we were we put in our minds together a new way of programming and a new way of building computers? That was pretty exciting. Um, so it was all a bit chaotic and fun. Uh so then a bunch of us met at FPCA in when was it 1987

and what we discovered is that we'd all been designing you know we'd had our research groups and we design our own languages and we thought if only we could share a common language then our different implementations of compilers could share this common language that would be sensible right and at that stage we thought there was a pretty good consensus about what that language should look like it was embodied by languages like ML or Miranda and Sassle so there was quite a bit parametric polymorphism algebraic data types, that kind of thing. But the rallying cry was laziness. So we were the lazy guys. There was a bunch over here there was a bunch of strict guys who were doing ML and Lisp and so forth and we liked them but we were excited about laziness. So uh Haskell was going to be a lazy language freely freely available uh really a laboratory for extending ideas.

Right? So it took us we thought it would take us about two weeks to design this language. It took two and a half years and um and then we produced the the Haskell report. Okay. So this is remember uh 36 years ago. 36 years ago.

So Haspel is kind of middle-aged. Julia, you guys, you're you're teenagers, right? [laughter] So it's interesting to uh so we're going to compare these languages a little bit. Another thing that happened to me at that time was I moved from UCL to Glasgow. Glasgow computer science department at that time had John Hughes and Phil Wadler and Mary Sturan and astonishingly they hired me as well. I had no PhD. I had one published paper but I got hired as a professor. That wasn't that amazing. It was at a time when there was a shortage of computer science faculty. So if you had a pulse you could get hired and apparently I had a pulse. Um

so there was pretty exciting time at Glasgow. It was a very fertile moment. This picture at the bottom actually is me. You can see me in the picture. This is like uh only five years ago when um at an education computing education it felt because I'm quite involved in computing education but anyway Glasgow was very influential on me and there was a particular moment at which these these particular group of people came together did a lot Glasgow is not so much in functional programming also in 1990 very important to me my son Michael was born. These are my three delightful birth children. I have three um younger adopted children but this is Megan, Michael and Sarah. Michael, it was born in 1990, the same year as Haskell.

And 36 years later, his professional job

is programming in Haskell. I think that's the most deep compliment a son can pay to his father. I'm very touched by it. He works for a company called Circuit Hub. Okay. Uh here's Haskell the cat. So even our cats were named after programming language languages. This is Haskell Alas. now um

dead. But our new cat is called Scratch. Not I'm sorry, Julia. That next cat maybe. Uh current cat is called Scratch. Also Ginger. Now when you design a

programming language, it is a risky endeavor. What happens to most programming languages? They get one user and they last a year or two. This is I mean languages are easy to invent, right? Um so uh vertical access is the time horizontal and number of users vertical. Okay. So uh what happens to successful academic languages? They you

know get a few hundred users and die but they they just die more slowly essentially. Uh what happens to um languages like C++ and Pearl and Java and Ruby? They pass what I call here the threshold of immortality at which they can no longer be allowed to die. Um so cobalt is here as well. Um now uh uh I guess I'm interested. I have not plotted this graph for um uh for um

uh Julia. I don't know what it would look like for Julia. Uh this is committee languages. Now Haskell as you've got was designed by a committee, a group of about 25 people. Committee languages tend to have no users ever.

So but this is what's happened to Haskell, right? So we've sort of grown slowly over time. a bit of a plateau at times but I think gentle growth and this is a very unusual trajectory and uh also

it's a very long one this remember Haskell was born before Java right probably most of you were born after Java you just thought it came you know with the atmosphere no Java said little Johnny come lately right hasll is truly ancient Julia is sort of somewhere on here as well so this is what happens to programming languages now I had a look at langpop.com the sort of website that gathers you uh GitHub things and sees how many people are using what kind of programming languages. And here's the table from a few days ago. Um and interestingly enough, Haskell and Julia A on the chart, which is pretty amazing, right?

So hence the you know the uh we we haven't we're not dead yet. Um and B are adjacent to each other. So that's rather lovely, right? Um and C are at the bottom of the chart. [laughter] So um I think there's a lot to lot to like here actually. We're sort of have a solid following, fairly nichy. So, um, what is similar about our languages? Well, it's very noticeable that both in the Julio community and in the Haskell community, there's a lot of passion and enthusiasm about there sort of missiondriven languages. I was talking to um Viral and Valentin today describing how in Julia you just want to get stuff done, but the I I I read some of the um uh the earlier posts about Julia. Uh what was this one? we in inexcusably greedy. We want to have it all right then. [laughter] And so we just went off and designed Julia to do that. That's a that's a missiondriven um language. So our mission was take one

idea that of laziness and explore it. Right? So a bit of a different mission. Your mission was get stuff done. Our mission was let's have fun with laziness. But they they sort of have come back together in a way. I've also put joyful here because one of the compliments that I most love when people tell me about Haskell. It's not that it's a very interesting type system, but I just love programming in Haskell and I know that you guys love programming in Julia. It sort of makes you feel good about yourself to write code rather than just getting the job done. It's actually fun. Um so uh and here this is one fairly recent blog post actually from somebody who describes Haskell as making him think in a different way about the entire enterprise of programming. Yes.

>> Would you share for us your definition of laziness? >> Oh would I share my definition of laziness? I'm going to I've got a whole section about that. Yes. So we're going to talk a lot about laziness. Um okay. Uh anything else at the moment? Um, another thing that we share in common is I think both both of us lack a single

controlling corporate sponsor. So controlling typically bad thing, right? So that gives us a lot of scope for anarchy and we can develop things the way we want. But on the other hand, we have no money. Um, I'll come back to that at the end. That's a bit of a problem. Okay. So these are similarities between the languages. Here are differences. I don't know. This is just my little analysis based on a fairly superficial um analysis. What what have I done here? So Haskell was designed as a general purpose language whereas Julia really came out of a particular application area engineering and science applications that is and many of you here I believe are engineers and scientists primarily rather than computer scientists. Is that true? Hands up engineers and scientists. Yes. See look at that mostly. Wow. So you're very brave coming here to talk about ascll.

It's very good. Um so hasll is a bit different right? General purpose no killer app. Um so one thing that's important about HA hasll is it's I think of it as a laboratory in which to explore ideas. Um whereas Julius clearly

gets stuff done. Um uh for Haskell I work really hard. I spend hours and days weeks years working on performance but hasll in the Haskell world performance is nice. In Julie world, performance is it's all about that's what you have to have, right? That was the thing we want to have all this expressiveness, but we must have performance. Uh what's this? Oh, this was Valentin who when I had a I had a 45minute conversation with him two weeks ago that turned into two hours. Um but one of the things he said that I wrote down was in Haskell um you uh

you're trying to prove that despite static typing, we can still make programmers productive. So I don't really agree with that. I think static typing makes me productive but nevertheless this is Valentin's quotes right whereas in Haskell despite the dynamic dispatch we can still make it fast so in both cases trying to prove something hasll is remorselessly pure we're going to talk quite a bit about purity and laziness um was uh Julia isn't in it it's it has a strong functional encouragement but is an imperative language um and type classes and multiple dispatch are different ways of thinking about the same kind of territory we're going to talk a bit about that too I also uh you may be uh interested in this. I I got Claude to help me count the lines of code in GHC my compiler hasll and in Julia. So GHC remember is 36 years old.

The code base it is the same codebase that we started 36 years ago. It's now 300 odd thousand lines of Haskell code

and uh the Julia compiler is 100,000 odd lines of Julia and C++ code something

like that. Yes, I've looked at the the comments are interesting, right? We have lots of comments, long notes. Um, so you

can see the proportion of comments here. It's very um different. Uh the runtime system, it's actually surprisingly similar. I'm quite that GHC's runtime system is written in C. Um and uh there's a bit about runtimes. Yes. So there you go. So it's just a uh the here I should just say the the compiler part, but the compiler part I know it's a bit of blurry, right? A lot happens at runtime in Julia. So I think we counted type checking as compiler. Um and dock

strings count as comments. They count as comments. Yes. Okay. Good. That's just a little bit of uh so but we're the same kind of territory. It's not it's not 30 million lines of code nor is it 3,000 lines of code like a single person. So clearly these have to be multi-person community projects that involve a lot of people. Okay. So far so good. Now I want to talk a little bit about what I think makes Haskell an interesting. I talked about it being a laboratory. What's the laboratory for? It's for exploring ideas. What ideas? So I'm going to talk a little bit about that. Anybody got any other questions so far?

Try to look excited. Um okay. So he'll be Was that somebody? Yes.

>> Many have many comments that what >> you show us. We have a high percentage of comments. But these are not just comments. It's easy to add many comments, right? >> Yeah. >> These are good comments in Haskell. That's what my experience. >> Mhm. [clears throat] >> How do we get that? >> Oh, the question is how do we make sure that the comments in the source code of the Haskell compiler are good comments. Well, so this is a cultural thing in part. So in if you look at GHC source code just it's on it's on GitHub, you'll see that it search for note something.

There's a standard form for these comments. uh because often you want to write a comment that isn't about one line of code, it's about the design of a little feature or something. So we write a note, underline it, and then you describe what's going on and the moving parts and you point off to the code and you can point back to the note. That's a sort of culturally embedded idea. And when anybody does code review, very often a comment will be, can you please write a note that describes the design of the fix that you have just put in and so there's a sort of positive feedback loop and then the reviewer will read that note first and they say, I didn't understand it. I'm not looking at any code until I Yeah, but a bit cultural, I suppose. Anyone else?

>> Uh oh. Yes. Hello.

>> What happened to Lisp? Oh, what happened to Lisp? So, Lisp was definitely part of this um you know, this uh nexus of excitement around, you know, in the 1970s. uh and lisp is um lisp is a uh

came um uh uh is alive and well today in

various forms particularly scheme and racket there's a there's a programming environment called racket that is really scheme um which has a lot it's probably got a community that's as big as Julia's community maybe bigger so scheme is very much alive and well common lisp is alive and well I know le less about it so lisp has continued to evolve in in some ways it's the great granddaddy of uh oh I forgot to tell you about computer architectures back in 7s a company another part of excitement was symbolics was designing lisp machines actual hardware designed to execute lisp but as

it turned out all these exciting ideas that John backas put in our heads about designing hardware to execute functional languages you know execute SK combinators in hardware bad idea bad idea it turns out all we were doing was we were building hardware to interpret at runtime stuff that could be done at compile time. That's always bad, right? So, it turned out that all these new architectures were doomed. x86

just won. Partly because it's very difficult to compete with hundreds of billions of dollars being spent on uh you know very advanced silicut design, but partly I think because it's genuinely the case that um um uh you should do a lot of work at compile time. That means you don't have to do work at runtime. Yeah. Okay. All right. All right. What's good about Haskell? I got three things. One, keep faith with some deep simple principles. Two, be a joyful laboratory. Three, um, uh, uh, oh, this

is sort of why why it's still so why it's still active. Three, uh, that it's increasingly good as time has evolved, has got better at getting stuff done. We have a kind of informal motto that says in avoid success at all costs, right? And that can bracket two ways. It can mean like at this first one avoid success at all costs. That is do not compromise your deep simple principles in order to get stuff done. Right? But you can also brack it is um avoid success at all costs. And that's to do

with not passing through the threshold of immortality so that you can no longer change your language because there's too much code written in it. Right? The more successful you are, the harder it is to change. We're beginning to experience that. I don't know. You have to tell me later about whether you are. Um, so um, uh, let me see. I've got some a few quot I think I'm going to skip these quotes over here. I rather like the idea. I can only conclude that Haskell is a mimetic virus and monad of the eggs it lays in innocent programmers minds to entice others to become infected. These are all sort of, you know, nerdy enthusiasts.

Um, okay. Now, um, uh, let's see. Um, I

think I'm going to skip this too because I've said it more or less. um except to say that now this avoid success at all cost thing, we're not doing so well on that. Haskell has become more successful. Um and I'm pleased about that. But it has meant that I spent a lot more time thinking about backward compatibility than ever I did before. You know, 20 years ago, I just add something to the compiler and say um suck it up. And in fact, the um and and and users did. We once released a version of GHC and 3 weeks later I got a message from somebody saying, "Did you know that on Windows if you compile a module that's in a different directory than your current working directory?" So you say ghc- c fu/bar.hs,

then if there's a type error, ghc will print out the error and delete the source code. [laughter] Bad programmer. I do not want to see that program again. You might think that he but the user would say, you know, you guys are just a sh I hate you all. But no, he said, don't worry about it. I've just got a job that copies all the source code to a new place before I compile every time. So, we had those kind of users. Sadly, those kind of users are no more. It turned out that the um there's every compiler has a kill list of temporary files that it deletes and somehow the source code had ended up on the kill list. Um so, it's a bit a little bit sad, a little bit embarrassing, but it was quite funny. Um okay now um I talked about deep simple

principles. Let me tell you what I think they are. Number one a tiny core language. Number two purity and laziness. Number three types. Okay so let's talk about those three in turn. Tiny core language. What do I mean? G hasll is a very large language. If you

look at its abstract syntax tree it has dozens of data types each of which has dozens of constructors. That is a big language. But what happens inside GHC is

that entire big language gets compiled to a really really small language called

system FC. And system FC is a statically

typed language. Now um here it is. This is the data type for taken from the source code of the compiler today into which every Haskell program is compiled. Look at this. Expressions have just these one. How many is it? 6 7 8 9 10. 10 constructors. That's all. That's a really small data type. Um, and moreover, this language is statically typed. I think GHC is, as far as I know, the only compiler in the world that maintains a static type system right the way through the optimization pipeline right up to the back end. So, it means that of course it doesn't need to be statically typed because if the compiler is correct, then if it's correctly typed at the beginning, it'll be correctly typed at the end, right?

But is the compiler always correct? Alas, no. So this is a very powerful uh

check on the compiler. Instead of waiting until your program says set fault, you get a a uh you know pass three produce the type incorrect program. That's fantastically helpful. Fantastically helpful. Okay. Uh let's see. Now I want to introduce you to Phil Wadler who's my colleague at Glasgow. He's a functional programming guy. And when we were thinking about this intermediate language thing, I was describing to Phil various obstacles that I was encountering. And Phil said, "Simon, you should just use system F."

Now, I can't tell you system F was is a um type theory logic and semantics kind of um language. It's a it's a slightly grownup version of the lambda calculus. In fact, here it is. Uh right at the top of this slide, an expression is a variable, a constant, a type, an application, or a lambda. Or it can be a big lambda which can abstract over types. pretty small language um invented independently. Curiously, system F was invented quite separately by two giantrained people, John Reynolds on the left and uh uh Jean um Gerard on the

right. Uh and here are their papers that um describe system F, but it was very much programming language semantics theory, pointy-headed people. But Phil was saying, Simon, you should just use this as the intermediate language for a compiler. I thought he was smoking something, but it turned out it was exactly right. So, I'm not going to have time to describe the details, but I love the way that what seemed like a very theoretical concept turned into a actual

practical still 36 years later directly in use every day language into which every Haskell comp program is compiled. Pretty amazing. So, here's the sort of compilation pipeline. So lots happens you know we we rename we type check we optimize to that little the loop with the blue box there that's the little optimization pipeline we run around doing lots of transformations some of which are listed on the right and all of them go from this language to the same language to the same language to the same language statically typed all the way and you can see the output of the compiler at each stage. Um, okay.

Lovely, lovely. So that's a small language. Very, very helpful structuring mechanism. Also good sanity check. If you want to add an extension to the source language, if that would require a change to the intermediate language, that would be a big deal. If it does can be dugared into

the intermediate language, that suggests that all you're doing is adding syntactic sugar, which is much less of a big deal. Do you see the point? Right? So it's kind of like a a sanity check that tells us if an extension is a big one or a small one. And by the way, this language has not changed for the last 15 years. And it only it only changed once for the previous, you know, it's really only changed once in 30 years. It's very very very stable. Okay. So much for that. Now, uh laziness, this is your question, right? So remember that laziness was our war cry, right? We were the guys, you know,

22 to 25 year olds who just thought laziness was the coolest thing since sliced bread. And John Hughes wrote our manifesto. He didn't think of it. It was a little internal working note, but it's become very famous. And if you haven't read it, it's worth reading. Why functional programming matters, but it really, it should really be called why lazy functional programming matters. So he articulated in a very eloquent way how laziness can form a very powerful glue. It's not just a convenient mechanism. It enables you to modularize your programs in ways that are hard to do otherwise. It was very good manifesto. So it was a it was and it was sort of part of what inspired us to do.

Whoa, let's go let's go off and make laziness happen now. But of course laziness is all what what does laziness mean? So you you asked me to define it. So when I call a function f applied to

um g of x. Now in Julia you you'd evaluate g of x and pass the result to f. Yeah, in HA hasll we'll build a suspension for g of x and pass a pointer to that suspension

to f. If f throws it away, then f of g

of x will never get computed. If f needs it, it will evaluate it just once and overwrite the suspension with the value. Sometimes suspensions are called thunkks, right? So they're a little heap allocated cell that says if you ever need my value here's how to compute it but if you don't need my value that's fine just throw me away right that's why it's called laziness because it says oh I don't want to do any work until I'm absolutely forced to uh that's the idea okay now um the trouble is that it's expensive right instead of calling g of x I have to heap allocate something right right into memory and later when the fun when f does want to evaluate that suspension, he's got to go read, read, read and then execute code to evaluate it and then write to put its value back. Lots of memory traffic, bad.

Okay, so laziness is expensive. So why did we stick to laziness? Why um uh why

did we wear the uh the hair um shirt of laziness? Well, um, as I say, that was our rallying cry to begin with, and it and it for but it forced us into a um uh a uh uh something that only later we realized was important, which is this paper by Pat Helen. He put it best. This is the best paper title I have ever seen. Immutability changes

everything. Isn't that a lovely title? A beautiful play on words. And what he's really saying is that not just in programming language but also in log structured file systems and in accountancy all over the place caching systems wherever you look um you'll find that people are are sort of instead of overwriting things are sort of making a new copy and swinging pointers right so he he he this paper is about looking broadly across computer systems and seeing the effect of immutability but uh I like his subtitle we need it we can afford it and the time is now so we can afford it means it does cost you something but it's worth it right the price is and that was the the line that we were uh pursuing right so that was our plan immutability changes everything so once you committed to laziness and really we were ideologically committed to laziness to be honest with you right that was just our rallying cry then you have to be pure if you're in a call by value language it is almost impossible to resist the um uh the ability to just

say print X in the middle of a function, right? Or open the valve or put this thing in the database, right? Do things with side effects. So, um uh but in

HASLL because it's lazy, that makes no

sense. Look at this example. F of print yes and that's f applied to two arguments. Print yes and print no. What does that do? Does it print yes and then no? Or does it print no and then yes? Or does it print yes but not no? Or no, but not yes or neither. It depends on what f does with its arguments. And it's even worse if you put them in a list and then pass it around. Right? So really laziness and unrestricted side effects are incompatible.

You see the point and so that effectively forced us to stay pure. Do you know the first version of Haskell could not do IO? The entire program had

type string to string and that was it. That was the whole thing. This is the joy of being an academic language. You can do silly things like that whereas you guys you know if you get this stuff done you couldn't couldn't have done that right. We could string to string. So there was a long period of about I suppose five to six five six seven years in which it was just a bit embarrassing. We had this cool language but we couldn't do any IO really to speak of or we only had inconvenient ways of doing IO. And then Phil W appeared again. Oh, very important. Sorry, I was I just want to divert into some of you may have seen this little um meme um on the right top left hand corner. If you if you look for Haskell and my name, you is this very often comes up. I don't know why it's so popular. It says Haskell is useless, right? That was a was a little five-minute conversation in the corridor that somebody videoed. But the idea that I wrote a little diagram which said this axis was dangerous and safe languages.

So I was saying Haskell is is very safe, right? But a vertical axis is useful and useless. But Hasker wasn't very useful because you wouldn't had any side effects. So it was safe but useless. Right? On the hand C was very dangerous but very useful. Um and so what we of course what we want is languages that are uh both safe and useful and Haskell

is converging on that navana from below and other programming languages we might argue on this picture are converging in a different direction. So and there's cross fertilization between these right. I learned about STM from the imperative world actually, but it worked out rather well in Haskell as we might see. Okay, so now back to Phil Wadler. So Phil, the same Phil then wrote this paper, comprehending monads. Have you ever heard of that paper? It's a very nice easy to read paper, bath time reading. You would, this is not a technical paper. and he took some ideas from a different giant called Augenio Modi who's an Italian um logician and computer scientist with very very small round glasses completely incomprehensible.

Phil read his papers. He Phil could understand them and he translated them into English. Well into I mean Maji wrote in English as well but maths really. Phil translated them into this paper comprehending monads that explained how to use the idea of a monad which Augenio had been developing in in collaboration with other logicians and used it as a practical programming paradigm. And he discovered that made the made the option type the maybe type and lists were all monads. And then he and I subsequently a couple of years later realized that um that uh IO was

also a monad right and so that led to this program this paper imperative functional programming whose slogan is Haskell the world's finest imperative programming language um so very briefly here's the idea how we doing for time time um 9:14 good okay halfway through

yes uh so the idea is uh very quick

introduction to monads In a Haskell program, an expression of type IOT

should be thought of as a sort of action or if you like something like a script, a shell script. A shell script is a piece of text, right? Which you can execute. A value of type IOT is a bit like a shell script. It's a somethin

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers

Sign in to join the discussion.

Make the first comment.

That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 537 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks