Unikernels in 2026 part 3: Thomas Gazagnaire
For the third part in the unikernels in 2026 series I talk to Thomas Gazagnaire, about unikernels, formal verification, OCaml, code in space and more.
[00:00:01] Justin: Okay. Well, nice to catch up with you. It's been a while. Do you want to introduce yourself?
[00:00:08] Thomas: Yeah, thanks, Justin, for the invitation. I'm Thomas Gazagnaire. I have a very mixed background. I'm initially a researcher, but then I wanted to create a few companies, working as an engineer, and now I'm running two different businesses about OCaml and open source. I really like to apply very complex ideas from research, especially between system engineering and programming languages, and try to apply that to products, and try to hide that complexity from the users at the end. That's kind of what I'm trying to do.
[00:00:49] Justin: So how did you get into OCaml in the first place? That must have been a long time ago.
[00:00:57] Thomas: Yeah, it's been a very long time. I think in France, it used to be that when you enter some preparatory school, you have to learn a few languages and computer science. The way to learn computer science was teaching graph algorithms and things like that, using either pseudo code or Caml Light at the time. That was in 1999, something like that. I learned Caml Light, and then when OCaml came out a few years later, I tried it because it was much better, and then I never really stopped. I've been using that for a very long time now.
[00:01:38] Justin: And then you got into systems programming and that kind of thing. How did that happen?
[00:01:47] Thomas: Yeah, so I did a PhD in very formal methods for distributed systems, and it was really about proving stuff on paper and writing a few algorithms in OCaml to check that things worked. But after my PhD, I was really looking forward to trying something a bit more concrete, and I saw an advert to work on a weird project called Xen as a hypervisor. It was in Cambridge. I didn't speak very good English—it's a bit better now, but at the time it was very bad. I went into an interview when some guy spoke to me very quickly, interviewed me, called Anil. They hired me to work on the XenServer stack, which was written in OCaml at the time. I had to learn a lot of things about systems there, and a lot of interesting things. It was a pretty good mix of things that I knew before and things I really didn't know much about, so I learned a lot there.
[00:02:52] Justin: So Xen was kind of the origin of Mirage and the unikernels on Xen. Originally I think all the public unikernels were based on Xen, and Mini-OS originally was kind of a glue there. But how did Mirage come about?
[00:03:17] Thomas: Yeah, I think we were discussing at the time with the Haskell people, the HaLVM project from Galois. We wanted to build very small test cases for the Xen hypervisor, so we had to write some device drivers in OCaml just to test the hypercall thing. It was only on the host side initially, and then we started to write the backend part on the guest side just to test it end-to-end locally without the hypervisor. You'd run it on your host, have the two sides, they can communicate, it works. Then we thought, maybe we can just boot it and see if it works. But then you had to port the OCaml runtime, and glibc doesn't really compile very well with Mini-OS, so you had to do a few tricks. We managed to cross-compile the OCaml runtime linked with the backend drivers, and then you could boot, and it just worked. It was very surprising. We discovered that the Haskell people were doing the same thing with HaLVM, and they never open sourced that, but it was kind of the same thing. We started to add more things to it, and realized that it was pretty painful to manage components in OCaml because you had to write a lot of modules in various ways, and in OCaml there was no package manager at the time. There were a bunch of them, but they were not very easy to use. I had to write a package manager from scratch, more or less, which was OPAM. I was the initial author of that, but now it's taken over by a very good team of people, which is making life much better. We had to write a lot of components for the ecosystem. For me, what was interesting was how do you turn this stuff, a very weird hack, into something useful for the community. To do that, you have to write a lot of tools, like a package manager, build systems, and so on. It was a long journey.
[00:05:51] Justin: Yes. I think it must have been, what, 12 years since we met, probably, maybe something around that. It was very early, and there were still lots of pieces missing back then. That was also when you were working on Irmin, the storage lab, because we had unikernels working with networking, and that's where quite a lot of the interest in early unikernels was—in things like telco applications that were just networking-based. But it was a bit limiting not to be able to store anything on your machine, not have anything stateful. Do you want to talk a bit about Irmin and that?
[00:06:50] Thomas: Yeah, maybe just before that, I can come back to the story of Mirage. You're right, the network part was really the first component that people worked on. We had this TCP/IP stack, and Anil worked on that before creating the systems. Then we had a bunch of very talented people who wrote the TLS stack on top of that.
[00:07:17] Justin: Ah yes, that's right, yeah.
[00:07:19] Thomas: I think it was Hannes and David. After Hannes' PhD, they wanted to have a break, so they went to Morocco on the beach for three months, and they rewrote a full TLS stack using Mirage. It was a very good proof that you can start protocols from scratch, and if you know what you're doing, you can do that pretty quickly. If you have the right component structure and the right way to organize the libraries, it's pretty easy, and you can deploy something pretty fast. Then we had end-to-end HTTPS working with that, and I think people started to notice that it was a reality.
[00:08:02] Justin: And there was also the piece of booting up the kernel when the SYN packet arrived.
[00:08:11] Thomas: Yeah, that was a trick. We had a proxy, a DNS proxy, and when you get the request to the domain, you can just boot the domain. You basically start the network stack in memory for that, and then you hand over the stack directly to the unikernel. As everything is a library, you can really easily do that because the state is a pure state. You can serialize it to whatever—Marshall OCaml, or write it as a binary blob—and you pass it to the other side just to unmarshal it and run it. Basically, it's a kind of trick.
[00:08:50] Justin: Yeah, much simpler than solutions people are trying to build now with trying to serialize kernel state or freeze VMs and move them around and those kinds of things.
[00:09:09] Thomas: Yeah, you have much tighter control, so it's much easier. But it seemed pretty good. I came to Cambridge in 2013 in the lab to work on Irmin, which was this distributed kind of database, so more on the storage side than on the network side. The idea came from the XenStore component in Xen. In Xen, whenever you boot a domain, every domain has to talk to a control database, where you say, okay, these are my devices, there is some RPC going on between the host and the guest, write messages, and they have the state of each protocol, which is going on in a small local database. One of the things I was doing at Citrix, when I was working on the Xen hypervisor, was to rewrite that in OCaml. I wrote the XenStore daemon, and to scale it to be able to boot—at the time it was hundreds of VMs, which was very...
[00:10:20] Justin: That was before machines had hundreds of cores.
[00:10:23] Thomas: at the time, one or two was already good, but now you want to boot hundreds of them at the same time, and it was very hard to do. I think it was 20 years ago. We had to rewrite that control stack. To do that, we had to think about control theory. Instead of having a lock, you have optimistic control, where you do the write and then you commit, and if something fails, you try again. It's a very transactional optimistic control theory. To do that properly, you need to have an immutable state, and you need every branch to do a commit on the side and then try to commit with the same thing, so you have some kind of merge strategy. Maybe you see where I'm going, but if it's written as an immutable state and you have merges, it's very similar to Git. I thought this was a very good way to write a database, and I wanted to explore that with Irmin. That's a project I wanted to do research on at Cambridge—really using the data model of Git, but instead of storing a text file, I want to store any kind of data, application data, and have an automatic way to do merges, because what's annoying in Git is you have to resolve conflicts.
[00:11:52] Justin: Yeah.
[00:11:52] Thomas: If you can define that as a user, saying I have two kinds of data, and for my conflicts I have a special callback to resolve it automatically, then you can do that pretty well. For me, it was and still is a very good model. I can explain briefly what the idea is. You have two different kinds of storage. One is a key-value store where the keys are the hashes of the values, so it's content-addressable. Everything is very deterministic. You can scale it very well because even if you have two people writing the same value, that will be the same key at the end, so there is no concurrency problem. Everything is very easy to scale and to have a lot of machines doing writes or reads. You can even have a distributed heap where you can route the location of data easily, so it's scaling very well. The other one is you need to have something more like an address on that heap, saying, okay, I have the name, I have main, which is the main branch, or I have the public key of someone, and this is associated to a specific hash, which is something in the store. For that, the transaction mechanism is more complicated because you cannot really—well, you can do compare and swap, but it's very localized. You can do a big update on your interface heap and then just do a one swap of the pointer to the head of your heap.
[00:13:39] Justin: Yeah.
[00:13:40] Thomas: All of that is, interestingly, very close to how OCaml manages the heap, and to what functional programming is doing. As a functional programmer, you think like that all the time, so it's very easy. Having the system behave that way is, I think, a very good way to program as well, especially nowadays. I still think it's alive somehow.
[00:14:03] Justin: There's been quite a lot of people trying to do Git-like things for data in various forms, like branchable databases. There's been ongoing interest in this, as well as people trying to get Git itself to scale better and modifying it. It's definitely something that's not gone away in terms of interest. I used to have a list of all the people doing Git-with-data projects, and it's been an area where a lot of people have been experimenting. I expect to see more stuff.
[00:14:44] Thomas: What was interesting is that in the meantime, we had this blockchain era where people were actually using that for storing a lot of data. I've worked with— we were a customer for Tezos at one point, developing the storage system for them. They used Irmin to store the ledger. Blockchain is really like an immutable ledger of records with heads that move. The way to move your head is you need a more or less complex way to resolve who is winning the transaction, and that decides what is the next head. You have basically an immutable heap, and then you have this algorithm to decide how you move the heads to the next commit.
[00:15:43] Justin: Yeah.
[00:15:45] Thomas: For Tezos, we wrote a new backend for Irmin, which doesn't use Git because it doesn't scale. We liked being able to have very large directories or store very small or very big files. We had a custom schema for that, and it was actually working pretty fast. I think we can scale it if we know what we want to do.
[00:16:12] Justin: Yes. At Docker after you left, we built a lot of stuff into Datalog as well. It's not quite Git-like, but it's immutable, append-only. It's got that append-only semantics and all the optimizations you can do through that. There's just all these things you get from functional programming that stay with you and you build stuff with them. I always tell people, you learn functional programming to change the way you think about programming, not necessarily because of the particular language.
[00:17:00] Thomas: Definitely. What's interesting is if you look at the biggest immutable heap we have, it's the kind of OCI images as well.
[00:17:10] Justin: Yeah.
[00:17:10] Thomas: Somehow Docker is doing that.
[00:17:13] Justin: When you look at OCI and Git, you can kind of squint and they're similar. I think there were some features missing that, in a way, would have— sometimes we tried to implement, actually. Some of them we did implement and some got shipped. For example, compressed diffs of layers—we implemented that at one point but it never actually got shipped, at least in the open source product. There are things in Git that were useful. It was about taking those models. The immutability piece was really important. It made containers different from VM images—the fact that they were immutable.
[00:18:14] Thomas: Definitely. Then you can hash them and verify stuff.
[00:18:19] Justin: You can sign them and all those things that come from that side of things as well.
[00:18:23] Thomas: If you push that even further, the modern way to do secure boot is to have immutable boot images that are signed. Then you can do upgrades—first, you have a way to distribute this kind of immutable image. Having compressed diffs and all the negotiation about what hash you have locally, what hash the remote has, what is the diff, how do I compress that, how do I share it in the most efficient way—this is done by Git, by OCI, by all the secure update mechanisms. When you want to update, you have some algorithm to decide what is the new version of the head. Do I need to sign something? Do I need to verify a signature? Do I have to hash something or trust some proof-of-work mechanism? Then, when you decide, you have a one-shot compare-and-swap to say, okay, this is the new head, I can put my machine here and that works. It's very interesting to see that all these mechanisms are implemented by everyone at all the different levels, and they're all based on functional programming ideas, which is something very interesting.
[00:19:42] Justin: Yeah. We've talked a bit about things back there. Do you want to give an update? I know you've been working on space tech recently—I've heard a lot about that. Do you want to give an update on what you've been working on more recently? What's exciting?
[00:20:09] Thomas: Yeah. I'm still interested in getting more people using OCaml because I think that's a good way to build systems without too many bugs, which is what I really care about—making distributed systems, I'd say, in that respect. I have two companies. One is Tarides. We do services around OCaml, making sure that if a new company wants to adopt the language, we can help train engineers, build systems for them, do audits, and so on. That's one part of our activities. By doing that, we develop tools, libraries, and so on. Then we started to say, maybe we want to actually prove to people that you can use OCaml to build real products. The place where having not so many bugs, things that work for decades and you don't want to reboot them all the time, and security by design—I'm using that as a loaded term, but making sure the design is correct and the tools help you make fewer mistakes. One area for that is space. When I say that, people say, yeah, but that's a garbage collector and we don't want to run that in space. But things are changing a little bit. We're starting to apply a lot of stuff to space, trying to say that the computers are getting bigger, using more resources. Now you have two computers: the flight computer, which is still very carefully written by embedded software people to make sure there's no allocation in loops and you can't change it too often, and you don't want to change it too often. But then there's a second computer, the payload computer, where people put the mission software. If you start an Earth observation mission to look at trees or whatever, you want to run the software on that computer, doing computations, maybe some machine learning. People are starting to realize that this computer is just used for a few months, and then nobody uses it anymore, so they want more flexibility. They want to have multiple applications or users at the same time. But if you do that, you need to start upgrading the code when you apply it. How do you do secure updates? How can you trust that you can share your payload computer with other tenants? This is very similar to what the cloud and containers have been doing for the last 20 years. I think the industry is slowly moving towards that, and we're trying to provide a secure runtime for that, secure updates, the SDK to write applications there, and the local experience of developing applications for space. You can write it locally, it works, and you deploy it in space, and it works there as well.
[00:23:54] Justin: Right.
[00:23:54] Thomas: You can see what I'm saying here. I think the Docker experience is really unique there, and people in space should be able to use that as well. We're trying to be as compatible as possible with Docker, but with a more lean and secure runtime for satellites.
[00:24:27] Justin: What kind of hardware are people running in space?
[00:24:31] Thomas: It's actually quite—most missions are cheap, which is still expensive but cheap for space, and are using Raspberry Pi CM5, basically. That's the baseline for the cheap mission. Then you have much more expensive missions with some ARM boards, like the Jetson and Xilinx kind of thing. These three boards are mostly ARM. GPUs are a bit hard to run in space because there's no air, so it's very hard to cool down.
[00:25:21] Justin: Yes.
[00:25:23] Thomas: But there's FPGA stuff, which seems to be a bit more used.
[00:25:32] Justin: Right. The aim of actually doing computation in space, I think, is because data links are very small, so you want to be selective about the data you actually send back to Earth. Is that right?
[00:25:51] Thomas: Yes, so there's two things. One is latencies are a bit different from the cloud, so you don't control the links. There are projects which plan to have 100% connected satellites where you can go up and then down, but the latencies are not very predictable, and you can be offline for a couple of hours, like if you go over Greenland or whatever.
[00:26:21] Justin: Yeah.
[00:26:22] Thomas: Or if you go to Mars, there is the latency. You need to have algorithms—security algorithms, or even just things to function correctly—which are not tied to latencies or to being online. That's a bit different from the container ecosystem, where you can always phone home to check if a signature is correct or check the latest Git receipt. But if you can't really check it, you need a way to check offline. That's the security envelope; the security scope is a bit different. In terms of efficiency, people are building sensors that generate more and more data, and sending the data back to Earth is very expensive and slow. You'd rather do the computing in space, close to the data. It's very similar to edge computing.
[00:27:28] Justin: Yeah, I think there are actually a lot of applications like this. I've talked to CERN a few times, and they have the same issue. They collect so much data they can't store it all. They have a tape budget, and they spend a lot of time working out what data is interesting and what is not, throwing most of the data away because it's just not interesting for some value—whatever value of 'not interesting' is. Sometimes it's hard to know, especially if you're doing sensing or something—what are you looking for? That's going to potentially change over time, and your model might change, and you want to be sure your model is actually correct. You do want to collect some out-of-sample data and things like that. But there are definitely a lot of these applications where just collecting everything—which has been the sort of cloud default, regardless of cost—isn't the right solution.
[00:28:25] Thomas: Yeah.
[00:28:26] Justin: Collecting everything isn't the right solution for most people, really. I think there are actually a lot more people who should be throwing away more data, because you need to actually understand the value—that some data is a lot more valuable than others. Building a model and understanding what you're trying to collect is a good way of understanding the value of data.
[00:28:50] Thomas: And I think what is interesting as well is, even if you have computation using some data, you still need to track back from the data itself. For example, in space, you can write a change detection algorithm to detect when there is a fire in a forest. You can send the alert to the ground directly because it's using a low-bandwidth link and it's very fast. Maybe the fire isn't the best example, but you want to be able to trace back and get the initial image at some point. Maybe you don't want it right now, but when you build the case for why you've done something, you want to say, 'We saw these images, we ran that version of that program, which depends on these components,' and then explain why you did the rest of the operation. You need a full trace, an audit trail of everything going on—from the data itself to the program running on the data. So yes, you need to discard a lot of data, but for the data you keep, you need to be sure it's mutable, that you can store it in storage that works offline but can sync later. Again, we come back to the same kind of storage line, but that's what I like.
[00:30:19] Justin: Yes. And so, you're using unikernels in space?
[00:30:25] Thomas: Yeah, it depends on the different unikernels, I guess. But if you look at places where you need to not use too many resources to be secure, and where it's okay to spend a bit more time to build the system properly—because it will run for 10 years anyway, so if you spend a few months on it, it's okay—I think it's a very good fit for space. But then the application people want to run is maybe not a unikernel, because it's still very different, a bit alien for people. Unikraft is making a lot of progress on that, which is good, and we are supporting Unikraft. People can write Dockerfiles, normal VMs, or Unikraft or Mirage applications, and the runtime is able to run these. The runtime itself uses a lot of unikernel technologies: a small PID 1, a small firewall, a small storage system, and everything uses the same kind of library operating system approach. That's the same crypto stack used on the ground, in space, on the kernel side, and on the component side. We reuse all the components everywhere, so we can verify them once and show that they work for various aspects.
[00:32:05] Justin: Right.
[00:32:07] Thomas: But basically, we are trying to provide a very small—right now it's based on Linux, so it's a very small Linux, like everyone else. We're doing a minimal Linux with minimal user space using only OCaml libraries, or a BusyBox-style setup where we have one small Unix-like binary that can respond to things with minimal capabilities given to each component, enforced by the kernel, and which provides a very small API to the application we build.
[00:32:53] Justin: Right, right. You talked about verification, and you said that was where you started. Verification's been getting a lot of talk recently with AI coding and things. Tell me about what you're doing with verification, how you're verifying things, how you see that working, and what's been working well. Obviously with functional programming, verification has been something people have understood well for quite a long time. As you said, you worked on it in your PhD, although perhaps it wasn't with real code back then—it was theoretical. But now we're getting to using things with real code. How's it going?
[00:33:49] Thomas: Yeah, I think that's an interesting turn of events. A lot of people who used to have a PhD in formal methods were a bit depressed at the end of their PhD because they wrote a few papers that nobody really read—it was very niche, and it was so difficult to get results because you were trying to find general results that could apply to everything. I got some results about finding properties of systems that don't have any livelocks, so it's very generic. But today, what's changing is you can write proofs that are not generic. It's very easy to write proofs—you don't write proofs, the LLMs write proofs very well nowadays. You can write the proof just for your system, very targeted, and then you have a result. You don't need to read the proofs; you should trust the kernel of the prover, you should have the right oracle, so you need to check that. You need something not under the control of the LLM to test against. Then it's very easy to get some assurance that what you're building is not too broken. Especially when you look at the cryptographic parts, there are people who have been doing that for years—proving things.
[00:35:26] Justin: Yeah, that was one of the earliest areas where it really started to be applied. AWS have done a lot of work on formally verified cryptography for their library, for example. There's been a lot of work in the last decade, maybe even less, on cryptography. The blockchain people were interested because they had money in it and invested a lot as well. That was kind of the early success story. It's also more tractable because it's small. Yeah,
[00:36:08] Thomas: it's small and it's pretty important, so people are keen to spend money on that. But even then, I discussed with some people maintaining these proofs for crypto, and they told me that even this year they fixed many issues in their proofs thanks to AI. The proof is only good for the specification you came up with, and sometimes your specification is not correct, or maybe it's not enough to protect against the right thing. Or maybe what is broken is what is around the specification. If you want to use the proof in your system, you have to write bindings, and this can be—and usually is—buggy. Everything around the core can be attacked and is attacked. Even those projects that have been using formal methods for a long time are now using LLMs to make sure the core is even more solid than before, and it is becoming more solid. One of the nice properties of the TLS stack of Mirage is that it was built as a pure state machine. You describe the protocol as a state machine: you're in the connecting state, you receive one message, you go to a new state, and the output of that state is the message you send. Everything is described, so you can replay that very easily, write tests for it, and use it as an oracle against other implementations to find bugs or to understand your implementation or state machine. It's a very nice way to do that. Then on top of that, you add I/O: now you read real packets, run your machines in one step, and send packets on the network. It's a very good way to model a lot of different protocols, and it's very similar to how you would model proofs on it. You can extend that approach to a lot of new protocols, and LLMs are very good at doing that because you restrict a lot of what could go wrong.
[00:38:47] Justin: Yeah, and people have been extracting traces from one model and comparing them against a different program—a different TLS stack, for example—and seeing if the state machines match up. There's quite a lot you can do to compare implementations and see where the differences are. People have done that with all the Raft stacks to see if they all do the same thing, even without necessarily knowing which one's right and which one's wrong. Yeah,
[00:39:28] Thomas: but just having a way to point out potential problems is very helpful for people. I've been doing that as well for the CCSDS stack. CCSDS is an official specification for space protocols in general, and they have a lot of weird, interesting network protocols. I've been trying to model that a lot with the help of LLMs, to write proper models and compare existing implementations to see what works or not. It's a very interesting way to explore the design space, come up with good implementations that are solid and working well, and improve interoperability between implementations.
[00:40:28] Justin: What kind of tools are you using for validation and verification? What's your stack look like, and how much are you building ad hoc with LLMs versus reusing existing tools? How could other people start working with these stacks?
[00:40:50] Thomas: The main thing is to start by not inventing everything yourself. Most of the things I'm using are already verified by others, like the cryptographic stack. For example, I'm using EverParse, relying on the EverParse project, which existed before I was around, or Fiat Crypto from MIT. Mirage has used a lot of those projects in the past. I've been building a few things, like parser combinators that can extract things to EverParse. EverParse is a verified parser, and the crypto parser is libcrux—that's the Everest project. Building something that generates an artifact you can prove, and that can also generate efficient code you can run, like in OCaml or in OxCaml, which is a version of OCaml that does less allocation and is a bit similar to Rust, or even to Rust itself. I can compare the performance of all of that, and I can prove that those are working properly compared to the extracted model. I'm always doing something where you have control, usually built by people who are not using LLMs, to make sure they know what they're doing, so you can compare and ensure things are correct. More recently, I started to use a bit—well, I used to write some Rocq before, because of the OCaml link. Rocq is a theorem prover; you can write some proofs there, and you can extract to OCaml and execute in OCaml if you want. But I think LLMs are not very good at writing Rocq; they're better at Lean, which is a new theorem prover that everyone is using for this kind of work.
[00:43:17] Justin: Everyone is using it to do maths, but also programming now as well.
[00:43:21] Thomas: Yeah. Now I'm slowly starting to ask LLMs to write Lean models for my programs and to compare that, using them as oracles for my code. I have two implementations, in Lean and in OCaml, and I compare the results. If there's a bug, it could be in either one, but it's useful to check. You could do the same thing with two implementations in OCaml and Rust or whatever. The more diversity you have, the more interesting differences you can find, and that's where you have to look.
[00:44:02] Justin: And how are you finding the differences? What kind of techniques are you using for that?
[00:44:08] Thomas: There are different ways. When I recently ported Tailwind to OCaml, I got a full implementation of a CSS parser and minifier, which is better than everything anyway. Then I got a Tailwind implementation for that. You need to find a good oracle—that's the magic. What I've been doing is looking at headless Chrome results, taking a screenshot, and comparing pixel by pixel between the normal Tailwind and my Tailwind implementation to see if there's any difference. If yes, I get the trace of where it's different, and I iterate until everything matches. It really depends on what you're trying to do. If you have an existing implementation, it's very easy to write another one to compare.
[00:45:15] Justin: It's easier if it is deterministic. Have you done deterministic simulation stuff?
[00:45:25] Thomas: Yes. In OCaml, we have many ways to write concurrent programs, but one is using Eio, a project some colleagues are developing. The idea of Eio is to control everything that's not deterministic using capabilities. If you want to access the file system, you need a capability—a value you pass around—where you can query the path you want to see on the file system, then for the network, the clock, and random. If you mock those things, you can control exactly what's happening and add determinism to your application. I just released, I think last week, a way to record kernel traces and replay them to your application, so you can simulate failures. You can disconnect in the middle of a write on your disk, or simulate that fsync isn't working properly and you still read old data. All these kinds of weird fault injection, which are very hard to do normally at user space, become easy because you have full control over the capabilities of your application. You can do that for testing.
[00:46:57] Justin: There's been a lot more work on that, particularly for distributed systems, and lots of people are building deterministic VMs of one sort or another. Antithesis is the most well-known, but there are a lot of people who have discovered that technique and are building around it.
[00:47:28] Thomas: I think the trick with formal building is that everything is a library OS. Distributed systems are just sets of libraries that you can...
[00:47:40] Justin: Exactly. It just makes things much easier if you have the code for everything and it's all running in the same application. It's just code in your application, and you can do what you want with it. If you want a deterministic scheduler, you can have one and make the same decision each time.
[00:48:09] Thomas: Yeah, and if you want a network switch in the middle, you have the network switch in the middle, which is like a memory switch. You can decide to drop some packets or not, and you can write simulations. You only need one computer.
[00:48:24] Justin: Even if you don't actually deploy as a unikernel, having the ability to use a unikernel for testing, and having all those system pieces, is really useful for testing. You can do your simulation testing and debugging in a way that lets you see the whole system, not just parts of it.
[00:48:49] Thomas: I have an experiment where I can project all the system state into a SQLite database as virtual tables. You can connect via SSH or Unix, and have a live view of all the connections. You can see yourself as a connection, edit or remove the row, and then you're disconnected or whatever. You can do weird things because you control every layer and can connect them however you want. It's a powerful way to test and have observability in your system. It's pretty cool.
[00:49:33] Justin: Tell me about OxCaml. I've been hearing things about it. I remember a lot of OCaml people looked at the success of Rust and wondered why so many people were suddenly using Rust. You mentioned garbage collection a couple of times, and that's often been a big criticism in the early unikernel days, even though people didn't necessarily have data on whether it mattered. Tell me about OxCaml, what it's trying to do, and where it is.
[00:50:17] Thomas: OxCaml is a variant of OCaml running inside Jane Street, which is one of the largest arbitrage companies on Wall Street. The numbers are very big—I don't know, maybe 10% of Wall Street exchange goes through them or something like that. They need something with no bugs and very high speed, because you have to be the first to react. They were using OCaml everywhere, but for some applications, they needed more speed—performance maybe not as good as Rust—and for some very specific use cases, it needed to be much faster. They started to design a system where you can use normal OCaml everywhere, and then for parts where you need specific performance patterns—like stack allocation, inlining, or fine control over memory layout—you can write specific annotations that tell the OCaml compiler to do something different at runtime. In practice, you can't really merge OCaml and OxCaml code together today, but the goal is that in your codebase, you can have OCaml and OxCaml files together, and the OCaml compiler will just work. For my parser combinator project, the OCaml code I'm generating is faster than the Rust code. I need to write that down, but it's small microbenchmarks, so it doesn't mean much. But it shows that if you tightly control the code you generate, OCaml can be very fast. That's good because you still have strong type safety, the module system, and very fast compilation times—you can edit one file and a few milliseconds later, everything works again.
[00:52:51] Justin: Rust is very slow.
[00:52:53] Thomas: You can keep all the good things about OCaml, but actually say that part of the code should be very fast, and you don't have to change your language to do that. It should be the same tool as the rest. I think it's a pretty good extension to the language.
[00:53:08] Justin: It's interesting because linear types came out of Haskell, trying to make functional programming more efficient by working out when things were linear and could be updated in place. But a lot of the issue with things like that is having annotations so you know what's going to happen, rather than it just being an optimization that might happen. In a way, that's what Rust gave you. Although a lot of Rust programs do a lot of reference counting and aren't purely linear. It's interesting watching how people are working with memory allocation now. With language innovation, linear types are great when things are linear. The Zig people obsessively pre-allocate memory up front and never allocate again. The language doesn't force that, but that's their style. Rust added something to the dialogue about efficient memory allocation, but still, a lot of Rust programs are just doing reference counting much of the time. The existence of linear types doesn't mean you're actually using them all the time, because some things just aren't linear.
[00:54:59] Thomas: Yeah. One of the interesting approaches in OCaml is saying that if you want to be fast, you need to be multicore as well. They want to give some safety about multicore programming, saying that in some parts, there is no race, so by construction, the types will tell us if there is a race somewhere. There are big static guarantees you can get—maybe ten or more families of types—where you can say, is it linear, is it not linear, is it shared, is it not shared? For the programmer, it's maybe a lot to learn, but if it's code you really care about being fast and safe, maybe it's worth it. For the rest of the codebase, you don't care, so you don't use annotations and it doesn't change anything. It's a good trade-off: if something is very important, you care about it, you're willing to write detailed annotations and think hard. For the rest, you trust the compiler and runtime to be good enough and don't want to write all these crazy types.
[00:56:09] Justin: Yeah, because most of the application is not performance critical. It's always a very small amount that actually matters and that you should spend time on, and people don't always realize that. Having a mixture of parts of your program that you care about verification for, parts you care about performance for, and parts you care about both because they're important and need to be fast—there are different parts of a code base. Then there are parts that just don't matter at all because they're initialization or something, and it doesn't matter because it only happens once. There's a lot of different parts of your code. I think we've seen different approaches to that with different programming languages. Ada had Spark, where there was a subset of the language where you could do more formal verification, and it was easier, but it was still embedded in the same language, in the same way as you're saying with OxCaml, that it's embedded in the same language. I think that model is interesting, and maybe we'll see more innovation there as more people want to do verification and things like that.
[00:57:36] Thomas: Yeah, I think it's got gradual verification, so you can start by verifying only the things which are very important and then guarantee that is actually kept properly thanks to a good boundary. In OCaml, you have that kind of MLI system, which is the module system, which is pretty good. If your language allows this kind of compartmentalization of things, or guarantees about performance or safety, I think we need more of that because otherwise it's very hard to understand what is happening.
[00:58:13] Justin: And how has AI changed how you think about programming and how you code and what you do? What's different, what's the same for you?
[00:58:30] Thomas: That's a very complicated question. I have mixed feelings about that. For sure, it's changing everything. Our industry is changing a lot. It's bringing a lot of good changes. A lot of people are saying, why are we changing? Why do we need to change? Why is it useful to write more code so fast? Why are we building these centers using energy to do that? I share that feeling—why are we writing more crappy code? Is it useful? But at the same time, it's a wonderful tool to write good code as well, to improve quality. For me, it has been changing a lot. I'm using those tools quite a lot just to experiment, to understand how they work, and I must use them to understand them because there's so much impact on my different companies, and not doing that would be a fault. I use them, and they help me build better software, I think—building proofs of things that are very complicated. I've found bugs in various libraries that I maintain. What I haven't found yet is how to use it in a collaborative way. How do we improve collaboration instead of creating more silos? This is very hard. I don't know how to solve that. I don't know if anyone has solved that yet.
[01:00:20] Justin: I don't think anyone has. It's interesting. Open source was actually built around a very slow collaboration process. I think it needs to adapt to how you work together with a faster collaboration process. Sending patches around by email and thinking about them hard did build a lot of good software. It turns out it also had a lot of security issues, and the software we thought was good actually wasn't as good as we thought, which is interesting. But I agree that the collaboration processes we have around software haven't really worked out how to change. I think the models of these ecosystems that were really successful, where people would build lots of software that worked well together—like OCaml or the Cloud Native Software Stack, where there's a huge number of people with a shared model of what directions they want to explore—these have been amazingly successful as communities. I think that should be our model of what we're trying to build, but even with more software and more experiments, and also more working together on the things that need to be right: how we fix the bugs, how we make sure things are correct, and how we make really good software rather than just software we thought was good but turned out to be kind of terrible.
[01:02:21] Thomas: Yeah, and maybe the kind of friction of collaboration is what makes the software good as well. Having people argue about things and being slow and thinking very hard about the problem is probably what makes some of the quality of the thing. Of course, it doesn't make the software perfect, but somehow, there's something about that I don't know. But I think what is sure is things are changing a lot and we need to actively try to build better collaboration mechanisms between those tools and maintainers, and it's very helpful for the open source community right now.
[01:03:16] Justin: So what are you excited about in the future? What are you working on now? What are you thinking about now that's new?
[01:03:26] Thomas: I'm trying to build good software. I really want to build software which doesn't break, and I think we have a good opportunity right now to actually do that. It was like a dream before, but now I think we have the tools to make that happen. The fact that formal verification is starting to come back again is a good sign for me. I see people start to think of that as a real problem. The fact that AI is writing a lot of crap is helping motivate that maybe we should do things properly this time. Having good libraries for various projects—it's very easy to write a new library for something useful for you, which is pretty nice, but how do you make sure that it's correct, and what does it mean to be correct? That's the new question: what is in the spec, what is the spec, who is deciding the spec? All this kind of stuff is changing the industry in interesting ways. Maybe we need to think more about what we are building instead of just building blindly, which is pretty good.
[01:04:53] Justin: But I think it also helps people try new things. You can ask your computer to write OCaml without having to learn all the details yourself. One of the problems we had with unikernels was that we needed to write drivers and libraries we didn't have, and that took a long time, whereas it maybe takes less time now. Even if you make them better, it takes a similar or less time. You can experiment with a formally verified crypto stack in less time than you could write a really bad crypto stack before. I think there's a lot of opportunities to move things forward faster if people understand and agree what moving forward actually is, and if they're prepared to make changes that in the past would have seemed more drastic.
[01:05:59] Thomas: Yeah, I agree. The kind of thing I'm looking at right now is a mix of a lot of things we've discussed in the past. If you want to upgrade some code in a satellite, for instance, the code can be small enough to be considered as data, but it's executable data, so it needs to be executed. You mix the delivery of contents with software updates, where you need to make sure you know where it comes from and have proof that it has been started properly. What's interesting with LLM right now is you can actually look at all the different existing RFCs or specifications of various domains—IoT, cloud, embedded, space—and actually they are all based on content addressability, all based on some kind of update mechanism. You can look at what is the common base of all of that, what is different, and why is it different. You can really start to do some science about these very old document specs, you have the ability to expand the kind of knowledge that's hard to get in one individual mind, I guess.
[01:07:31] Justin: Yes, yes.
[01:07:32] Thomas: And then you notice that the IoT TUF update is very similar to the SUIT thing, which has similarities as well.
[01:07:43] Justin: Yes, definitely. I've got views on the similarities between TUF and other things. TUF is a content-addressed spec which looks very similar when you squint—so to say, Git.
[01:08:05] Thomas: Indeed.
[01:08:06] Justin: It's trying to do a lot of the same things, but with a different mechanism. Thinking about things in these broader ways, as you say, AI can actually help you understand differences and similarities between things and build prototypes that help you think about it better.
[01:08:32] Thomas: Yeah, that's a very interesting tool.
[01:08:40] Justin: Well, it's been great catching up with you. We should catch up more often. Next time I'm in Paris.
[01:08:47] Thomas: Of course, whenever you want.
[01:08:52] Justin: Right. Thanks very much.
[01:08:52] Thomas: Thank you.
[01:08:53] Justin: Bye.
[01:08:54] Thomas: Bye-bye.