In short
The Peterman Pod: Episode Notes
Episode Title Turing Award Winner On Thinking Clearly, Paxos vs Raft, Working With Dijkstra | Leslie Lamport
Episode Summary In this episode, host Ryan Peterman interviews Leslie Lamport, a renowned figure in the field of distributed systems and the inventor of the Paxos algorithm. The discussion delves into Lamport's significant contributions to computer science, his experiences with notable figures such as Edsger Dijkstra, and his insights into algorithm design, particularly contrasting Paxos with Raft.
Key Concepts and Themes
Leslie Lamport's Contributions
- Bakery Algorithm:
- Solves the mutual exclusion problem in concurrent programming.
- Inspired by the concept of ticketing systems (like deli tickets) for managing critical sections among processes.
- Notable for its simplicity and proof of correctness, demonstrating that mutual exclusion can be implemented without the need for complex shared memory assumptions.
- Time Clocks:
- Most cited paper addressing event ordering in distributed systems.
- Introduces the "happens-before" concept derived from relativity, crucial for understanding causality in distributed systems.
- Emphasizes state machines and invariants as foundational elements for understanding concurrent systems.
- Byzantine Generals Problem:
- Addresses issues of trust in distributed systems, noting the necessity for reliable communication despite potential failures.
- Highlights the use of digital signatures to distinguish between trustworthy and untrustworthy messages in systems with faulty processes.
- Paxos Algorithm:
- Developed as a solution for building fault-tolerant distributed systems.
- Focused on failures where systems may stop functioning rather than exhibit arbitrary behavior.
- Emphasizes the importance of abstract algorithms over code.
Dijkstra and Collaborations
- Lamport discusses his interactions with Edsger Dijkstra, notably in the context of mutual exclusion and concurrent programming.
- He reflects on Dijkstra's impact on his own work and the importance of simplifying complex algorithms.
Paxos vs Raft
- Lamport shares his views on the Raft algorithm, noting its perceived understandability compared to Paxos.
- He suggests that understanding algorithms goes beyond simplicity and involves rigorous proofs and abstractions.
Writing and Thinking
- Lamport emphasizes the relationship between writing and clear thinking, stating that writing helps clarify and solidify understanding.
- He shares insights on how structured proofs can aid in comprehending complex concepts in computer science.
Reflections on Intelligence and Career
- Lamport humbly reflects on his intelligence, attributing his success to a gift for abstraction rather than traditional measures of intelligence.
- He acknowledges a desire at one point to develop a grand theory of concurrency but recognizes the complexities and challenges inherent in the field.
Key Takeaways
- Importance of Abstraction: Lamport's ability to abstract complex problems is a central theme, showcasing how it leads to simpler yet profound solutions.
- Collaboration and Mentorship: The influence of mentors like Dijkstra is highlighted, demonstrating the value of collaboration in scientific advancements.
- Value of Writing: Writing as a tool for clear thinking is reinforced, particularly in the context of developing algorithms and proofs.
- Understanding Algorithms: There is a distinction between understanding algorithms through intuition versus formal proofs, which is crucial for developing reliable systems.
Episode Structure
- Intro - 00:00:00
- The Bakery Algorithm - 00:01:25
- Experiences with Dijkstra - 00:08:28
- Most Cited Paper Discussion - 00:14:44
- Byzantine Generals Problem Overview - 00:23:26
- The Paxos Algorithm Explained - 00:38:05
- Comparison of Paxos and Raft - 00:46:57
- Building LaTeX - 00:51:26
- Writing and Thinking - 00:54:45
- Career Reflections - 01:00:21
- Advice for Younger Self - 01:09:07
- Outro - 01:09:44
Additional Resources
- [Bakery Problem Paper](https://lamport.azurewebsites.net/pubs/bakery.pdf)
- [Time Clocks Paper](https://lamport.azurewebsites.net/pubs/time-clocks.pdf)
- [The Byzantine Generals Problem Paper](https://lamport.azurewebsites.net/pubs/byz.pdf)
- [The Paxos Algorithm Paper](https://lamport.azurewebsites.net/pubs/lamport-paxos.pdf)
Host and Guest Links
- Leslie Lamport's Works: [Publications](https://lamport.azurewebsites.net/pubs/pubs.html)
- Ryan Peterman's Newsletter: [Developing Dev](https://www.developing.dev/)
- Ryan Peterman on Social Media:
- [Twitter](https://x.com/ryanlpeterman)
- [LinkedIn](https://www.linkedin.com/in/ryanlpeterman/)
- [Instagram](https://www.instagram.com/ryanlpeterman/)
- [TikTok](https://www.tiktok.com/@ryanlpeterman)
This episode serves as a valuable reflection on the intersection of theory and practice in computer science, particularly in the realm of distributed systems, offering both historical context and practical insights for current and aspiring engineers.
Written by AI. May contain mistakes. Listen to the episode to check what was said.
Chapters
Tap a time to open that second in VOThe Bakery Algorithm and Its Significance
0:45 to 2:08
Explore the origins and significance of the bakery algorithm in concurrent programming.
“I also enjoyed reflecting over his 50-year career.”
The Problem of Synchronization
2:08 to 4:12
Understand the issue of synchronizing multiple processes and the critical section concept.
“well, this was in the days of timesharing, you know, right at really the beginnings of timesharing and the idea of multiple people using the same computer.”
Developing the Bakery Algorithm
4:12 to 6:03
Learn how Leslie Lamport developed the bakery algorithm and its unique properties.
“which was fairly complicated and I said, oh gee, that shouldn't be so hard and so I whipped off a very simple algorithm for two processes and submitted it to CACM.”
Collaboration with Dijkstra
6:03 to 7:58
Delve into Leslie's collaboration with Dijkstra and the impact of their work.
“and the proof of correctness revealed to me that this algorithm had this very interesting property.”
The Challenge of Memory Management
7:58 to 11:12
Discuss the complexities of memory management and how it relates to concurrent systems.
“And the proof was so remarkable that they didn't believe it.”
Abstraction and Recognition
11:12 to 13:32
Learn about the importance of abstraction in Leslie's work and his recognition by peers.
“you know, wouldn't know whether some other process is using that memory or not.”
The Influence of Distributed Systems
13:32 to 14:04
Discover the impact of Leslie's most cited paper on distributed systems and event ordering.
“I was invited to spend a month, but not with Dykstra, with a colleague of his, Carl Holton.”
Reflections on Collaboration in the Netherlands
14:04 to 14:39
Discover the collaborative atmosphere and experiences in the Netherlands.
“So that was the one tangible result that came from my month in the Netherlands.”
The Impact of Time Clocks in Distributed Systems
14:44 to 19:25
Learn about the significance of time clocks and event ordering in distributed systems.
“I wanted to talk about your most cited paper, the one titled Time Clocks and the Ordering of Events in Distributed Systems.”
Understanding Invariants in Concurrent Programs
19:25 to 23:26
Explore the concept of invariants and their role in understanding concurrent programs.
“and thinking about concurrent systems in terms of state machines.”
Show all 26 chapters
The Byzantine Generals Problem: A Deep Dive
23:26 to 28:00
Uncover the history and solutions proposed for the Byzantine generals problem.
“I think that's something that we hear about and we learn about when you're going through college and computer science.”
Understanding Byzantine Fault Tolerance
28:00 to 29:40
Learn about the significance of Byzantine fault tolerance and its implications.
“and they had the property that to tolerate one faulty process, you needed four processes, whereas if you used digital signatures, you only needed three processes.”
The Byzantine Generals Problem Explained
29:40 to 33:00
Discover the Byzantine generals problem and its storytelling approach.
“So the thing is that Byzantine, well, Byzantine fault is one that where a process, assume a process can do anything.”
The Importance of Naming Problems
33:00 to 37:00
Understand why naming problems can increase their visibility and importance.
“each fork would be shared with two people.”
Paxos and Fault-Tolerant Systems
37:00 to 39:40
Learn about the Paxos algorithm for building fault-tolerant systems.
“Throughout my career, I worked for private companies, you know, and not, you know, not in academia or for the government.”
From Code to Algorithm: A Paradigm Shift
39:40 to 42:00
Explore the transition from writing code to developing abstract algorithms.
“so they basically all of the computers in the building were on a single Ethernet network and shared a common storage and they had an algorithm for maintaining consistency of that storage.”
The Journey of the Paxos Algorithm
42:00 to 44:40
Explore the history and significance of the Paxos algorithm and its delayed publication.
“and so So what I've spent a large part of my career, basically maybe about 2000 or so onward, was getting people who build concurrent systems to not just write code, but to have an algorithm.”
Paxos vs RAFT: A Comparative Analysis
44:40 to 47:20
Discuss the differences and similarities between Paxos and the RAFT algorithm.
“And it was eventually published with a few things to mention work that had been done in the interim.”
The Concept of Understanding in Algorithms
47:20 to 51:20
Understand what true comprehension of algorithms entails beyond surface-level familiarity.
“or send it back to me when you have a proof.”
Creating LaTeX: The Story Behind Its Development
51:20 to 54:20
Learn about the motivations and processes involved in developing LaTeX for typesetting.
“So, yeah, we talked about a lot of your papers.”
Writing as a Tool for Clear Thinking
54:20 to 56:00
Discover why writing is essential for clarifying thoughts and ideas in programming.
“some project that had nothing to do with it.”
Proof Structuring in Concurrency Algorithms
56:00 to 59:50
Learn about the importance of hierarchical structuring in writing proofs for concurrent algorithms.
“write a correctness proof of a concurrent algorithm.”
The Tension Between Mathematicians and Formal Proofs
59:50 to 1:01:56
Discover the resistance mathematicians face when adapting to hierarchical proof structuring.
“That's where that one third of the paper's errors come in.”
Reflections on Academic vs Industry Work
1:01:56 to 1:06:08
Understand Leslie Lamport's perspective on his career choices between academia and industry.
“because you wanted to develop this grand theory of concurrency and you never discovered it.”
The Nature of Intelligence and Abstraction
1:06:08 to 1:08:41
Explore Lamport's insights on intelligence, abstraction skills, and self-perception.
“And in fact, if you want to give them semantics, you would do it in terms of a state machine.”
Life Lessons Learned From Experience
1:08:41 to 1:09:25
Hear Lamport's advice to his younger self about focusing on meaningful questions.
“years that I realized how much better I am at that than other people, most other people.”
Transcript
Automatic transcript. May contain errors.0:00If you think you know something, but don't write it down, you only think you know it.
0:06Leslie Lamport:This is Leslie Lamport. He's a Turing Award winner famous for his contributions to distributed systems, and I interviewed him for the stories behind his papers. Their reaction shocked me. They became angry. I really thought they might physically attack me. What was it about Dykstra's old solution that you felt was unsatisfactory? It was not an obvious idea to most people. That had actually impressed Dijkstra. As the inventor of the Paxos algorithm, I asked him his thoughts on the competing Raft algorithm. There was a bug discovered in Raft and fixed, but I believe the algorithm that they found more understandable was one with that bug.
0:47Leslie Lamport:I also enjoyed reflecting over his 50-year career. You say things like you never considered yourself smart. How could that be? Stupid people think they're smart because they're too stupid to realize they're not. You felt like a failure at some point because you wanted to develop this grand theory of concurrency and you never discovered it. Do you still feel that way? Here's the full episode.
1:16Leslie Lamport:I wanted to start with the bakery algorithm. What is the problem that the bakery algorithm solves and how did you discover the problem? Well, the problem was invented or discovered by Ed Scherdeichstra in a 1965, I think it was 1965 paper. And that began, I consider that really the beginning of the theory of concurrency, concurrent programming. He was the first one who really made use of the idea of concurrency as a way of structuring programs, as a collection of semi-independent tasks. And the processes have to synchronize with one another. One of the processes or, you know, among the processes would be, well, this was in the days of timesharing, you know, right at really the beginnings of timesharing and the idea of multiple people using the same computer.
2:25People realized that computers worked faster than humans and computers were very expensive in those days, So they could use a computer to be used simultaneously by multiple people. The program that each user was running was a separate program. But sometimes there were resources that got shared. For example, a printer. Two people trying to print on the same printer at the same time. Well, the result would be not very satisfactory. So he realized there was this problem of synchronizing multiple processes, the idea of what he called a critical section, or some piece of code in each of the processes, so that at most one process can be executing that piece of code at any particular time.
3:24So that code might be the code that prints something on the printer. So the problem was how to get the processes to synchronize among themselves so that at most one process was executing its critical section at a time. And it was in 1972 that I learned about the problem because there was an article giving a solution to it in the CACM, communications of the ACM. and I used to program and I liked little programming problems and this was just a very nice little programming problem and so I looked at the solution which was fairly complicated and I said, oh gee, that shouldn't be so hard and so I whipped off a very simple algorithm for two processes and submitted it to CACM.
4:29And a couple of weeks later, I received a letter from the editor pointing out the bug in my program. So that had two effects. The first was that I realized that concurrent programs were hard to get right and that you needed a proof that they were correct. and the second was that made me feel, I'm going to solve that damn problem. And I came up with the bakery algorithm, which was inspired by the idea came from, you know, what we now call the deli problem, where you have a deli counter that collects, you know, tickets, a roll of tickets, and every customer would come in and take a ticket and then the next person to be served would be the one with the lowest number ticket that hadn't been served yet.
5:32And basically, I took that idea. But since there was no central server, or at least the problem as specified by Dijkstra, involved no central control. Each process basically had to choose their own ticket. That was the basic idea, and the algorithm was quite simple. And I wrote a proof of correctness, and the proof of correctness revealed to me that this algorithm had this very interesting property. there was a general feeling, in fact, somebody published in a book or paper saying, you know, that it was impossible to implement mutual exclusion like this without using some lower level mutual exclusion.
6:32And the way most the mutual exclusion that was assumed generally was that of shared registers, you know, shared pieces of memory that could be written and read by different processes. And the idea is that, you know, you couldn't have one process, you know, two processes writing at the same time or one process reading while the other process was writing. People assumed that those actions were atomic. They always performed as if they occurred in some specific order. But the amazing thing about the bakery algorithm was that it didn't require that assumption. It used each shared memory, a piece of memory, was only written by a single process.
7:23So you didn't have to worry about two processes interfering with each other. The only problem that might come is that somebody reading the value while it was being written might get some unknown value. But the algorithm worked anyway. If somebody read, if one process read while the registers were being written, that process, reading process, could get absolutely any value, and the algorithm still worked.
7:54Leslie Lamport:I saw in your writing about this problem that you shared it with a colleague named Anatole Holt. Yes. And the proof was so remarkable that they didn't believe it. Well, the result was so remarkable that he didn't believe it. And, you know, I wrote the proof on the whiteboard for him and, you know, he couldn't find it, but he went home and saying, there must be something wrong with it. And he obviously never found anything wrong with it. Right. I saw the name of the paper is A New Solution of Dykstra's Concurrent Programming Problem. What was it about Dijkstra's old solution that you felt was unsatisfactory and made you want to solve this problem?
8:44Well, there was an unsatisfactory aspect of his original solution that had the property that if there were a lot of processes kept trying to enter their critical section, an individual process might be starved. It might never get access to the critical section. That was solved by, you know, the next solution I think was Don Knuth's. The condition that was desired or that measured what was considered the efficiency of it was how long a process might have to wait. and I believe that the bakery algorithm was the first one that was really first come, first served. That is, if one process came, what it meant is if one process chose its number before another process tried to enter, that first process would enter the critical section before the other process did.
9:51And I believe the bakery algorithm was the first one with that property. And also, I think it was simpler than other solutions.
10:02Leslie Lamport:In a lot of the writing, I see that you worked with Dijkstra. And I saw in 1976, you actually worked for a month in the Netherlands, and you worked with them. Can you talk about that a little bit? Dijkstra used to have the things that are called EWDs, its initials. They're little papers, things that when he thought of something, had some idea, he would write it down and send it out to people. Well, one of those EWDs was about he and some associates, or actually sort of mentees, I guess you would call them, wrote this algorithm. It was the first concurrent garbage collection algorithm. A way of writing programs evolved where there was a pool of memory that when a program would need a piece of memory, it would ask some server for it and be given this piece of memory.
11:02But at some point, it would stop using that memory. but the program itself wouldn't know that one particular process that created this memory, you know, wouldn't know whether some other process is using that memory or not. So there was an additional process called the garbage collector, which would go around examining the memory and decide which pieces of memory were no longer being used and then put them back on what's called the free list in which the server, the process that was giving out the memory would be able to take it. I looked at it and I realized that I could simplify the algorithm because he had some special, the handling of the free list was done by a special process that, you know, which had to worry about its own coordination with the processes that were using the memory.
12:05And I realized that that free list could just be made part of the regular data structure, so it didn't need special handling. And that seemed to me like a very simple idea, a very obvious idea, and I said that to him. And then when I got the next version of the paper, I discovered he had made me an author. And I thought that was very generous of him to have done that because it seemed like a very simple idea, a very obvious idea. And I later realized, much later, that it was not an obvious idea to most people and that that had actually impressed Dijkstra. That was the only thing I actually did with Dijkstra.
13:02Many years later, he said that I had a remarkable ability at abstraction. Only in very recent years, I mean, maybe after I got the Turing Award, that I realized that the reason for my success, the reason I wound up getting a Turing Award, was not that I was particularly that smart, but that I had this gift of abstraction. And Dykstra was smart enough to realize that. I was invited to spend a month, but not with Dykstra, with a colleague of his, Carl Holton. Only one thing that was ever published came out of that. Carl and I would meet with Dykstra once a week. In the course of that discussion, the idea somehow came up that led to a variant of the bakery algorithm that I wrote up and published.
14:06So that was the one tangible result that came from my month in the Netherlands.
14:14Leslie Lamport:Yeah, I saw that you wrote that you spent one afternoon a week working, talking, and drinking beer at Dexter's house, and you kind of don't remember exactly who was in charge of what on that paper. Well, I don't think I really could have gotten that drunk because I probably drove to the meeting and back from the meeting. Right, right. The Dutch beer that I was drinking was not very alcoholic. I wanted to talk about your most cited paper, the one titled Time Clocks and the Ordering of Events in Distributed Systems. What's the story behind the paper and the problem you were solving with it? The origin was simple.
14:59Well, somebody sent me a paper on building distributed databases. places, and so where you'll have multiple copies of the data at different places, and you need to keep them synchronized in some way. I looked at it, and I realized that their solution had this problem that it had the property that things would be executed as if they occurred in some sequence, but that sequence could be different from the sequence in which they actually happened. The notion of what happening before means is not obvious, or not obvious to most people. But I happen to learn about special relativity, in particular, what's known as the space-time view of special relativity, where you basically consider space and time together as one four-dimensional thing.
16:05And Einstein wrote his paper in 1905, and in, I think it was 1909, somebody whose name I'm blocking on provided this four-dimensional view. And that four-dimensional view has the particular notion of what it means for one event to occur before another. And that notion is that one event happens before another if a signal was emitted from the first event and received by whoever did that second event before that second event happened. But the communication could not travel faster than the speed of light because nothing can travel faster than the speed of light. Well, I realized there was an obvious analogy.
16:58The notion of happens before is exactly the same as in relativity, except instead of being whether one event can influence another by things traveling at the speed of light, it's whether the first event could have affected the other by information sent over messages that were actually sent. in the system. The thing that blew people away was this definition of happened before in a distributed system. Also, this was the first paper I would call it had a scientific result about distributed systems. I made perhaps a mistake that I was warned against at some point of having two ideas in one paper. The other thing that I realized was that there was an algorithm that would show whether one event, that it would produce an ordering that satisfied this condition, that if one event happened before the other, then that first event would be ordered before the other.
18:11And I realized that if you had an algorithm to do that, you could use it to basically provide the synchronization you needed for any distributed system because you could describe that system in terms of a state machine. And a state machine, as I described it then, is something that has a state and process executes commands that need to be executed in order. and the command simply is something that makes a change of the state and produces a value. And so you just describe this state machine as just how commands affect the state and how they produce it and what the new state is as a function of the original state and what the value is as a function of the original state.
19:06It turns out that this was very obvious to me, But that's really, in practice, the important idea in that paper. Because it showed that this method of building distributed systems by thinking in terms of a state machine and thinking about concurrent systems in terms of state machines. But that part was completely ignored. As a matter of fact, twice I talked to people about that paper, and they said there was nothing in that paper about state machines. And I just had to go back and reread the paper to be sure I wasn't going crazy, and it really did talk about state machines. It's important for another reason.
19:58If you're trying to understand a concurrent program, Concurrent programs are written, the bakery algorithm is really an exception. Concurrent programs are written assuming atomic actions. So that you assume that the execution behaves like a sequence. You can assume that the execution proceeds as a sequence of events. It turns out that the way to understand why does a program produce the right answer? Well, the answer is, well, you give it the right input. You give it the input and then it produces the right answer. Well, but by the time you're in the middle of execution, what it was given at the beginning is ancient history.
20:46The only thing that tells the program what to do next is its current state. And the way to understand a program, you know, a simple program that just, you know, takes input and produces an answer, is to say what is the property of the state at each point that ensures that the answer it produces is going to be correct. And that property, which is mathematically a Boolean-valued function of the state, is called an invariant. And understanding the invariant is the way to understand the system, the program. And I realized that the same thing is true of concurrent systems and concurrent programs. People like to write proof, behavioral proofs, reasoning about sequences.
21:42And the problem with that is that the number of sequences, possible sequences, is exponential in the length of the sequence. so your complexity of your reasoning gets to be very complicated and it's very easy to miss cases but the complexity of an invariance proof the complexity of the invariant basically is the number of possible executions is exponential in the number of processes but the
22:23behavior of the proof of an invariance proof is quadratic in the number of processes. That's basically why invariance proofs are better.
22:35Leslie Lamport:But there's still, for a long time, that people doing distributed systems theory are trying to do it, develop methods and formalism, something that are based on partial orderings and that. They've published a lot of papers, but it's just not the way if you want to do it in practice. That's not the way to do it. And I shouldn't say it's not the way. There are algorithms, like the bakery algorithm,
23:09that thinking of partial orderings is in fact a very good way of doing it. But those are the exceptions. the method that works, you know, that you can be sure will work, is the use of invariance.
23:25Leslie Lamport:I want to talk about the, I guess, the next paper, which is the Byzantine generals problem. I think that's something that we hear about and we learn about when you're going through college and computer science. And the name is great. And I want to know the story behind that problem. After I wrote that Time Clocks paper, that tells you how to build a distributed system, but assuming no failures. And it was obvious that one reason for distributed systems is you have multiple computers, so if one fails, you can keep going. In particular, that was the problem that was being solved at SRI when I joined it.
24:15But before I got to SRI, I started working on that problem. And there was no notion of the idea of what I should think about, what can a failure do? So I assumed that the worst possible case, that a failed process might do absolutely anything. And I came up with an algorithm that basically would implement a state machine under that assumption. And the algorithm I came at used digital signatures. So that it used the fact that a faulty process might do anything, but it could not forge the signature of another process.
25:01Leslie Lamport:Which just means that the message can be trusted that it came from a prior process. Right, so that you can relay messages and the people can check that the relayed message is actually the one that was originally sent. And so a solution using that. When I got to SRI, I realized that people were trying to solve the same problem. But there are two differences. First of all, at the time I did this was 1975. Very few people knew about digital signatures. And in fact, I don't remember when the Diffie-Hellman paper was published, but it was around 1975. and I happen to know about digital signatures because Whit Diffie, who was one of the authors, two authors of that paper, was a friend of mine and in fact, at one point, we were at a coffee house and he was describing these things that he said, we have this problem of building digital signatures, you know, and we haven't solved and I said, oh, that seems easy enough and I sat down and literally on a napkin, I wrote out the first digital signature algorithm.
26:19It was not practical at the time because it required basically something like 128 bits to sign one bit of the thing that you're signing. It's not quite that bad because, as you might think, because you could use sign not a the entire didn't document but a hash of that document which you assume you know people cannot forge uh the hash they can't reverse yeah you can't reverse you know take a hash and and you know you'll find some other hash that you know or some other document that satisfies that hash but anyway that's why i had you know digital signatures were part of my toolkit. So the people at SRI didn't have that.
27:12But they also had a nicer abstraction of it. Instead of getting agreement on a sequence among the processes on a sequence of commands, they would agree, have an algorithm for agreement on a single command. And then that algorithm would be executed multiple times. And that was a nicer way of describing what you're doing than my method. So the first paper that was published gave both their original, but since they didn't have digital signatures, they used a different algorithm. and they had the property that to tolerate one faulty process, you needed four processes, whereas if you used digital signatures, you only needed three processes.
28:16So the original paper contained both algorithms, and so I was one of the authors. The other algorithm without digital signatures is more complicated, and the general one for n processes was really a work of genius. It was almost incomprehensible. You just had to read this complicated proof that for the arbitrary case of an arbitrary number of processes, you need to tolerate n faults, you needed four n processes, whereas with digital signatures, you need three n processes. and the algorithm for single fault wasn't hard, but the one for multiple four-parts was Marshall Pease was the one who did it and it was just brilliant.
29:08Later, in a later paper, I discovered a simpler proof, one that was an inductive proof, namely prove that if it works for n minus 1, And, you know, it worked for n with 3n. It works for 3n times n minus 1. The original paper was, you know, the original one was just brilliant. You would have discovered it. Anyway, so we published that paper. And I realized that this was, this whole idea of Byzantine fault. So the thing is that Byzantine, well, Byzantine fault is one that where a process, assume a process can do anything. Now, I was assuming that, you know, processes can do anything because, you know, I didn't know what to assume.
29:58But the people at SRI had the contract for building a multi-computer system for flying airplanes. and so they were the ones who appreciated the need for solving processes that can do malicious things because they really couldn't assume what it would do and every time you would get an algorithm and you you'd see oh uh well this algorithm you know try to get an algorithm with three processes you know for one fault you know you'd find that you know oh you know this this works and it must be, you know, really couldn't happen in practice. And then you'd be able to find some sequence of plausible failures that would lead the algorithm to be defeated if there were a faulty process.
30:50So you needed four. And for some reason, you know, I thought that digital signatures was almost a metaphor in the algorithm that it should be possible, since we weren't worried about malicious failures, but just things that happen randomly, that there should be some way of writing a digital signature algorithm that would have a sufficiently low probability of failing. But I never worked on that, and nobody else ever did. So that algorithm was pretty much ignored because digital signatures were very expensive in those days. I don't know what's being done now because, you know, computers are digital signatures or just computing and computing is, you know, is cheap.
31:50But I remember at some point I happened to be communicating with someone who was an engineer at Boeing. And I asked whether they knew about those results. And he said yes. He, in fact, was the one at Boeing who had read that paper, and his reaction was, oh, shit, we need four. Four computers. But at any rate, I realized that this was an important result, and it should be well known. And I had learned one thing from Dykstra. one of the things I learned from Dijkstra he wrote this paper called The Dining Philosopher's Problem and that paper got a lot of attention but The Dining Philosopher's Problem I won't go into what it is but I think the basic problem was not particularly interesting but it had a cute story to it it involved a bunch of philosophers sitting around the table with some funny kind of spaghetti that it required two forks and there was one fork between, you know, each fork would be shared with two people.
Read the full transcript
33:03And I think realized it was because of that cute story that that problem was popular. And so I decided that, you know, our work needed a cute story, a nice story, and I invented Byzantine generals, the idea being that you have a group of, you know, for the one failure case, you have four generals who have to agree whether or not to attack. And if they all attack, they'll win the battle. But if only some of them attack, or even if three of them attack, they'll win the battle. But if only two attack, they would lose. But one of the generals might be a traitor. And so how could you solve this problem?
33:53And so it's phrased in terms of these generals having to communicate and decide whether to make the single decision, whether to attack or retreat. And, you know, I called it the Byzantine generals problem.
34:11Leslie Lamport:I saw in your notes about the problem that there was maybe a subset of the problem or a prior version that was called the Chinese generals problem or something like that. Oh, yeah. There's a different problem that Jim Gray described as an impossibility result, basically. It's called the Chinese general problem. I won't bother going into what it is. And so that gave me the idea of generals. I actually originally thought of the idea of Albanian generals, because at that time, Albania was a black hole as far as the rest of the world was concerned. It was a communist regime, it's a part of the Soviet bloc, but it was even more Soviet than the Soviet Republican and more restrictive.
35:07So when my boss said, well, you know, there are Albanians in the world, so you shouldn't have that, and so it should have a different name. And then I realized that Byzantine, there aren't any Byzantiums, Byzantines around. And that was the perfect name.
35:25Leslie Lamport:It's interesting to me in the story that, because this isn't the first time the problem was specified, but it's the first time that you named it, gave it a good catchy name essentially, and added some additional results. What was it that you saw in that problem that made it interesting or rather like how do you know that a problem is worth putting extra time into oh well this one it was because you know the it was obvious that people were going to be building that computers were going to fly or airplane fly airplanes and the reason in fact because was was that this was during the time of the oil crisis in the 70s and that they knew people knew that they could build more energy efficient planes by reducing the size of the control surfaces, but that made the plane aerodynamically unstable, and a pilot couldn't make all the adjustments needed to keep it flying, but a computer could.
36:30So it was clear the future was, you know, airplanes were going to be flown by computers, as they are, you know, today.
36:42and people didn't realize, they thought that, oh, if you want to be able to tolerate one fault, you just use three computers and they didn't realize that, you know, with arbitrary faults, you need four and so that was a really important result and that's why I believe that it needed to be well known.
37:03Leslie Lamport:Generally, when you look at the problems that you are solving with your work, how'd you decide because if you're working at a company you can decide based off of maybe the I guess the impact of the company like is it going to make more money or save costs or something like that but I wonder in your work across your career you know think about the bakery problem or some of your later work as well how do you know it's it's so open-ended how do you know which problems are the ones worthwhile? Throughout my career, I worked for private companies, you know, and not, you know, not in academia or for the government.
37:45And so some problems arose because of, you know, sometimes, you know, an engineer would have a problem and come to me. And so, you know, Disc Paxos, for example, was a case of that, that somebody actually wanted an algorithm to do what it did.
38:05Leslie Lamport:You mentioned earlier Paxos, and I know that's one of your most famous works. Curious about the story behind maybe that paper and the problem you're solving? Well, the problem I was trying is exactly the same problem as I was solving in the Byzantine General's work, basically building a fault-tolerant state machine. But by that time, the faults that interested industry were ones where failure meant that the computer just stopped, not that it did arbitrary things. So Paxos is an algorithm for building fault-tolerant systems for handling that class of faults. And the people I was working at was the Dexerc lab, which I joined in 1985.
39:06And they built a, what are the first operating systems that was a distributed operating system so that, basically everybody had basically these are the people who had come from Xerox Park and had invented personal computing but they also had the notion of distributed personal computing they invented the Ethernet you know for that so they basically all of the computers in the building were on a single Ethernet network and shared a common storage and they had an algorithm for maintaining consistency of that storage. And I didn't believe, well, they didn't have an algorithm. They had an operating system with code that did that.
40:05And I didn't believe that what they did was possible. Namely, I didn't think,
40:19well I forget exactly why I didn't think it was possible but at any rate I started trying to come up with an impossibility proof and then started solving proof well an algorithm to solve this would have to do this and in order to do this it would have to do that and at some point I stopped and said oh this isn't a proof this is an algorithm that does it
40:45Leslie Lamport:You said that they had code, but not an algorithm. Yeah. What do you mean by that? When most people sit down and start writing programs, they start by thinking in terms of code. And one of the things I learned fairly early in my career, I don't remember exactly when, that back in the days when I started writing concurrent algorithms, people talked about, people were calling them programs. And I was probably calling them programs too. I mean, I remember. Then at some point I realized that I wasn't talking about programs. I was talking about interested in algorithms. And an algorithm is something that's more abstract than a program.
41:35an algorithm can be a program is written in some particular code but an algorithm can be implemented in programs written in any kinds of code it's something that's at a higher level of abstraction and of course I like that because abstraction is something I was good at even without realizing that that's what I was doing and so So what I've spent a large part of my career, basically maybe about 2000 or so onward, was getting people who build concurrent systems to not just write code, but to have an algorithm. Now, a system does lots of things, but there should be some kernel of the program that's involved with synchronizing the different processes or the distributed system, the different computers.
42:45And that code is very hard to get that correct. So you don't want to think in terms of code because that encoding, you know, conflates, you know, a lot of issues that are irrelevant to the concurrency aspect. And so you should be thinking, you know, first get an algorithm that does that synchronization and then implement that algorithm.
43:12Leslie Lamport:I was looking at the Paxos paper and some of your notes about it. And I saw that there's an eight-year gap between when you came up with the algorithm and when the paper was actually published called Part-Time Parliament is the name of the paper. Why is there an eight-year gap? Oh, well, the referees originally said, well, this paper is okay, you know, not terribly important. But fortunately, Butler Lamson realized the importance of the algorithm. And together with the idea of, you know, I guess you can implement anything because it's implementing a state machine. And, you know, went about proselytizing, building your systems, you know, using Paxos, you know, and thinking in terms of state machines.
44:09And so, you know, I wasn't... So the idea was getting out, so I was in no hurry to publish. So, you know, I just let the paper sit. And eventually there was a new editor that came along and he said that, you know, I think the status of the paper was that it was just, you know, it had been accepted but it needed revision. And so he decided that, yeah, let's, you know, publish it. And it was eventually published with a few things to mention work that had been done in the interim. And what I got is Keith Marzullo to do that part for me. and so the story was that this manuscript, this was that, well, the story about Paxos was that, you know, this happened, you know, centuries ago and, you know, this manuscript and I used that to the effect that, you know, when something, you know, the tales of something were I considered obvious and not interesting, you know, the paper would say, it's not clear how the Paxos, what the Paxons did, you know, at this point, But at any rate, and so Keith, you know, kept up that idea that, you know, this was a, you know, a description of this ancient thing.
45:52And he wrote, you know, a little prefix or a preface or something to it and, you know, added maybe, I think, some references.
46:02Leslie Lamport:I saw in your writing, too, when you were talking about presenting the paper initially, you even dressed up in like an Indiana Jones-style archaeologist. Well, how did that go when you presented about this Paxos paper and algorithm? Well, I think the lecture may have gone well, but I think nobody understood the algorithm where nobody understood the significance of the algorithm. It sounds like no one understood it except for Butler Lamson. And what did he see that made him unique, I guess? Well, he had a good understanding of building systems. You know, he really deserved his touring award. He was one of the original people at Xerox Park who were building distributed personal computing.
46:49He and Chuck Thacker, I think, were probably the two senior people in that lab.
46:56Leslie Lamport:I saw later there was a paper which describes a new algorithm which seems to solve the same problem, the RAFT paper. I was wondering if you read that and what your thoughts were on that versus Paxos. The authors of that actually sent me a draft of the original paper, and I looked at it and said, I forget whether I said, send it back to me when you have an algorithm or send it back to me when you have a proof. I forget which one it was. And I got the idea, and they did write, you know, add a proof in the paper. and I never read later versions. And someone whose judgment I value had read it and said that it's basically the Paxos paper, but with some of the details left unfinished by the Paxos paper, by some of the details filled in.
48:01but they described it in a very different way. The basic idea of what Paxos works is it's two phases, and you're trying to implement a sequence of decisions. And it turns out you can do the first phase once. It involves a leader, and the leader has to get elected. But it turns out that you can do the first phase once and you don't have to do it again as long as you have the same leader. But it's only the second part that you have to do and then you have to elect the new leader if the new leader fails and do the first part. So think about it in those two phases. But the way people, the way engineers seem to like to think about it is, well, you do this, you know, you're talking about the first part, the second phase, you keep doing this until the leader fails, and then you go back, then you have to do this thing.
49:16So it's explaining it in the opposite order. and in fact when you started from fresh you don't have to do the first the first phase you can basically what started the first phase could be just built into the initial state but I think that those two phases is the way to understand it but you know the raft people also had this idea that raft is better because it's simpler. I must say that a lot of people say that Paxos is hard to understand, and I don't understand why. I mean, I've explained it to people in five minutes, and they understood it. At any rate, the RAF people said that one of the ideas were simpler, because, and they even have, you know, taught, you know, Paxos to one class, and RAF to another, and they took, and then, yes, the people, all the students said that, yes, it was more understandable.
50:20The interesting thing about it, though, is that there was a bug discovered in Raft and fixed, but I believe that the algorithm that they found more understandable was one with that bug. so uh made me realize that uh you know what most people you know what does understanding mean and for me understanding means you know you can write a proof of it but what understanding means for most people is a warm fuzzy feeling and you know the raft description gave them you know more of a warm fuzzy feeling because you know you know that that was seems to be the way Many programmers like to think about the algorithm, the second phase first until you get a failure.
51:19But the way I describe it is one that helps you get a better understanding of why it actually works.
51:26Leslie Lamport:So, yeah, we talked about a lot of your papers. I know one of your other contributions, whether you knew it or not at the time, was LaTeX. and building that and something that has impacted the entire academic community. What's the story behind wanting to build LaTeX? Oh, that was very simple. I was in the process of starting to write a book, and it was clear that tech was the basic typesetting system that one had to use. But, you know, I felt that I would need macros to make tech do what I wanted it to do. And so I decided, figured with a little extra effort, I could make the back rows usable by other people.
52:30The system I had been using before tech was called Scribe. And that really had the basic idea of Scribe was that you describe the logical structure of the document, and Scribe will do the formatting. Well, Scribe didn't do that great a job of formatting.
52:59But obviously, I like the idea, abstraction, that it's the ideas that matter, not the text, the writing that matters, not the typesetting. And so I actually, at some point, I met Peter Gordon, Addison Wesley. I'm not sure what you would call him, but he looks for books to publish. And he convinced me that I should write a book on it. And those days, it never occurred to me people would actually spend money for a book about software. but you know what the hell and what he did was he introduced me to a typographic designer at Addison Wesley who was responsible for really for the typographic design that's in the standard playtex styles you know basically I just did that in my quote spare time you know took me six or nine months or so.
54:10I suppose the statute of limitations has run out, but I was really, you know, spent some time working on that when I was allegedly, you know, billing the time to some project that had nothing to do with it.
54:25Leslie Lamport:On the topic of writing, you have a quote that I really enjoy. It's, if you're thinking without writing, you only think you're thinking. And I was curious to hear your thoughts on what you mean by that. Well, it was really meant for people building computer systems. You have an idea and you think it's going to work, or you have something that you think is something that somebody else will want to use. Well, write a description of it. There's an old maxim that I heard. that is, you know, write the instruction manual before you write the program. Great advice. I did not do that with LaTeX, but I definitely, when I was writing the book and I discovered that something was hard to describe, hard to explain, that needed to be changed.
55:26And I made, you know, a number of changes to it. as a result of that. But I didn't start at the beginning with the instruction manual.
55:36Leslie Lamport:Why is writing conducive to good thinking? Because it's very easy to fool yourself. I mean, that underlies my whole idea of writing proofs. One thing I learned is that you had to write a correctness proof of a concurrent algorithm. And when my algorithm was starting to get more complicated, the proof started, I started to write, you know, I was a math, a PhD in math, I knew how to write proofs. And I was starting writing the proofs the way I would normally do. And I realized it just didn't work because there were just so many details involved. And I just couldn't keep track of them and whether I had done it.
56:30And so, as a computer science, you know how to deal with concurrency. It's hierarchical structure. And so I devised this hierarchical structure where a proof is, you know, is a sequence of steps, each of which has a proof. And the proof is either a, well, a proof is either a paragraph or a sequence of steps, each with its proof. And that proof can be either a paragraph or a sequence of steps with its proof. So you break the whole problem up into these smaller pieces. So there's never any question of where is this coming from. You're stating that this step follows from this step, this step, this step, this step.
57:15And if it does not follow from that step, your proof is wrong. The theorem might be correct, but it means your proof is wrong. Well, you know, I discovered that worked great on writing my proofs of programs. But I decided to really, you know, I also write proofs of theorems. You know, think proofs that are things that are more like ordinary math. And I started trying that on them. And I discovered it worked beautifully. So when I started to try to convince mathematicians to write these proofs, I started in one small seminar. I won't describe what it was about, but I described this proof through maybe 20 mathematicians or something.
58:04Their reaction shocked me. They became angry. I really thought that they might physically attack me. So I believe that what's going on is that when people, I mean, I believe that's totally irrational. And when people act irrationally, it tends to be out of fear. And what I believe people are afraid of is, the mathematicians are afraid of, is that they're going to have to write their proofs to convince a computer program. And in fact, you know, and I give it one of those talks I gave, you know, I say very clearly, this doesn't have to be, You don't have to be any more formal than you do. You can write the exact same thing, proof, but it's just a matter of organizing things.
58:58And it's very simple, you know, hierarchical structure. And then when you're using a fact, mention that you're using that. Nothing about formalism or anything. You know, after I gave that talk, someone got up and said, I don't want to have to write my proofs for a computer program. And in fact, it's more work doing that because the reason it's more work is that it reveals what you haven't said. And that there's steps in there that you may think they're obvious, but you haven't written them down. And if you believe something is correct, but don't really, if you think you know something, but don't write it down, you only think you know it.
59:50And that's where errors come in. That's where that one third of the paper's errors come in. Because it really makes you honest.
1:00:01Leslie Lamport:When I look across your career, I think you had a lot of contributions people might expect might come from academia, these papers and things, but you did all of your work in industry. Why did you not see yourself as an academic and more of working for industry? Well, I started out programming, and I eventually got jobs where it took me into what we now call computer science. At the time, I never even realized that there could be a science of computing. It wasn't until, you know, maybe until mid to late 70s that I realized, yes, there was a computer science, and I was a computer scientist. but it never seemed to me that computer science was an academic subject.
1:00:57At some point I had to make a choice between doing computer science without calling it computer science or teaching math at a university. I chose for fairly random reasons to do computer science. so you know the first I don't know well till maybe the mid 80s or something it just didn't seem to me that you know computer science was something that people needed to go to a university to learn and I suppose afterwards that I was sort of I guess I just didn't think it would be fun teaching computer science.
1:01:48Leslie Lamport:I saw in your writing, you had a footnote that said somewhere that you felt like a failure at some point because you wanted to develop this grand theory of concurrency and you never discovered it. Do you still feel that way or what are your thoughts on that footnote? Lots of people, a large percentage of the people who were doing things like I was doing, which is not a large number of people, there's this notion that they're looking for the Turing machine of concurrency. The Turing machine was this abstraction which really captured what computing was.
1:02:32And they were looking for something that would be the Turing machine of concurrent computing.
1:02:47And, you know, nobody succeeded. I mean, there are some people who think they've succeeded. The patronets are something that I guess I don't have time to explain, but there was a big in the 70s, and I was actually surprised to think that there's still a large community of people doing patronets. but what I now realize is that patronets and most of the things that people were doing was really language-based. And I was never interested in languages. I'm interested in what the language is expressing. And, you know, I realized in some sense, you know, maybe I've realized what the Turing machine of computing is.
1:03:34It's state machines. state machines are a little bit different the way I now describe them they don't have commands, they just have a state and a next state relation even simpler than talking about commands and values and to me that's the Turing machine of concurrency but it it doesn't have the function that Turing machines offer, because what Turing machines do is describe what's possible. And state machines can describe anything, including things that are not possible. And in fact, there's a good reason for that. for example when I describe an algorithm I will talk about the values of a variable can be any integer now you can't implement the program where you have any integer but that makes but talking about computer integers would complicate things unnecessarily People have this funny idea that because something is infinite, it's more complicated.
1:05:08They got it backwards. Infinity was introduced to simplify things. The first thing you learn is arithmetic. You're learning arithmetic with an infinite number of integers because if you were restricted to a finite set of integers, arithmetic becomes much more complicated. So the abstractions of mathematics, which people find, because they don't have the proper training in mathematics, find difficult, are really what's simplifying things. And that's what you use, this mathematics. The state machine is described by me using mathematics. That's the right, you know, the most powerful way of doing it.
1:05:59But computer people and computer scientists and programmers are really hung up on languages. And so they are looking for, you know, they invent all sorts of languages. and they're all describable. And in fact, if you want to give them semantics, you would do it in terms of a state machine. And they just think that this, you know, this language improves your thinking. It doesn't. I mean, there are reasons why you use computer languages and you don't write your program's code in math. and they involve basically efficiency. But for understanding, you can't build math. You can't beat math. And, you know, attempts to do it by something that looks like a programming language is just the wrong way to deal when you're trying to deal with concurrency.
1:07:05Leslie Lamport:When I look at everything that you've written and all the stories, there's these little anecdotes. There's things where you say things like you never considered yourself smart, but you noticed that other kids had an awful time understanding things. Or, yeah, there's a problem that you solved where someone else had difficulties, but you don't view your contribution as a brilliant one or anything like that. And that doesn't connect with me because you've also won a Turing Award and done all these amazing things. So how could that be that you, you know, just merely discover things and are not smart, yet you've achieved so much?
1:07:48Well, this general thing that psychologists talk about is that when someone is good at something, they don't realize how good they are at it because it's simple to them. there's the opposite one that uh people who are bad at something think they're better than they are because they're bad at it or put a little bit more concisely stupid people think they're smart because they're too stupid to realize they're not my the gift that i have is not in some sense raw intelligence. It's abstraction. And it's only recently, you know, last 10 or so years that I realized how much better I am at that than other people, most other people.
1:08:49Leslie Lamport:At this point, you've experienced so much. And when you look back on your career, if you could go back to yourself when you just graduated college and give yourself some advice knowing what you know now, what would you say? One thing I've learned fairly early in my life is that I shouldn't waste time trying to answer questions that I don't have to answer. I don't think about what I should have done because that's a question that I don't have to answer. Thank you for listening to the podcast. It's a passion project of mine that I really enjoyed building. Another passion project that I've been working on kind of in secret is building an ergonomic keyboard that I wish existed.
1:09:37Leslie Lamport:And I finally have a prototype. So I'd love to show you what we've built. It's ultra low profile and ergonomic, and I couldn't find anything like it on the market. So that's why we built it. I'll put a link to the keyboard in the description. you can take a look and learn more about the project there. We could definitely use your support. Also, if you have any feedback for me about the show, I'd love to hear it. Comments on YouTube have led to guests coming on like Ilya Gregorik and David Fowler. I wasn't aware of them until someone dropped a comment. Also, feedback in the comments helped me learn to reduce the number of cliffhangers in the intros.
1:10:11Leslie Lamport:So your comments definitely make a difference. Please keep letting me know what you'd like to see more of in the show and I'll see you in the next episode.
From the publisher
I interviewed Leslie Lamport, a Turing Award winner known for his contributions to distributed systems and the inventor of the Paxos algorithm. We walked through the major contributions of his career for the stories behind them and what he learned along the way.
🔸 My keyboard project: https://read.compose.llc/p/our-keyboard-design-reveal
𝗣𝗼𝗱𝗰𝗮𝘀𝘁 𝗹𝗶𝗻𝗸𝘀:
• YouTube: https://youtu.be/U719vQz-WFs
• Apple: https://podcasts.apple.com/us/podcast/the-peterman-pod/id1777363835
• Transcript: https://www.developing.dev/p/turing-award-winner-on-working-with
𝗘𝗽𝗶𝘀𝗼𝗱𝗲 𝗹𝗶𝗻𝗸𝘀:
• Bakery Problem Paper: https://lamport.azurewebsites.net/pubs/bakery.pdf
• Time Clocks Paper (most cited): https://lamport.azurewebsites.net/pubs/time-clocks.pdf
• The Byzantine Generals Problem Paper: https://lamport.azurewebsites.net/pubs/byz.pdf
• The Paxos Algorithm Paper: https://lamport.azurewebsites.net/pubs/lamport-paxos.pdf
𝗧𝗶𝗺𝗲𝘀𝘁𝗮𝗺𝗽𝘀:
00:00:00 - Intro
00:01:25 - The Bakery Algorithm
00:08:28 - Experiences with Dijkstra
00:14:44 - His most cited paper
00:23:26 - The "Byzantine Generals" problem
00:38:05 - The Paxos Algorithm
00:46:57 - Paxos vs Raft Algorithm
00:51:26 - Building LaTeX
00:54:45 - Why writing improves your thinking
01:00:21 - Why he wasn't an academic
01:02:08 - Grand theory of concurrency
01:07:25 - Why he doesn't think he's smart
01:09:07 - Advice for his younger self
01:09:44 - Outro
𝗪𝗵𝗲𝗿𝗲 𝘁𝗼 𝗳𝗶𝗻𝗱 𝗟𝗲𝘀𝗹𝗶𝗲:
• His works: https://lamport.azurewebsites.net/pubs/pubs.html
𝗪𝗵𝗲𝗿𝗲 𝘁𝗼 𝗳𝗶𝗻𝗱 𝗥𝘆𝗮𝗻:
• Newsletter: https://www.developing.dev/
• X/Twitter: https://x.com/ryanlpeterman
• LinkedIn: https://www.linkedin.com/in/ryanlpeterman/
• Threads: https://www.threads.com/@ryanlpeterman
• Instagram: https://www.instagram.com/ryanlpeterman
• TikTok: https://www.tiktok.com/@ryanlpeterman




