Compiling Distributed System Models into Implementations with PGo
summary
Project defines Modular PlusCal and a PGo compiler that translates MPCal to TLA+ for TLC model checking and also emits executable Go. It isolates resources (network, filesystem) so the compiler can generate per-archetype Go functions, produces a runnable system after a small hand-written main, and demonstrates a load‑balancer setup (one client, two servers, buffer=1) that model checks and runs. Generated code is correct-by-construction relative to the checked model but the compiler itself is unverified and current performance is ~10–20% slower than hand‑tuned Go.
AI-written summary · about
chapters (36)
- 0:00Intro
- 1:25Motivation
- 2:26Bugs in Distributed Systems
- 2:53Protocol Descriptions Are Not Enough
- 3:34One key problem for distributed systems
- 4:04Related Work
- 5:22Model Checking a Bank Transfer
- 6:06Visualizing an Error Trace
- 6:31PGo compiler toolchain
- 7:23PGo trade-offs
- 9:47In today's talk
- 12:44Use macros?
- 15:14Invent a new kind of macro: archetype
- 16:51Modular PlusCal: System vs Environment
- 17:44The Modular PlusCal Language
- 18:26Web server example
- 18:54Abstract Server with Buffered Network (PlusCal)
- 19:42Abstract Server with Buffered Network (MPCal)
- 20:31Environment Abstractions: Buffered Network
- 22:13Environment Abstractions: Filesystem Read
- 22:53Putting it All Together: Instances
- 29:05Coming Back to the Server Example
- 29:38Interleavings between Processes
- 30:14Preserving Modular PlusCal Semantics in Go
- 31:20Reasoning about Concurrency (part 2)
- 32:41Executing an Atomic Step in Go
- 33:28Deadlocks!
- 33:51Reasoning about the Execution Model
- 34:17Resources Mapped as Functions
- 35:18Solution
- 35:52Executing a Modular PlusCal step (action) in Go
- 36:26Linking Abstractions and Concrete Implementations
- 36:40Environment Implementations: Requirements
- 37:27Handling Errors
- 48:22Performance results: Load Balancer
- 48:44Discussion: Limitations and Future Work
