<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Hypha Pub</title><description>Hypha&apos;s engineering blog: OCaml, systems and how software is put together.</description><link>https://hypha.pub</link><item><title>Handmade code needs a WARNING label</title><link>https://hypha.pub/handmade-code-needs-a-warning-label</link><guid isPermaLink="true">https://hypha.pub/handmade-code-needs-a-warning-label</guid><description>Show today&apos;s engineers anything built with agents, and someone will demand an AI disclosure before they even look at what it does.</description><pubDate>Tue, 03 Nov 2026 12:00:00 GMT</pubDate><content:encoded>&lt;p&gt;That demand says nothing about the actual work, though. Calculating by hand was respected work once, with whole floors of human computers at their machines, and today nobody would brag about a week spent on an equation a computer solves in a few seconds.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://hypha.pub/images/handmade-code-needs-a-warning-label/human-computers.jpg&quot; alt=&quot;A long hall of rows of clerks, most of them women, each at a mechanical calculating machine, under a sign that reads Computing Division, Computing Section. The US Veterans Bureau’s Computing Division in 1924, from the Library of Congress.&quot; width=&quot;1280&quot; height=&quot;1054&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/p&gt;
&lt;p&gt;Meticulously handcrafted software is heading the same way. We built it for years, at its high price and with its own trade-offs, and now deliberate work with agents can reach the same bar in a fraction of the time, which is what the laws of the globally accelerating market enforce.&lt;/p&gt;
&lt;p&gt;And agents bring to that work what no one can keep up for long. They hold far more of a system in view, able to weigh and quick-test dozens of assumptions, reason over the results, and talk to the language server and the profiler instead of going on a hunch. With &lt;a href=&quot;https://hyphatech.io/stack&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Hypha Stack&lt;/a&gt;, most decisions are taken before a model writes a line, and everything after is held by enforced boundaries, the shared ontology, gates no one can skip and validation that proves every change against the agreed scenarios.&lt;/p&gt;
&lt;p&gt;What’s known as “AI slop” exists, of course, and so does the handmade kind (known as “shitcode”). But writing off a whole body of work for the tools behind it is an idiotic prejudice, with the blast radius of any other. I believe it grows in communities that pay for visible effort in stars and respect, and an agent that delivers the same quality without that much labour makes their currency worth less. What I personally need is a solved problem, a working result I can trust, and I couldn’t care less how it was done.&lt;/p&gt;
&lt;p&gt;I find it reasonable to start labelling “HANDMADE” explicitly, like a cup from a market stall, so everyone knows up front it’s the personal taste and approach of whoever made it. It could be graded too, after some mandatory qualification path, so you know before you install it whether that handmade code can be trusted at all, or you’re trying to sell us another piece of pointless rubbish you spent so much time creating.&lt;/p&gt;
&lt;p&gt;Yeah, I see your project on GitHub, cool. Handmade disclosure?&lt;/p&gt;
</content:encoded><author>Roman Zaiev</author></item><item><title>The language that says no</title><link>https://hypha.pub/the-language-that-says-no</link><guid isPermaLink="true">https://hypha.pub/the-language-that-says-no</guid><description>Your agent will cut a corner tonight. Whether that corner ships depends on the language you gave it.</description><pubDate>Wed, 21 Oct 2026 12:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In the 1970s &lt;a href=&quot;https://en.wikipedia.org/wiki/Robin_Milner&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Robin Milner&lt;/a&gt;, a computer scientist at the University of Edinburgh, was working on &lt;a href=&quot;https://en.wikipedia.org/wiki/Logic_for_Computable_Functions&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;LCF&lt;/a&gt;, a program to check mathematical proofs, and it became one of the three achievements his Turing Award named in 1991. Asked about it in a &lt;a href=&quot;http://users.sussex.ac.uk/~mfb21/interviews/milner/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;2003 interview&lt;/a&gt;, he described a night at the computer:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So if you stayed late at night working out a proof with the computer, you wouldn’t have to think afterwards “gosh, did I cut a few corners?”, because the LCF system just wouldn’t have allowed you to do so!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Fifty years on, the one up all night at the computer is an agent, and it cuts corners.&lt;/p&gt;
&lt;p&gt;In LCF, proofs were driven by small programs Milner called “tactics”, which could be clever, sloppy or plain wrong. A theorem was an abstract type, &lt;code&gt;thm&lt;/code&gt;, whose only operations were the rules of inference, and “strict typechecking then ensured that the only values that could be created were those that could be obtained from axioms by applying a sequence of inference rules – namely theorems.”&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-gordon&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;1&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-gordon&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 1&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Michael J. C. Gordon, &lt;a href=&quot;https://www.cl.cam.ac.uk/archive/mjcg/papers/HolHistory.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;From LCF to HOL: a short history&lt;/a&gt;, in &lt;em&gt;Proof, Language, and Interaction&lt;/em&gt;, MIT Press, 2000. And David MacQueen, Robert Harper and John Reppy, &lt;a href=&quot;https://doi.org/10.1145/3386336&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;The History of Standard ML&lt;/a&gt;, HOPL IV, 2020. &lt;/span&gt;&lt;/span&gt; A tactic could fail, loop or give up, and still could not hand you a false theorem, because no such value could be built. The language he designed to write the tactics in was called ML, the MetaLanguage, and OCaml is what it grew into.&lt;/p&gt;
&lt;h2 id=&quot;from-lcf-to-ocaml&quot;&gt;From LCF to OCaml&lt;/h2&gt;
&lt;p&gt;ML outlived the prover it was made for. In 1978 Milner proved that a program his type checker accepted could not “go wrong”, and the checker needed no annotations, because it inferred every type itself.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-types1978&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;2&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-types1978&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 2&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Robin Milner, &lt;a href=&quot;https://homepages.inf.ed.ac.uk/wadler/papers/papers-we-love/milner-type-polymorphism.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;A Theory of Type Polymorphism in Programming&lt;/a&gt;, &lt;em&gt;Journal of Computer and System Sciences&lt;/em&gt; 17, 1978. Roger Hindley had found the principal type independently, for combinatory logic, in 1969. &lt;/span&gt;&lt;/span&gt; His Turing Award named ML too, as “the first language to include polymorphic type inference together with a type-safe exception-handling mechanism”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-turing&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;3&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-turing&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 3&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;The ACM Turing Award citation, 1991, as given in &lt;a href=&quot;https://www.cl.cam.ac.uk/misc/obituaries/milner/0-Prologue.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Robin Milner 1934–2010&lt;/a&gt;, POPL 2011. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;At INRIA, Gérard Huet’s team took ML in its own direction and released Caml in 1987. Xavier Leroy rewrote it as Caml Light in 1990, gave it a native compiler and a module system in 1995, and with Didier Rémy and Jérôme Vouillon’s objects it became Objective Caml in 1996, OCaml for short, in which one program can be functional, imperative and object-oriented at once.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-history&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;4&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-history&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 4&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://ocaml.org/history&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;A History of OCaml&lt;/a&gt;, ocaml.org. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;figure class=&quot;video&quot;&gt;&lt;div class=&quot;player&quot;&gt;&lt;iframe src=&quot;https://www.youtube-nocookie.com/embed/9Cswiqrq6So&quot; title=&quot;Creator of OCaml: Functional Programming, Formal Verification, Programming Languages | Xavier Leroy&quot; loading=&quot;lazy&quot; allow=&quot;encrypted-media; picture-in-picture; fullscreen&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;figcaption&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=9Cswiqrq6So&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Creator of OCaml: Functional Programming, Formal Verification, Programming Languages | Xavier Leroy&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;People started building with it things that had to be right. In 2003 Astrée, an analyser written in OCaml at the École normale supérieure, proved that the primary flight control software of the Airbus A340, 132,000 lines of C, could never stop on a run-time error, and Airbus took it on for the A380.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-astree&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;5&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-astree&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 5&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://www.astree.ens.fr/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;The Astrée Static Analyzer&lt;/a&gt;, École normale supérieure. &lt;/span&gt;&lt;/span&gt; Jane Street, the trading firm that would grow into Wall Street’s leading market maker, began writing its systems in OCaml in the early 2000s.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-jane-early&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;6&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-jane-early&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 6&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://homepages.inf.ed.ac.uk/wadler/realworld/janest.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Jane Street Capital&lt;/a&gt;, in Philip Wadler’s list of functional programming in the real world. &lt;/span&gt;&lt;/span&gt; Facebook wrote the type checkers for Hack and Flow in it, and Infer, which checks every change to its mobile apps before it ships.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-facebook&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;7&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-facebook&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 7&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://engineering.fb.com/2014/03/20/developer-tools/hack-a-new-programming-language-for-hhvm/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Hack: a new programming language for HHVM&lt;/a&gt;, March 2014, &lt;a href=&quot;https://engineering.fb.com/2014/11/18/web/flow-a-new-static-type-checker-for-javascript/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Flow, a new static type checker for JavaScript&lt;/a&gt;, November 2014, and &lt;a href=&quot;https://engineering.fb.com/2015/06/11/developer-tools/open-sourcing-facebook-infer-identify-bugs-before-you-ship/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Open-sourcing Facebook Infer&lt;/a&gt;, June 2015, Engineering at Meta. &lt;/span&gt;&lt;/span&gt; Fun fact, the first Rust compiler was written in OCaml too, until Rust could compile itself in 2011,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-rust&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;8&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-rust&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 8&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://rustc-dev-guide.rust-lang.org/building/bootstrapping/intro.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Bootstrapping the compiler&lt;/a&gt;, the rustc-dev-guide. &lt;/span&gt;&lt;/span&gt; and so is the reference interpreter of WebAssembly.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-wasm&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;9&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-wasm&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 9&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://github.com/WebAssembly/spec/blob/main/interpreter/README.md&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;The WebAssembly reference interpreter&lt;/a&gt;. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What grew around the language took a different path. Its community came mostly from universities, research labs and companies where guarantees mattered more than anything else, and each built the tools it needed. For years OCaml had two standard libraries, several build systems, a few quite different ways to compile to JavaScript, and two concurrency libraries incompatible with each other, which left “a split OCaml world with almost no interoperability, and duplication of efforts”, as one of their users put it in 2014.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-split&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;10&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-split&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 10&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Rudi Grinberg, &lt;a href=&quot;http://rgrinberg.com/posts/abandoning-async/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Abandoning Async&lt;/a&gt;, December 2014. The second standard library is Jane Street’s &lt;a href=&quot;https://github.com/janestreet/base&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Base&lt;/a&gt;. &lt;/span&gt;&lt;/span&gt; The language was ready long before its ecosystem, and for years the ecosystem was what people judged it by.&lt;/p&gt;
&lt;p&gt;Meanwhile the language kept moving. Until version 5, OCaml, like many other languages at the time, was multi-threaded but single-core, because its runtime, garbage collector included, “was really designed with sequential executions in mind”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-leroy-gc&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;11&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-leroy-gc&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 11&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Xavier Leroy, &lt;a href=&quot;https://www.developing.dev/p/creator-of-ocaml-functional-programming&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Creator of OCaml: Functional Programming, Formal Verification, Programming Languages&lt;/a&gt;, interviewed by Ryan Peterman, July 2026. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Making a runtime truly parallel is hard in itself. The garbage collector has to keep working while many threads change memory at once, and stay fast, since the easy way out, a lock around every operation on memory, would make a program “run as slowly as on a single processor”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-leroy-lock&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;12&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-leroy-lock&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 12&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Xavier Leroy, &lt;a href=&quot;https://www.developing.dev/p/creator-of-ocaml-functional-programming&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Creator of OCaml: Functional Programming, Formal Verification, Programming Languages&lt;/a&gt;, interviewed by Ryan Peterman, July 2026. &lt;/span&gt;&lt;/span&gt; The language also needs a memory model that says what a program may see when two threads touch the same data, every choice trading speed against simplicity.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-memory&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;13&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-memory&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 13&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Stephen Dolan, KC Sivaramakrishnan and Anil Madhavapeddy, &lt;a href=&quot;https://kcsrk.info/papers/pldi18-memory.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Bounding Data Races in Space and Time&lt;/a&gt;, PLDI 2018. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Doing it to a mature language is harder still, because the millions of lines already written must keep working, and keep their speed.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-parallel&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;14&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-parallel&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 14&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;14&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;KC Sivaramakrishnan and others, &lt;a href=&quot;https://arxiv.org/abs/2004.11663&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Retrofitting Parallelism onto OCaml&lt;/a&gt;, ICFP 2020. &lt;/span&gt;&lt;/span&gt; The OCaml team, most of it at OCaml Labs in Cambridge, spent more than eight years on it. OCaml 5 came out in December 2022 with parallelism across cores and algebraic effects.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-ocaml5&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;15&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-ocaml5&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 15&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://ocaml.org/changelog/2022-12-16-ocaml-50&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;OCaml 5.0.0 is out&lt;/a&gt;, 16 December 2022. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id=&quot;what-is-a-type&quot;&gt;What is a type&lt;/h2&gt;
&lt;p&gt;All of that rests on the one thing Milner put in first, the type, and the word is used loosely enough to need pinning down before anything leans on it.&lt;/p&gt;
&lt;p&gt;The idea is older than computers. Bertrand Russell sketched a theory of types in 1903 and set it out in 1908, to keep mathematics out of its paradoxes by sorting things into kinds that cannot be mixed, and in 1940 Alonzo Church gave it the form programming languages later borrowed.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-russell&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;16&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-russell&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 16&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Thierry Coquand, &lt;a href=&quot;https://plato.stanford.edu/entries/type-theory/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Type Theory&lt;/a&gt;, the Stanford Encyclopedia of Philosophy. &lt;/span&gt;&lt;/span&gt; A type in a program does the same job. It says what kind of thing a value is, and so what can be done with it.&lt;/p&gt;
&lt;p&gt;Every program makes assumptions about its data. This value is a number, that list is never empty, a payment is in one of four states. A type writes such an assumption down where a machine can check it. A language without types still has the assumptions, keeps them in the programmer’s head, and finds out one was wrong when the program runs, in front of whoever is using it. That works while the person who made the assumptions is the one changing the code. It stops working when the code is large, or old, or changed by someone who was never told, and that describes most code an agent touches.&lt;/p&gt;
&lt;p&gt;Types can do that job in two ways. A type can describe a value or bind it. A binding type is one the program cannot break, whatever code anyone writes, the way a binding contract is one you cannot walk away from when it gets inconvenient. A describing type is the program’s own account of itself, and nothing makes it true.&lt;/p&gt;
&lt;p&gt;The two languages most of us write are Python and TypeScript.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-survey&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;17&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-survey&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 17&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;17&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://survey.stackoverflow.co/2025/technology&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Stack Overflow Developer Survey 2025&lt;/a&gt;, technology. &lt;/span&gt;&lt;/span&gt; In both, the types came afterwards, written on top of a language that runs without them.&lt;/p&gt;
&lt;p&gt;JavaScript was made in 1995 so that anyone could write a few lines straight into a web page,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-js&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;18&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-js&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 18&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Allen Wirfs-Brock and Brendan Eich, &lt;a href=&quot;https://zenodo.org/records/4960086&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;JavaScript: The First 20 Years&lt;/a&gt;, HOPL IV, 2020. &lt;/span&gt;&lt;/span&gt; and for years those lines mostly made text scroll and snow fall. Then it grew into the language of every web application, with nothing to hold one together. TypeScript is the most successful attempt to fix that. It is JavaScript with types written in, and its compiler checks them and then strips them out, so what runs is plain JavaScript that knows nothing of them. To work with whatever JavaScript was already there, its design goals promise to “preserve runtime behavior of all JavaScript code” and keep the types “fully erasable”, and they list a sound type system among the non-goals.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-ts-goals&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;19&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-ts-goals&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 19&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/wiki/TypeScript-Design-Goals&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;TypeScript Design Goals&lt;/a&gt;, goals 7 and 9, and non-goal 3. &lt;/span&gt;&lt;/span&gt; So every type can be opted out of, and the way out is &lt;code&gt;any&lt;/code&gt;. A value of type &lt;code&gt;any&lt;/code&gt; can be called, assigned and read from as anything, and whatever is read from it is &lt;code&gt;any&lt;/code&gt; too,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-any&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;20&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-any&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 20&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://www.typescriptlang.org/docs/handbook/2/everyday-types.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Everyday Types&lt;/a&gt;, the TypeScript Handbook. &lt;/span&gt;&lt;/span&gt; so one &lt;code&gt;any&lt;/code&gt; spreads quietly through every value it touches. &lt;code&gt;JSON.parse&lt;/code&gt; returns one, and this compiles without a word:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; chargeCard&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt;customerId&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; amount&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; ...&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; shipping &lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; 5&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; order &lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; JSON&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;parse&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;        // any&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; total &lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; order&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;total &lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; shipping&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;  // any too, and the API sent &quot;49.90&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;chargeCard&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;order&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;customerId&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; total&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;   // accepted as a number, charges &quot;49.905&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A TypeScript codebase is as strict as its least careful line, and at worst it is JavaScript with annotations.&lt;/p&gt;
&lt;p&gt;Python was never about types. Guido van Rossum started it in December 1989 as a hobby project for the Christmas week,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-guido&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;21&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-guido&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 21&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;21&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Guido van Rossum, &lt;a href=&quot;https://www.python.org/doc/essays/foreword/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Foreword for “Programming Python”&lt;/a&gt;, 1996. &lt;/span&gt;&lt;/span&gt; and it grew up as a language for prototypes, scripts and science long before anyone asked it to hold a large system together. Types arrived in 2014 as hints, with the promise that “Python will remain a dynamically typed language, and the authors have no desire to ever make type hints mandatory, even by convention”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-pep484&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;22&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-pep484&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 22&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;22&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://peps.python.org/pep-0484/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;PEP 484 – Type Hints&lt;/a&gt;, 2014. &lt;/span&gt;&lt;/span&gt; What checking there is lives in separate tools, mypy and pyright, each with its own rules, and only if somebody runs them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A type that describes is advice, and an agent takes advice the way it takes instructions. A type that binds is a check, and a check cannot be ignored.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;what-the-compiler-refuses&quot;&gt;What the compiler refuses&lt;/h2&gt;
&lt;p&gt;Now OCaml. Take a payment. It is pending, paid, refunded or disputed, and each state carries only what belongs to it:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ocaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; payment&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; =&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; Pending&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; Paid&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; amount&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; receipt&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; string &lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; Refunded&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; amount&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; reason&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; string &lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; Disputed&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; amount&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; case_id&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; string &lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Only a paid payment has a receipt, and there is no way to write a refund without its reason. Disputes came last, and somebody forgot the one function that decides whether a payment can be refunded:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ocaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; can_refund&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; function&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; Paid&lt;/span&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt; _&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; Pending&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; Refunded&lt;/span&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt; _&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; false&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Warning 8 [partial-match]: this pattern-matching is not exhaustive.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Here is an example of a case that is not matched: Disputed _&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The compiler finds the function nobody opened and names the case it misses. It reports it as a warning, and Dune, OCaml’s build tool, turns the warning into an error in development builds,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-dune-profiles&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;23&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-dune-profiles&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 23&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;23&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://dune.readthedocs.io/en/stable/concepts/profiles.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Dune’s build profiles&lt;/a&gt;. &lt;/span&gt;&lt;/span&gt; so nothing builds until every such function has been handled. TypeScript catches it only in a switch whose author remembered to add a workaround for it, Python only when a separate checker runs in strict mode, and Go has no such types at all.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-exhaustive&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;24&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-exhaustive&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 24&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://www.typescriptlang.org/docs/handbook/2/narrowing.html#exhaustiveness-checking&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Exhaustiveness checking&lt;/a&gt;, the TypeScript Handbook, &lt;a href=&quot;https://typing.python.org/en/latest/guides/unreachable.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Unreachable code and exhaustiveness checking&lt;/a&gt;, Python’s typing documentation, and &lt;a href=&quot;https://go.dev/doc/faq#variant_types&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Why does Go not have variant types?&lt;/a&gt;, the Go FAQ. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;There is no null either. Tony Hoare added the null reference to ALGOL W in 1965, “simply because it was so easy to implement”, and later called it his billion-dollar mistake.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-hoare&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;25&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-hoare&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 25&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Tony Hoare, &lt;a href=&quot;https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Null References: The Billion Dollar Mistake&lt;/a&gt;, QCon London, 2009. &lt;/span&gt;&lt;/span&gt; Java still pays it on every reference. Go pays it twice, since an interface holding a nil pointer is not itself nil, and its FAQ has a whole entry on why “my nil error value” is not equal to nil.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-go-nil&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;26&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-go-nil&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 26&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://go.dev/doc/faq#nil_error&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Why is my nil error value not equal to nil?&lt;/a&gt;, the Go FAQ. &lt;/span&gt;&lt;/span&gt; In OCaml a &lt;code&gt;user&lt;/code&gt; is always a user, and a user who might not be there is a &lt;code&gt;user option&lt;/code&gt;, which the compiler makes you open before you touch it.&lt;/p&gt;
&lt;h2 id=&quot;effects&quot;&gt;Effects&lt;/h2&gt;
&lt;p&gt;A program spends much of its life waiting, for a database, the network, a disk. The simplest way to wait is to block, to stop the thread until the answer comes, and most web frameworks did just that for years, one thread per request, which holds up until there are more requests than threads a machine can afford. The other way is an event loop, one thread that never waits and juggles thousands of requests, starting each piece of I/⁠O and coming back to it when it is done.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;async&lt;/code&gt; and &lt;code&gt;await&lt;/code&gt; are how TypeScript, Python and Rust let ordinary-looking code run on that loop. They tell the compiler where a function may pause and hand the thread back to the loop, and they do nothing else, so one blocking call inside an &lt;code&gt;async&lt;/code&gt; function still stalls everything else on it. And the marks spread. Bob Nystrom called it in 2015 “the colour of a function”, because an &lt;code&gt;async&lt;/code&gt; function can only be awaited from another &lt;code&gt;async&lt;/code&gt; one.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-colour&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;27&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-colour&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 27&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;27&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Bob Nystrom, &lt;a href=&quot;https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What Color is Your Function?&lt;/a&gt;, 2015. &lt;/span&gt;&lt;/span&gt; Here is a greeting built on a lookup that reads from memory:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; findUser&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;):&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; User&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; ...&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; greet&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;):&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; `Hello, &lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;findUser&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; welcome&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;):&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; `&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;greet&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;&amp;lt;/h1&amp;gt;`&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The lookup moves to a database and becomes &lt;code&gt;async&lt;/code&gt;, and &lt;code&gt;greet&lt;/code&gt; stops compiling, because what comes back is no longer a user:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Property &apos;name&apos; does not exist on type &apos;Promise&amp;lt;User&amp;gt;&apos;.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So &lt;code&gt;greet&lt;/code&gt; becomes &lt;code&gt;async&lt;/code&gt;, then &lt;code&gt;welcome&lt;/code&gt;, then whatever calls &lt;code&gt;welcome&lt;/code&gt;, all the way up:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; findUser&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;):&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;User&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; ...&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; greet&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;):&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; `Hello, &lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; findUser&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;)).&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; welcome&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;):&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; `&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; greet&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;&amp;lt;/h1&amp;gt;`&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;One function started waiting and three changed. Libraries split the same way, one kind for code that waits and one for code that doesn’t, and in Rust it runs deep enough that its language team opened an initiative in 2022 to let one function be both.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-keyword-generics&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;28&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-keyword-generics&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 28&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;28&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://blog.rust-lang.org/inside-rust/2022/07/27/keyword-generics/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Announcing the Keyword Generics Initiative&lt;/a&gt;, Inside Rust, July 2022. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;OCaml 5 has a different answer, from programming language research, called algebraic effects.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-plotkin&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;29&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-plotkin&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 29&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;29&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Gordon Plotkin and Matija Pretnar, &lt;a href=&quot;https://homepages.inf.ed.ac.uk/gdp/publications/Effect_Handlers.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Handlers of Algebraic Effects&lt;/a&gt;, ESOP 2009. &lt;/span&gt;&lt;/span&gt; A function can perform an effect, a request it does not answer itself, and a handler somewhere up the stack answers it and resumes the function exactly where it stopped, like an exception that can come back with a value:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ocaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;(* Declare an effect: a question whose answer is a string. *)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; _&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; Effect&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; +=&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; Ask_name&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; string &lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;Effect&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;t&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;(* greet asks the question and carries on with the answer. *)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; greet&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; ()&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; &quot;Hello, &quot;&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; ^&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; Effect&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;perform &lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;Ask_name&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; ()&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; =&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;  match&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; greet &lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; with&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;  (* greet finished: print what it returned. *)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; greeting&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; print_endline greeting&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;  (* greet asked for a name: k is the rest of greet, paused there.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;     Resume it with the answer. *)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; effect&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; Ask_name&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; k&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; Effect&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;Deep&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;continue k &lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;&quot;Robin&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code&gt;greet&lt;/code&gt; asks for a name without knowing who answers. Here the handler answers “Robin”. A test could answer with a fixture, and a scheduler could answer “not yet”, put &lt;code&gt;greet&lt;/code&gt; aside, run something else, and come back once the name arrives from a database. Generators, coroutines, lightweight threads and &lt;code&gt;async&lt;/code&gt; itself can all be built this way, as libraries, with nothing marked in between.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-retrofit&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;30&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-retrofit&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 30&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;KC Sivaramakrishnan, Stephen Dolan, Leo White, Tom Kelly, Sadiq Jaffer and Anil Madhavapeddy, &lt;a href=&quot;https://arxiv.org/abs/2104.00250&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Retrofitting Effect Handlers onto OCaml&lt;/a&gt;, PLDI 2021. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;That one mechanism does more than end the colours. Code asks, and the handler around it decides, so what other languages need a dependency injection framework for comes close to being a property of the language. And a paused function keeps a real stack of its own, so the debuggers and profilers that walk the stack keep working on code that waits.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-retrofit-stack&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;31&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-retrofit-stack&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 31&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;31&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;The same paper: the implementation “remains compatible with program analysis tools that inspect the stack”. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;TypeScript has an ambitious library after the same idea, Effect, where a program is a value of type &lt;code&gt;Effect&amp;lt;Success, Error, Requirements&amp;gt;&lt;/code&gt;, “a description of a workflow or operation that is lazily executed”, which tracks in its types the errors and dependencies OCaml leaves untyped.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-effect-ts&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;32&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-effect-ts&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 32&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://effect.website/docs/getting-started/the-effect-type/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;The Effect Type&lt;/a&gt;, Effect’s documentation. &lt;/span&gt;&lt;/span&gt; It is a library on top of the language, though, so the code that uses it is written as Effect values, in generators or pipelines, and calling it from plain TypeScript is a boundary of its own, another colour. OCaml has effects in the language itself, so a function that uses one is written like any other function, and the functions that call it do not change.&lt;/p&gt;
&lt;p&gt;Eio is the library that puts effects to work for I/⁠O and concurrency in OCaml 5.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-eio&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;33&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-eio&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 33&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;33&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://github.com/ocaml-multicore/eio&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Eio&lt;/a&gt;, effects-based direct-style I/⁠O for OCaml 5. &lt;/span&gt;&lt;/span&gt; It sets a waiting function aside and runs others until its answer arrives, so the lookup can move to a database and &lt;code&gt;greet&lt;/code&gt; does not change by a character:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ocaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; greet&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; db&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; id&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; &quot;Hello, &quot;&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; ^&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;Users&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;find db id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;and running two lookups at once is a function call, not a new kind of function:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ocaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; profile&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; db&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; id&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; =&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; orders&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; =&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;    Eio&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;Fiber&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;pair&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;      (&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; ()&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; Users&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;find db id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;      (&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; ()&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; Orders&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;recent db id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;  in&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;  {&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; orders&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;For an agent it is the difference between a change and a cascade. Making one function talk to the network touches that one function in OCaml, and in a coloured language it touches every caller up to &lt;code&gt;main&lt;/code&gt;, in files the agent was never asked to open. OCaml is one of very few languages with effects built in, and the research behind them is still moving.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-modal-effects&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;34&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-modal-effects&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 34&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;34&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;On typed effects, which the compiler would check: Wenhao Tang, Leo White, Stephen Dolan, Daniel Hillerström, Sam Lindley and Anton Lorenzen, &lt;a href=&quot;https://arxiv.org/abs/2407.11816&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Modal Effect Types&lt;/a&gt;, OOPSLA 2025. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id=&quot;what-the-others-traded&quot;&gt;What the others traded&lt;/h2&gt;
&lt;p&gt;Rust stands apart, and for good reason. It was made to solve the memory safety problem, and it solves it.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-rust-why&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;35&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-rust-why&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 35&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://www.rust-lang.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Why Rust?&lt;/a&gt;, rust-lang.org: its “rich type system and ownership model guarantee memory-safety and thread-safety”, “with no runtime or garbage collector”. &lt;/span&gt;&lt;/span&gt; The price is an ownership model the engineer works out and the compiler enforces, who owns each value, who may borrow it and for how long. Leroy calls it “the finest language that I know for manual memory management”, and that is its trade, since “it’s significantly harder to write programs when you have to manage your memory”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-leroy-rust&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;36&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-leroy-rust&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 36&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;36&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Xavier Leroy, &lt;a href=&quot;https://www.developing.dev/p/creator-of-ocaml-functional-programming&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Creator of OCaml: Functional Programming, Formal Verification, Programming Languages&lt;/a&gt;, interviewed by Ryan Peterman, July 2026. &lt;/span&gt;&lt;/span&gt; It shows in the code. Here is a cache of users in Rust:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;rust&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; remember&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;cache&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;Rc&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;RefCell&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;HashMap&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;u64&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; Rc&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;User&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;,&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; User&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; Rc&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt;User&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; user &lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; Rc&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;    cache&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;borrow_mut&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;insert&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; Rc&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;clone&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;(&amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;user&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;    user&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A39B91&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The same in OCaml:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ocaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; remember&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; cache&lt;/span&gt;&lt;span style=&quot;color:#E8C48E&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; =&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;  Hashtbl&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;replace cache user&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; user&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;  user&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Every word Rust adds is about memory, and none of it is about users. An agent writing Rust spends its effort, and the compiler its refusals, on the machinery rather than on the domain. Rust’s own survey found that 55% of those who answered wait more than ten seconds for an incremental rebuild of their slowest project, and compile times were among the reasons given by 45% of those who stopped using it.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-rust-survey&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;37&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-rust-survey&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 37&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;37&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://blog.rust-lang.org/2025/09/10/rust-compiler-performance-survey-2025-results/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Rust compiler performance survey 2025 results&lt;/a&gt;, September 2025. &lt;/span&gt;&lt;/span&gt; An agent works in a loop, a change and the compiler’s feedback, many times over, and the OCaml compiler keeps that loop short. What it builds is predictable too, so you know before it runs what will be fast and what will be slow.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-leroy-cost&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;38&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-leroy-cost&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 38&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;38&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Xavier Leroy, &lt;a href=&quot;https://www.developing.dev/p/creator-of-ocaml-functional-programming&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Creator of OCaml: Functional Programming, Formal Verification, Programming Languages&lt;/a&gt;, interviewed by Ryan Peterman, July 2026. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://hypha.pub/images/the-language-that-says-no/six-languages.svg&quot; alt=&quot;Six languages against six properties of their types. Java checks every case since version 21, has null, is sound, infers only local types, collects garbage and has no async colours since its virtual threads. TypeScript checks every case only with a manual idiom, keeps null out only under a flag, is unsound by design, infers locally, collects garbage and colours functions with async. Python has none of the checks, collects garbage and colours functions with async. Go has no variant types, has nil, is sound, infers only locals, collects garbage and has no colours. Rust checks every case, has no null, is sound, infers inside function bodies, manages memory through ownership instead of a collector, and colours functions with async. OCaml has all six.&quot; width=&quot;694&quot; height=&quot;356&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;drawing&quot;&gt;&lt;/p&gt;
&lt;p&gt;Every one of them traded something away, and OCaml traded the least. It reads like what it means. Every module has its contract in an interface file, every state is named in a type, so nobody has to read the code, and anybody can.&lt;/p&gt;
&lt;h2 id=&quot;who-bet-on-it&quot;&gt;Who bet on it&lt;/h2&gt;
&lt;p&gt;The biggest bet is Jane Street’s. Its people made it “the world’s largest industrial user of the language”,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-rwo&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;39&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-rwo&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 39&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;39&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Yaron Minsky’s biography in &lt;a href=&quot;https://dev.realworldocaml.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Real World OCaml&lt;/a&gt;. &lt;/span&gt;&lt;/span&gt; with more than thirty million lines of OCaml written by over five hundred people,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-jane-scale&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;40&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-jane-scale&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 40&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://ocaml.org/success-stories/large-scale-trading-system&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Large Scale Trading System&lt;/a&gt;, ocaml.org. &lt;/span&gt;&lt;/span&gt; and Reuters reported a record $39.6 billion of net trading revenue for it in 2025, calling it “Wall Street’s leading market maker”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-reuters&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;41&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-reuters&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 41&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;41&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Anirban Sen, &lt;a href=&quot;https://www.marketscreener.com/news/jane-street-s-40-billion-trading-haul-tops-rivals-sources-say-ce7f59dfdf8ff52d&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Jane Street’s $40 billion trading haul tops rivals, sources say&lt;/a&gt;, Reuters, April 2026. &lt;/span&gt;&lt;/span&gt; What it wants from OCaml is speed, reliability and code that people who are not programmers can read, “like financial engineers or quantitative analysts”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-leroy-jane&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;42&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-leroy-jane&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 42&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Xavier Leroy, &lt;a href=&quot;https://www.developing.dev/p/creator-of-ocaml-functional-programming&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Creator of OCaml: Functional Programming, Formal Verification, Programming Languages&lt;/a&gt;, interviewed by Ryan Peterman, July 2026. &lt;/span&gt;&lt;/span&gt; It gives back in kind. Jane Street is a platinum sponsor of the OCaml Software Foundation,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-ocsf&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;43&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-ocsf&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 43&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;43&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://ocaml-sf.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;The OCaml Software Foundation&lt;/a&gt;, its sponsors. &lt;/span&gt;&lt;/span&gt; funds work on the compiler,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-ocamlpro&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;44&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-ocamlpro&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 44&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;44&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://www.ocamlpro.com/2021/02/02/2020-at-ocamlpro/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;2020 at OCamlPro&lt;/a&gt;, on Flambda, built with Jane Street. &lt;/span&gt;&lt;/span&gt; and Yaron Minsky, who brought OCaml there and heads its technology group, co-wrote Real World OCaml, the book on using it in production, which anyone can read online.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-rwo-book&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;45&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-rwo-book&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 45&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;45&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Yaron Minsky and Anil Madhavapeddy, &lt;a href=&quot;https://dev.realworldocaml.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Real World OCaml&lt;/a&gt;, second edition, Cambridge University Press, 2022. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Bloomberg built BuckleScript, a compiler from OCaml to JavaScript, in 2016,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-bucklescript&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;46&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-bucklescript&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 46&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;46&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://www.infoworld.com/article/3117246/ocaml-compiler-brings-type-safety-to-javascript.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;OCaml compiler brings type safety to JavaScript&lt;/a&gt;, InfoWorld, September 2016. &lt;/span&gt;&lt;/span&gt; and Melange carried it on inside the OCaml world when BuckleScript became ReScript.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-melange&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;47&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-melange&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 47&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;47&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://melange.re/v7.0.1/rationale.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Melange’s rationale&lt;/a&gt;, melange.re. &lt;/span&gt;&lt;/span&gt; Ahrefs, the SEO company, crawls the whole web every day with OCaml on more than four thousand servers,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-ahrefs&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;48&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-ahrefs&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 48&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;48&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://ocaml.org/success-stories/petabyte-scale-web-crawling-and-data-processing&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Petabyte-Scale Web Crawling and Data Processing&lt;/a&gt;, ocaml.org, and &lt;a href=&quot;https://ahrefs.com/careers/ocaml-developer&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;OCaml Developer&lt;/a&gt;, Ahrefs careers. &lt;/span&gt;&lt;/span&gt; and in 2023 it moved all of its front ends to Melange as well.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-ahrefs-melange&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;49&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-ahrefs-melange&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 49&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;49&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://tech.ahrefs.com/ahrefs-is-now-built-with-melange-b14f5ec56df4&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Ahrefs is now built with Melange&lt;/a&gt;, Ahrefs tech blog, May 2023. &lt;/span&gt;&lt;/span&gt; MirageOS builds unikernels in OCaml, each an operating system made of only the libraries one application needs, and Docker’s networking on Mac and Windows came from it.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-docker&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;50&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-docker&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 50&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://mirage.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;MirageOS&lt;/a&gt;, and Anil Madhavapeddy, &lt;a href=&quot;https://www.docker.com/blog/docker-unikernels-open-source/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Improving Docker with Unikernels&lt;/a&gt;, Docker blog, May 2016. &lt;/span&gt;&lt;/span&gt; Owl, begun at the University of Cambridge in 2016, does scientific and engineering computing in OCaml.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-owl&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;51&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-owl&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 51&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;51&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://ocaml.xyz/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Owl&lt;/a&gt;, a system for scientific and engineering computing in OCaml. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The objection that matters for agents is that models have read far less OCaml than TypeScript or Python, and Jane Street trains its own for that reason.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-jane-ai&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;52&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-jane-ai&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 52&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;52&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;John Crepezzi, &lt;a href=&quot;https://ai.engineer/talks/building-ai-powered-developer-tools-at-jane-street&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Building AI-Powered Developer Tools at Jane Street&lt;/a&gt;, AI Engineer Summit, 2025. &lt;/span&gt;&lt;/span&gt; Leroy’s latest feedback is that the OCaml models write is “quite decent and quite similar in quality to more popular languages”, and that “one thing that seems to help the generative AI is a type system”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-leroy-llm&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;53&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-leroy-llm&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 53&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;53&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Xavier Leroy, &lt;a href=&quot;https://www.developing.dev/p/creator-of-ocaml-functional-programming&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Creator of OCaml: Functional Programming, Formal Verification, Programming Languages&lt;/a&gt;, interviewed by Ryan Peterman, July 2026. &lt;/span&gt;&lt;/span&gt; Where a model does get it wrong, the compiler tells it so on its first try. In a language that describes, the same mistake gets through and waits for a user to find it.&lt;/p&gt;
&lt;p&gt;Writing code gets cheaper, and checking that it is correct does not.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-leroy-slop&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;54&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-leroy-slop&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 54&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;54&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Xavier Leroy, &lt;a href=&quot;https://www.developing.dev/p/creator-of-ocaml-functional-programming&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Creator of OCaml: Functional Programming, Formal Verification, Programming Languages&lt;/a&gt;, interviewed by Ryan Peterman, July 2026. &lt;/span&gt;&lt;/span&gt; A type checker is the cheapest check there is.&lt;/p&gt;
&lt;h2 id=&quot;one-language-to-rule-them-all&quot;&gt;One language to rule them all&lt;/h2&gt;
&lt;p&gt;OCaml’s problem was never a lack of libraries so much as libraries that fit together. A library that made its own choices about errors, JSON or time makes every one around it translate. A coherent ecosystem is what matters, and it is why Jane Street built its own, with its own standard library, its own concurrency and its own build tool, which became Dune, the one most OCaml projects build with.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-jane-world&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;55&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-jane-world&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 55&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;55&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://github.com/janestreet/core&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Core&lt;/a&gt;, Jane Street’s standard library overlay, &lt;a href=&quot;https://github.com/janestreet/async&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Async&lt;/a&gt;, and &lt;a href=&quot;https://ocaml.org/changelog/2018-07-11-dune-100&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Dune 1.0.0&lt;/a&gt;, which began at Jane Street as Jbuilder. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;OCaml 5 adds a second problem to the first. Effects are new, so most OCaml libraries were written before them and do not use them. Eio could only exist once OCaml 5 did. An ecosystem that uses OCaml 5 in full has to be built for it.&lt;/p&gt;
&lt;p&gt;And we build one — &lt;a href=&quot;https://hyphatech.io/stack&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Hypha Stack&lt;/a&gt;, components made to fit together. &lt;a href=&quot;https://hyphatech.io/stack/spindle&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Spindle&lt;/a&gt; serves the API over HTTP, &lt;a href=&quot;https://hyphatech.io/stack/wiretype&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;wiretype&lt;/a&gt; describes its data once, &lt;a href=&quot;https://hyphatech.io/stack/rowtype&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;rowtype&lt;/a&gt; and &lt;a href=&quot;https://hyphatech.io/stack/postgres-eio&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;postgres-eio&lt;/a&gt; put that data in Postgres, &lt;a href=&quot;https://hyphatech.io/stack/spool&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;spool&lt;/a&gt; runs the jobs, and &lt;a href=&quot;https://hyphatech.io/stack/solidtype&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;solidtype&lt;/a&gt; builds the UI, to name a few.&lt;/p&gt;
&lt;p&gt;Look at how little it takes. A line of an order, as wiretype’s own example has it:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;ocaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; line&lt;/span&gt;&lt;span style=&quot;color:#C6AEDB&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;  sku&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;  quantity&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;min &lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;max &lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;99&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;  note&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; :&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt; string &lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;option&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;max_length &lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt;200&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt;@@&lt;/span&gt;&lt;span style=&quot;color:#E9E3D8&quot;&gt;deriving wiretype&lt;/span&gt;&lt;span style=&quot;color:#E3A868&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;From these five lines come a type the compiler holds every use of, a check on every request that reports every problem at once,&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;quantity: This must be at most 99. (too_large)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;note: This must be text, not a number. (unexpected_type)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;the API’s OpenAPI document, and the same type in the front end, through a client printed from the server’s routes on every build.&lt;/p&gt;
&lt;p&gt;So the server and the front end cannot disagree about what a line is. A change on the server that the front end has not caught up with is a compile error, found by whoever made the change, seconds after making it, with its file and line. In a stack that finds out at run time the same change ships, a user meets it as a broken page, and someone works back from there to the cause. SQL gets the same treatment, since rowtype checks every statement against the migrated database before anything ships.&lt;/p&gt;
&lt;p&gt;The same holds above the code. We are building an ontology of what a backend is made of — each concept, what it means, which component provides it, which checks hold it — and it is written in OCaml too.&lt;/p&gt;
&lt;p&gt;Milner did not trust the person at the computer at night, himself included, and he did not ask them to be more careful. He built a language in which the careless thing could not be written. An agent will stay up all night writing code, and it should, in a language that says no.&lt;/p&gt;
</content:encoded><author>Roman Zaiev</author></item><item><title>Engineering moved out of the code</title><link>https://hypha.pub/engineering-moved-out-of-the-code</link><guid isPermaLink="true">https://hypha.pub/engineering-moved-out-of-the-code</guid><description>Using an agent doesn’t make you an agentic engineer though, and you are ready for this conversation.</description><pubDate>Fri, 16 Oct 2026 12:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I drafted this post with an agent. Openings and closings are never easy, so I asked it to brainstorm a few. What I got back was a fascinating story that happened to me recently. Plausible, well made… and not mine. Absolutely fictional.&lt;/p&gt;
&lt;p&gt;Plenty of engineers would take that as proof that an LLM can’t be trusted with anything, and blame any code it wrote before reading a line of it. Most arguments about AI and code I hear run on that reflex. Meanwhile everyone who works with an agent thinks of themselves as a 10x engineer. Sometimes the result is real slop, vibe-coded shit nobody can follow. Other times the same kind of LLM-assisted work comes out clean and deliberate, the kind of code a senior engineer would put their name to. Both get called “AI-generated code”, and the LLM is the only thing they have in common.&lt;/p&gt;
&lt;p&gt;In February 2025 &lt;a href=&quot;https://karpathy.ai&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Andrej Karpathy&lt;/a&gt;, who co-founded OpenAI and led AI at Tesla, named one of them: “There’s a new kind of coding I call ‘vibe coding’, where you fully give in to the vibes, embrace exponentials, and forget that the code even exists.”&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-1&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;1&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-1&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 1&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://x.com/karpathy/status/1886192184808149383&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Andrej Karpathy on X, 2 February 2025.&lt;/a&gt; &lt;/span&gt;&lt;/span&gt; He meant weekend projects, and said so. The name escaped anyway, and came to cover every codebase nobody understands. A year later he gave the other activity its name, agentic engineering — designing the system and stating its constraints, then letting agents build what has already been reasoned through.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-2&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;2&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-2&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 2&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://sdtimes.com/ai/andrej-karpathy-has-renamed-vibe-coding-heres-what-engineering-leaders-need-to-do-about-it/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Andrej Karpathy has renamed vibe coding&lt;/a&gt;, SD Times, May 2026. &lt;/span&gt;&lt;/span&gt; He talked it through with Sequoia’s Stephanie Zhan:&lt;/p&gt;
&lt;figure class=&quot;video&quot;&gt;&lt;div class=&quot;player&quot;&gt;&lt;iframe src=&quot;https://www.youtube-nocookie.com/embed/96jN2OCOfLs&quot; title=&quot;Andrej Karpathy: From Vibe Coding to Agentic Engineering&quot; loading=&quot;lazy&quot; allow=&quot;encrypted-media; picture-in-picture; fullscreen&quot; referrerpolicy=&quot;strict-origin-when-cross-origin&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;figcaption&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=96jN2OCOfLs&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Andrej Karpathy: From Vibe Coding to Agentic Engineering&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;What they share is the setup — in both, a person asks and an agent writes the code. So the critics see an agent at the keyboard and conclude that nobody did any engineering, which is exactly true of vibe coding. Whether the other one is engineering at all is less clear.&lt;/p&gt;
&lt;h2 id=&quot;a-tool-is-something-you-wield&quot;&gt;A tool is something you wield&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Rich_Hickey&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Rich Hickey&lt;/a&gt;, widely known in narrow circles as the creator of &lt;a href=&quot;https://clojure.org&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Clojure&lt;/a&gt;, argued that with an LLM you abdicate writing code. A tool is something you wield, held in the hand, under continuous control, telling you what it touches. An agent is none of that. You make a request and it acts on its own. “LLMs are not wielded. LLMs are automation.”&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-3&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;3&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-3&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 3&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Rich Hickey, &lt;a href=&quot;https://www.linkedin.com/pulse/ai-tool-rich-hickey-kjl8e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;‘AI’ is Not a Tool&lt;/a&gt;, October 2026. &lt;/span&gt;&lt;/span&gt; And the people trying to steer it, he says, end up “filling voodoo.md with just the right incantations”, one software update away from everything they have learned being obsolete.&lt;/p&gt;
&lt;p&gt;He is actually right, and most &lt;code&gt;AGENTS.md&lt;/code&gt; files are &lt;code&gt;voodoo.md&lt;/code&gt;, a page of pleading the model reads when it feels like it. “Follow the style guide.” “Never swallow errors.” “Make no mistakes this time.”&lt;/p&gt;
&lt;p&gt;But automation is old, and so is the answer to it. Nobody steers a lathe with incantations. You build a jig.&lt;/p&gt;
&lt;p&gt;A jig is the dumbest object in a workshop. It cuts nothing. It controls where the work sits and where the tool goes, for “repeatability, accuracy, and interchangeability”,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-jig&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;4&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-jig&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 4&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Jig_(tool)&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Jig (tool)&lt;/a&gt;, Wikipedia. &lt;/span&gt;&lt;/span&gt; so the hundredth cut comes out like the first, whoever pushes the saw and however tired they are. What the shop knows lives in the jig, not in the operator’s head, and the operator can change.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Vibe coding makes requests of automation and hopes. Agentic engineering builds the jig the automation runs in, and checks every cut against it.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;building-the-jig&quot;&gt;Building the jig&lt;/h2&gt;
&lt;p&gt;The cheapest part of the jig is made of questions, asked before any code exists. &lt;a href=&quot;https://www.mattpocock.com&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Matt Pocock&lt;/a&gt; has put a great deal of work into a method for agentic engineering, and his collection of agent skills is, in his words, what he uses “to do real engineering - not vibe coding”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-4&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;5&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-4&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 5&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://github.com/mattpocock/skills&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;mattpocock/skills&lt;/a&gt; on GitHub. &lt;/span&gt;&lt;/span&gt; The place to start is his &lt;code&gt;/grilling&lt;/code&gt;, in which the agent interviews you about the plan before anything is built, a round of questions at a time, each with the answer it would recommend, until every branch of the decision is resolved. What it leaves behind is a shared understanding. Written down as a PRD that a person reads and accepts, it turns every scenario into a test the agent has to pass as written.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://hypha.pub/images/engineering-moved-out-of-the-code/grilling-works-the-frontier.svg&quot; alt=&quot;The plan opens into decisions, and the agent asks them in rounds. Each round puts the whole frontier to you, every decision whose prerequisites are settled, each with the answer the agent recommends. A fact it can look up is never asked, a sub-agent finds it, and only the decision that hangs on it waits. Each answer unblocks the decisions that depend on it, so the next round reaches further, until the frontier is empty and you confirm a shared understanding.&quot; width=&quot;694&quot; height=&quot;248&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;drawing&quot;&gt;&lt;/p&gt;
&lt;p&gt;Then the words. Eric Evans called this a ubiquitous language,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-5&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;6&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-5&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 6&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Eric Evans, &lt;em&gt;Domain-Driven Design: Tackling Complexity in the Heart of Software&lt;/em&gt;, Addison-Wesley, 2003. &lt;/span&gt;&lt;/span&gt; one meaning per word, in conversation and in code. We define each concept once, in one place, and hold every repository to it.&lt;/p&gt;
&lt;p&gt;Then the rules, which is where &lt;code&gt;voodoo.md&lt;/code&gt; turns into a jig. A rule is worth nothing until it says how you find out you broke it. The story the agent made up about me broke one of ours, and the rule said how to catch it. Our repositories share another:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A worktree is never inside a checkout.&lt;/strong&gt; Why: a tool that finds its project by looking upward — dune, for one — takes the outer checkout as the root, and builds and answers for &lt;code&gt;main&lt;/code&gt; instead of the work. Symptom: &lt;code&gt;git worktree list&lt;/code&gt; shows a path under a checkout.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;An agent can run the symptom against its own work before anyone looks, and where the check can be automated, the rule moves into it, because an instruction can be ignored and a check cannot.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-6&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;7&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-6&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 7&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://hyphatech.io/principles#3.2&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Hypha’s principles, 3.2.&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The best jigs leave the agent nothing to promise. It does not mark its own work done. The build, the tests and the checks run outside it, and the work counts only when they pass, with every refusal sent back to the agent with its reason. Each piece of work comes with the paths it may touch, and a write anywhere else is refused before anything changes. An agent asked not to touch a file can still touch it. One fenced in cannot.&lt;/p&gt;
&lt;p&gt;The strictest part of the jig is the compiler, the one reviewer that never gets tired, never skims a diff on a Friday afternoon and cannot be talked round. When the types make an illegal state impossible to write,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-7&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;8&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-7&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 8&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;Yaron Minsky, &lt;a href=&quot;https://blog.janestreet.com/effective-ml-revisited/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Effective ML Revisited&lt;/a&gt;, Jane Street, 2011. &lt;/span&gt;&lt;/span&gt; a whole kind of mistake no longer depends on anyone noticing it. &lt;a href=&quot;https://hyphatech.io/stack&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Hypha Stack&lt;/a&gt; takes that to the edges where systems usually break.&lt;/p&gt;
&lt;h2 id=&quot;we-have-been-here-before&quot;&gt;We have been here before&lt;/h2&gt;
&lt;p&gt;Code written by a machine has been doubted before. When John Backus’s team built FORTRAN in the 1950s, programmers had watched the early “automatic programming” systems produce code many times slower than their own, and few believed a machine could write it as well as they did. So the team made the efficiency of the code FORTRAN generated its first goal, ahead of the language itself.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-8&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;9&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-8&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 9&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;John Backus, &lt;a href=&quot;https://softwarepreservation.computerhistory.org/FORTRAN/paper/p25-backus.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;The History of FORTRAN I, II, and III&lt;/a&gt;, ACM SIGPLAN History of Programming Languages, 1978. &lt;/span&gt;&lt;/span&gt; Nobody reads a compiler’s output to decide whether to trust it, and nobody thinks less of the people who stopped.&lt;/p&gt;
&lt;p&gt;Reviewing your agent’s code line by line is &lt;a href=&quot;https://hypha.pub/more-eyes-wont-save-you&quot;&gt;a road to nowhere&lt;/a&gt;, because agents write more than anyone can read, and a review is a judgement, never a proof. What I read is the jig. When a mistake gets through, I add a check, and that kind of mistake is gone for good.&lt;/p&gt;
&lt;p&gt;When the jig is right, what comes out of it is shockingly good. It reads as if one careful person wrote it. It calls the same thing by the same name everywhere, returns its errors instead of throwing them, arrives with tests that were written first and seen failing, and changes its documents in the same commit as its behaviour. It is more consistent than anything I wrote by hand.&lt;/p&gt;
&lt;p&gt;People specify, the system enforces, and that is where the engineering moved, out of the code. It is the part of the work that is still yours.&lt;/p&gt;
</content:encoded><author>Roman Zaiev</author></item><item><title>More eyes won’t save you</title><link>https://hypha.pub/more-eyes-wont-save-you</link><guid isPermaLink="true">https://hypha.pub/more-eyes-wont-save-you</guid><description>Code review was built by humans for humans, on the idea that more eyes catch more mistakes. Then agents started writing the code.</description><pubDate>Thu, 15 Oct 2026 12:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I’ve watched it go three ways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you really care and know how you’d write the code yourself, you spend the PR review fighting the composition and style, enforcing by hand all those habits you’ve built over the years.&lt;/li&gt;
&lt;li&gt;If you hold the wider picture in your head, including the agreements and systems the model isn’t aware of, you identify the gaps, provide the missing context, and monitor how it affects the result.&lt;/li&gt;
&lt;li&gt;If the pace of delivery has already won, you stop looking at the size of the PR, sometimes even at CI feedback itself. Bypass + merge asap to get that shit done!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In all three cases, it’s another prompting session → agentic work in worktrees → slow and flaky CI → another review iteration. Repeat.&lt;/p&gt;
&lt;p&gt;None of these approaches scales, and the last one is where everyone ends up, because agents write more code than anyone can physically read, and no company moving at this speed can spend 24/7 on careful reviews.&lt;/p&gt;
&lt;p&gt;Moreover, each merged PR can be perfectly fine on its own. But together, they turn into a mess no one can follow in full, and “production readiness” quietly stops meaning anything.&lt;/p&gt;
&lt;p&gt;The trouble is that the review process as we know it was built by humans for humans, based on the idea that “more eyes catch more mistakes” — an attempt to collectively overcome our cognitive limitations. Maybe we could just add more AI to that AI to keep things aligned? This brilliant idea works to some extent, but appears to be little more than a patchwork of shallow fixes that still have to be reviewed. Prompting → worktrees → slow and flaky CI. Repeat. Deploy. Feel free to use that MCP to figure out why the latest change is now producing two more runtime errors and why they affect the whole system, all of a sudden.&lt;/p&gt;
&lt;p&gt;So you add one more line to &lt;code&gt;AGENTS.md&lt;/code&gt;, something like “think about the whole system before you change anything, you piece of crap”, and hope the model takes it to heart next time. Prompting quality, you know.&lt;/p&gt;
&lt;p&gt;But a prompt only asks, and the agent is free to ignore it. What keeps that mistake from coming back is a proper boundary, one the agent cannot cross however it was asked.&lt;/p&gt;
&lt;p&gt;Trusting the output takes guarantees, not more eyes: complete and correct problem formalisation grounded in domain and cross-domain context, sound models, components, and abstractions, a compiler that eliminates a whole class of runtime problems, and an executable that uses limited resources efficiently.&lt;/p&gt;
</content:encoded><author>Roman Zaiev</author></item><item><title>Back to FreeBSD: Part 2 — Jails</title><link>https://hypha.pub/back-to-freebsd-part-2</link><guid isPermaLink="true">https://hypha.pub/back-to-freebsd-part-2</guid><description>Before we explore FreeBSD jails, it is worth refreshing our understanding of how Linux solved the same problem with LXC (Linux Containers).</description><pubDate>Thu, 26 Mar 2026 18:34:47 GMT</pubDate><content:encoded>&lt;p&gt;Before we explore FreeBSD jails, it is worth refreshing our understanding of how Linux solved the same problem with LXC (Linux Containers). Clearly inspired by jails, they are conceptually all about the same thing in essence. But the implementation difference is striking.&lt;/p&gt;
&lt;p&gt;Linux containers are not a single kernel feature. They are a combination of several independent primitives added to the kernel over a number of years. In a nutshell:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;namespaces&lt;/strong&gt; — isolate what a process can see: its own PID space, network interfaces, mount points, hostname, users&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;cgroups&lt;/strong&gt; — limit and account for what a process can consume: CPU, I/⁠O, memory, network bandwidth&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;seccomp&lt;/strong&gt; — restrict which system calls a process is allowed to make&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;None of these were originally designed together as a container system. They were added by different people at different times for different reasons. You would be amazed how many steps it takes to get anywhere working with them directly.&lt;/p&gt;
&lt;p&gt;LXC was the first serious attempt to glue them together and make them usable. Released in 2008, it gave you a relatively straightforward way to define and launch a system container using those kernel primitives. Early Docker was quite literally built on top of LXC — until 2014, when Docker replaced it with their own runtime called &lt;code&gt;libcontainer&lt;/code&gt; and cut the dependency.&lt;/p&gt;
&lt;p&gt;Ironically, by introducing &lt;code&gt;libcontainer&lt;/code&gt;, Docker effectively did to LXC what LXC did to the raw kernel primitives — added another abstraction layer on top. And then the OCI came along and standardised that layer, and now you have runc, containerd, and so on.&lt;/p&gt;
&lt;h2 id=&quot;lxc-container-from-scratch&quot;&gt;LXC container from scratch&lt;/h2&gt;
&lt;p&gt;I will use Fedora 40 in my examples because that is what is installed on my old MacBook Pro 2015 right now (yeah, second life).&lt;/p&gt;
&lt;p&gt;So let’s do it — create the container, wire up networking so it can actually reach the internet, and verify it works.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# install lxc and the networking helper&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; dnf&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; lxc&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; lxc-templates&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# lxc-net manages a private bridge (lxcbr0) with dnsmasq for DHCP&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# and NAT rules so containers can reach the outside world&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; systemctl&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; enable&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; --now&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; lxc-net&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now tell LXC to use the bridge. Edit &lt;code&gt;/etc/lxc/default.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;lxc.net.0.type = veth&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;lxc.net.0.link = lxcbr0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;lxc.net.0.flags = up&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;lxcbr0&lt;/code&gt; bridge was created by &lt;code&gt;lxc-net&lt;/code&gt;. It sits on &lt;code&gt;10.0.3.0/24&lt;/code&gt; by default, runs a dnsmasq instance to hand out DHCP leases, and has iptables masquerade rules so container traffic exits through the host’s physical interface.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# create a Fedora 40 container&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; lxc-create&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -n&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; mycontainer&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -t&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; download&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; --&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -d&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; fedora&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; 40&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -a&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; amd64&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# start it&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; lxc-start&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -n&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; mycontainer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# get a shell inside&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; lxc-attach&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -n&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; mycontainer&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;From inside the container:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# should have a 10.0.3.x address from DHCP&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;ip&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; addr&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; show&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; eth0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# reaches the internet through NAT on the host&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;ping&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -c&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; 1.1.1.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;curl&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -s&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; https://jail.run&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; head&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It works! Notice what had to happen to get here: a bridge interface, a DHCP server, iptables NAT rules, a &lt;code&gt;veth&lt;/code&gt; pair connecting the container to the bridge. This is the shape of the Linux approach throughout: composable primitives, flexibility, and a noticeable amount of glue.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# when done&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; lxc-stop&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -n&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; mycontainer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; lxc-destroy&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -n&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; mycontainer&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;freebsd-jail-from-scratch&quot;&gt;FreeBSD jail from scratch&lt;/h2&gt;
&lt;p&gt;A FreeBSD jail is not built from composable primitives. It is a first-class kernel concept and a single syscall that says “run this subtree as an isolated environment”.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-1&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;1&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-1&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 1&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://freebsdfoundation.org/freebsd-project/resources/introduction-to-freebsd-jails/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Introduction to FreeBSD Jails&lt;/a&gt;, and &lt;a href=&quot;https://youtu.be/hQmOc0egcl4?si=qhjCV4BSlp9AFYgX&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;FreeBSD Fridays: Introduction to Jails&lt;/a&gt;. &lt;/span&gt;&lt;/span&gt; Let’s build one.&lt;/p&gt;
&lt;p&gt;A jail needs a root filesystem first of all. The cleanest way to get one is to fetch and extract the FreeBSD base distribution:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;mkdir&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -p&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; /jails/myjail&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;fetch&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; https://download.freebsd.org/releases/amd64/15.0-RELEASE/base.txz&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -o&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; /tmp/base.txz&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;tar&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -xf&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; /tmp/base.txz&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -C&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; /jails/myjail&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This gives you a minimal but complete FreeBSD userland — libc, basic utilities, everything needed to run processes inside the jail. Copy the host’s DNS configuration so the jail can resolve names:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;cp&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; /etc/resolv.conf&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; /jails/myjail/etc/resolv.conf&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let’s keep it simple — no bridge, no DHCP server, no NAT rules. We just add an IP alias to the host’s existing network interface, and the jail gets its own address on the same network the host is already on.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# add an alias to the host&apos;s external interface&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;ifconfig&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; em0&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; 10.0.0.10&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; alias&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# make it persist across reboots&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;sysrc&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; ifconfig_em0_alias0=&quot;inet 10.0.0.10&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Replace &lt;code&gt;em0&lt;/code&gt; with your actual interface — &lt;code&gt;vtnet0&lt;/code&gt;, &lt;code&gt;igb0&lt;/code&gt;, whatever &lt;code&gt;ifconfig&lt;/code&gt; shows. The jail will use this address, and outbound traffic routes through the host’s existing gateway.&lt;/p&gt;
&lt;p&gt;This networking setup sits directly on the same network as the host, visible on the LAN like any other machine. There is no network isolation here. If you need the jail on its own private subnet, unreachable from outside without explicit port forwarding, that is what VNET is for — a fully virtualised network stack per jail, with its own bridge and NAT through PF. For now, shared IP is enough to show how jails work.&lt;/p&gt;
&lt;p&gt;Jails in FreeBSD are configured in &lt;code&gt;/etc/jail.conf&lt;/code&gt;. Notice &lt;code&gt;exec.start&lt;/code&gt;, &lt;code&gt;exec.stop&lt;/code&gt;, &lt;code&gt;exec.prestart&lt;/code&gt;, &lt;code&gt;exec.poststop&lt;/code&gt; — they give you clear lifecycle control and handy automation hooks.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;myjail {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    host.hostname = &quot;myjail.local&quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    path = &quot;/jails/myjail&quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    ip4.addr = 10.0.0.10;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    interface = em0;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    exec.start = &quot;/bin/sh /etc/rc&quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    exec.stop = &quot;/bin/sh /etc/rc.shutdown jail&quot;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    mount.devfs;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;One command registers the jail with the kernel and it is ready:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# start it&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;jail&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -c&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; myjail&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# list running jails&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;jls&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# get a shell inside&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;jexec&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; myjail&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; /bin/sh&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;From inside:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;ifconfig&lt;/span&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;             # shows 10.0.0.10&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;ping&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -c&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; 1.1.1.1&lt;/span&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;    # reaches the internet through the host&apos;s gateway&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;fetch&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -o&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; https://jail.run&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; head&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The host is invisible — the jail sees only what you gave it. And it started instantly, because there is nothing to boot.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# de-register the jail&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;jail&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; myjail&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# remove it entirely&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;rm&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -rf&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; /jails/myjail&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;jail-managers&quot;&gt;Jail managers&lt;/h2&gt;
&lt;p&gt;The manual process above is not complicated and pretty straightforward, but it is verbose. Fetching a base system, extracting it, managing IP aliases, writing &lt;code&gt;jail.conf&lt;/code&gt; stanzas — you see the repeatable routine, and it is all automatable. So the community has built several tools to do exactly that. &lt;a href=&quot;https://github.com/cbsd/cbsd?tab=readme-ov-file#the-freebsd-ecosystem-today&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Dozens&lt;/a&gt; of them, actually.&lt;/p&gt;
&lt;p&gt;The reason there are multiple tools rather than one is partly history,&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-2&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;2&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-2&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 2&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://youtu.be/S3u8OtjfGFE?si=2BWadr3dwrEZNmzG&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;20 Years of FreeBSD Jails (2019)&lt;/a&gt; &lt;/span&gt;&lt;/span&gt; partly differing opinions about what “managing a jail” should mean, and partly the fact that FreeBSD doesn’t ship an official one. The base OS gives you &lt;code&gt;jail(8)&lt;/code&gt; and leaves the rest to you.&lt;/p&gt;
&lt;p&gt;Here are three worth your attention today.&lt;/p&gt;
&lt;h3 id=&quot;bastille&quot;&gt;Bastille&lt;/h3&gt;
&lt;p&gt;The current community favourite. &lt;a href=&quot;https://bastillebsd.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Bastille&lt;/a&gt; handles the full lifecycle — bootstrapping release archives, creating jails, managing PF rules, templating — with sensible defaults for the most common case. Can work without ZFS, though it benefits from it. Clean CLI, active development, good documentation.&lt;/p&gt;
&lt;p&gt;Templates live in a &lt;strong&gt;Bastillefile&lt;/strong&gt;: a list of instructions describing what gets installed and configured inside a jail.&lt;/p&gt;
&lt;h3 id=&quot;appjail&quot;&gt;AppJail&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://appjail.readthedocs.io/en/latest/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;AppJail&lt;/a&gt; introduces a compositional model — jails are assembled from stages and instructions defined in a &lt;strong&gt;Makejail&lt;/strong&gt;. It has thought carefully about how jails should be reused and composed into larger systems, and handles complex multi-jail setups well.&lt;/p&gt;
&lt;h3 id=&quot;pot&quot;&gt;Pot&lt;/h3&gt;
&lt;p&gt;Where Bastille and AppJail are primarily FreeBSD-native tools, &lt;a href=&quot;https://pot.pizzamig.dev/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;pot&lt;/a&gt; has first-class integration with &lt;a href=&quot;https://developer.hashicorp.com/nomad&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;HashiCorp Nomad&lt;/a&gt; to mimic modern Kubernetes-style orchestration with pods in mind. If your infrastructure uses Nomad for scheduling, pot fits naturally. Templates live in a &lt;strong&gt;Potfile&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;All three have independently converged on a Dockerfile-inspired template format. Bastillefile, Makejail, Potfile — different names, same shape, same goals. A sequence of imperative instructions in a small specialised DSL: install this package, copy this file, run this command.&lt;/p&gt;
&lt;p&gt;In the case of Bastille, for example:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;CP usr /&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;PKG ca_root_nss unbound&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;SYSRC unbound_enable=YES&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;CMD chown unbound:wheel /usr/local/etc/unbound&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;CMD /usr/local/sbin/unbound-control-setup&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;CMD /usr/local/sbin/unbound-checkconf &amp;amp;&amp;amp; echo &quot;nameserver 127.0.0.1&quot; &amp;gt; /etc/resolv.conf&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;SERVICE unbound restart&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;CMD host bastillebsd.org&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The intent is obvious: lower the barrier for people coming from Docker. Familiar syntax, familiar mental model. A reasonable goal. Does it make any sense?&lt;/p&gt;
&lt;p&gt;One of the core reasons Dockerfile format exists in the form it does is that Docker had to solve the layering problem on top of filesystems that had no native concept of it. So Docker invented its own layer model, and the Dockerfile format maps directly onto it — each instruction is potentially a new layer.&lt;/p&gt;
&lt;p&gt;FreeBSD with ZFS does not have this problem. Layering is a first-class filesystem primitive on ZFS. Snapshots and clones have been there since 2005. You do not need a container runtime to reinvent layering on top of ZFS — it is already there, at the right level of abstraction, with better semantics.&lt;/p&gt;
&lt;p&gt;Copying the Dockerfile format onto jails means importing a solution to a problem you do not have, while ignoring the tools that actually solve it better. The layering belongs at the filesystem. Not in a template DSL that cosplays as Dockerfile.&lt;/p&gt;
&lt;p&gt;So all modern jail managers are trying to reinvent something just to make the look and feel similar to what is common in Linux — with no clear advantage, since the offered DSLs are still not the same as the Dockerfile format, and that difference is still friction for anyone escaping to FreeBSD.&lt;/p&gt;
&lt;p&gt;We will get into this properly in the next parts. For now, let’s use Bastille for what it is genuinely good at.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;lab-with-bastille&quot;&gt;Lab with Bastille&lt;/h2&gt;
&lt;p&gt;Bastille reduces the manual process from earlier to a handful of commands.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-3&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;3&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-3&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 3&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://youtu.be/vVpd34bWCJA?si=B6ADiE8_yV_eFAp9&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Build Secure FreeBSD Containers in 5 Minutes&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;pkg&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; bastille&lt;/span&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;       # install bastille itself&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;sysrc&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; bastille_enable=YES&lt;/span&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;  # enable it as a service&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Bastille ships with a &lt;code&gt;bastille setup&lt;/code&gt; command that handles the initial host configuration in one shot:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;bastille&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; setup&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After setup, start PF manually:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;service&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; pf&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; start&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Bastille manages release archives centrally — download once, use for as many jails as you need. Think of it as your base layer for everything built on top:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;bastille&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; bootstrap&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; 15.0-RELEASE&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you have everything to create jails:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# pick any free IP within the default 10.17.89.0/24 range&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;bastille&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; myjail&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; 15.0-RELEASE&lt;/span&gt;&lt;span style=&quot;color:#DF9A83&quot;&gt; 10.17.89.10&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;bastille&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; start&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; myjail&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Behind the scenes, Bastille handled the directory structure, the &lt;code&gt;jail.conf&lt;/code&gt; entry, the IP alias, and the PF table registration. Your jail is up and running on &lt;code&gt;10.17.89.10&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9A9289;font-style:italic&quot;&gt;# jump into the jail&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;bastille&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; console&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; myjail&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;From inside:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;astro-code hypha-night&quot; style=&quot;background-color:#1c1915;color:#e9e3d8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;ifconfig&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt;fetch&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -o&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color:#B3C78F&quot;&gt; https://jail.run&lt;/span&gt;&lt;span style=&quot;color:#A39B91&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#8EBFD1&quot;&gt; head&lt;/span&gt;&lt;span style=&quot;color:#C9BFB1&quot;&gt; -5&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Isolated, reachable, with internet access through NAT on the host. Exactly what we wired up manually, in just three commands.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Jails give you real OS-level isolation with near-zero overhead. The kernel primitive is simple — a directory, a configuration file, a handful of hooks. The manual process takes about twenty minutes to understand end to end. A manager like Bastille reduces that to three commands and a bootstrap step that only runs once.&lt;/p&gt;
</content:encoded><author>Roman Zaiev</author></item><item><title>Back to FreeBSD: Part 1 — Intro</title><link>https://hypha.pub/back-to-freebsd-part-1</link><guid isPermaLink="true">https://hypha.pub/back-to-freebsd-part-1</guid><description>Containers ran in production on FreeBSD thirteen years before Docker. So why does nobody talk about it?</description><pubDate>Fri, 20 Feb 2026 18:33:48 GMT</pubDate><content:encoded>&lt;p&gt;A few decades ago, the only well-known way to deliver something to a server, to make it accessible over the internet, was moving files via FTP in Total Commander, FileZilla or FAR Manager, manually copying files and folders from the left pane to the right one. The more advanced among us preferred standard UNIX tools like scp or rsync instead, but the process was essentially the same.&lt;/p&gt;
&lt;p&gt;Not rocket science (which is the best part), and it worked! The only obvious problem was that inevitable “oops” moment we’ve all had — something misclicked, accidentally deleted, edited in the wrong place. No big deal when you’re a solo dev on a solo project. A real disaster when you’re responsible for dozens of client projects.&lt;/p&gt;
&lt;p&gt;A very common backend setup involved multiple websites served by the same Apache web server instance, all sharing the same lifecycle. If Apache went down, everyone went down. If a system dependency broke, everything crashed.&lt;/p&gt;
&lt;p&gt;It’s worth mentioning that a more subtle problem appeared when traffic spiked. While your superstar website consumed all available resources, every other site on the same server was quietly suffocating.&lt;/p&gt;
&lt;p&gt;Sysadmins scrambled to automate routine tasks, sharing shell scripts full of clever tricks and procedural logic. There was no standard way to do anything yet, including versioning for auditing or rolling back when things went wrong. Most of us used conventions like appending an incremented number or a timestamp to the project folder name. In most cases, manual file tossing worked pretty well. Until it didn’t.&lt;/p&gt;
&lt;p&gt;There were at least two clear problems that needed solving:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Deployment.&lt;/strong&gt; How do you deliver reliably? How do you avoid common human fat-finger mistakes? How do you implement versioning and rollbacks? And how do you make the solution generic enough to cover all business cases?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Process isolation.&lt;/strong&gt; How do you protect the app from the system and the system from the app? How do you handle situations where one app’s requirements silently break another’s, or when customers need slightly different versions of the same thing? How do you resolve dependencies?&lt;/p&gt;
&lt;p&gt;Attempts to solve the deployment problem gave us a whole new universe of tools and approaches, eventually evolving into modern CI/CD pipelines, packaging standards, and version control. The isolation story, however, is far less well known.&lt;/p&gt;
&lt;p&gt;In 1979, Bell UNIX introduced &lt;code&gt;chroot&lt;/code&gt; — a way to give a process an isolated view of the filesystem, restricting it to a subtree so it couldn’t touch anything above it. It was a primitive but genuinely useful idea. The limitation was that &lt;code&gt;chroot&lt;/code&gt; only isolated the filesystem. The process could still interfere with the network, with other processes, with system resources. It was a partial solution, and a determined application could escape it.&lt;/p&gt;
&lt;p&gt;The first serious enterprise answer was virtual machines. VMware brought VMs into mainstream use in the late 1990s, giving each application its own fully isolated OS environment. The problem was cost. Every VM carried a complete OS with significant overhead, and startup times measured in minutes. It was inefficient and expensive, though still cheaper than buying more physical servers.&lt;/p&gt;
&lt;p&gt;The quiet revolution happened in 2000. Not on Windows Server, and not yet on Linux, but on &lt;strong&gt;FreeBSD&lt;/strong&gt;, a UNIX-based operating system that was the default choice for IT professionals long before Linux dominated the space.&lt;/p&gt;
&lt;p&gt;FreeBSD is worth a brief aside here, because it differs from Linux in a fundamental way. Linux is a kernel. What most people call “Linux” is actually that kernel combined with a GNU userland, a package ecosystem, and a set of choices that vary from distro to distro — Ubuntu, Fedora, and Arch are all running the same kernel but are meaningfully different systems underneath.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://hypha.pub/images/back-to-freebsd-part-1/unix-family-tree.svg&quot; alt=&quot;The Unix family tree from 1970 to 2007. Unix at Bell Labs, from 1971 to 1989, by Ken Thompson and Dennis Ritchie, gives rise to two families. BSD, from 1978 to 1995, by Bill Joy, leads to SunOS and from it Solaris, to NeXTSTEP and through it Mac OS X, and in 1993 to NetBSD and FreeBSD. OpenBSD forks from NetBSD and is first released in 1996. Xenix, from 1980 to 1991, and the System V systems, HP-UX, AIX, IRIX, which ends in 2006, and UnixWare, come from Bell Labs Unix. Minix is a clone of Unix rather than a descendant, and the GNU Project stands outside both families. Linux joins GNU and owes Minix its start.&quot; width=&quot;680&quot; height=&quot;524&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;drawing&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;FreeBSD ships as a complete, coherent OS&lt;/strong&gt; — kernel, userland, base tools, and libraries all developed together, versioned together, and tested together as a single unit. That coherence matters. It’s part of why FreeBSD solutions tend to be cleaner and why the base system behaves consistently across installations.&lt;/p&gt;
&lt;p&gt;The solution FreeBSD built on top of that coherent foundation was called &lt;strong&gt;jails&lt;/strong&gt;. Announced by Poul-Henning Kamp and Robert Watson and shipped as a native kernel feature in &lt;a href=&quot;https://docs.freebsd.org/en/books/handbook/jails/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;FreeBSD 4.0 in March 2000&lt;/a&gt;, jails took the &lt;code&gt;chroot&lt;/code&gt; idea and completed it, adding full network isolation, process isolation, and proper security boundaries.&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-1&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;1&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-1&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 1&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://papers.freebsd.org/2000/phk-jails.files/sane2000-jail.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Jails: Confining the omnipotent root.&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://papers.freebsd.org/2000/phk-jails.files/sane2000-jail.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;img src=&quot;https://hypha.pub/images/back-to-freebsd-part-1/7f6612cd-b1ee-4c65-84b8-ef80b1fd6a9e.webp&quot; alt=&quot;The title and abstract of “Jails: Confining the omnipotent root” by Poul-Henning Kamp and Robert N. M. Watson. It opens the paper as a PDF&quot; width=&quot;1600&quot; height=&quot;1214&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Each jail gets its own filesystem view, its own network stack, its own process space. The host system is invisible to it. And crucially, it shares the host kernel, meaning near-zero overhead and near-instant startup time.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://hypha.pub/images/back-to-freebsd-part-1/freebsd-stack.svg&quot; alt=&quot;The FreeBSD stack, from the bottom up: the BSD kernel, then the filesystem and userspace, then jails, native OS-level containers since 2000, then optional jail managers such as cbsd, bastille, pot and appjail, and your application on top.&quot; width=&quot;680&quot; height=&quot;316&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;drawing&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;FreeBSD pioneered the practical implementation of what we now call containers. Not conceptually, but in production, years before the rest of the industry caught up.&lt;/strong&gt;&lt;sup&gt;&lt;label for=&quot;sn-user-content-fn-2&quot; class=&quot;sidenote-toggle&quot; aria-hidden=&quot;true&quot;&gt;2&lt;/label&gt;&lt;/sup&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-user-content-fn-2&quot; class=&quot;sidenote-state&quot; aria-label=&quot;Note 2&quot;&gt;&lt;span class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sidenote-n&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sidenote-p&quot;&gt;&lt;a href=&quot;https://vermaden.wordpress.com/2025/04/08/are-freebsd-jails-containers/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Are FreeBSD Jails a Containers?&lt;/a&gt; and a &lt;a href=&quot;https://lobste.rs/s/f6wcbv/are_freebsd_jails_containers&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;follow-up discussion.&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Sun Microsystems followed with Solaris Zones in 2004, adapting the jails concept for their enterprise customers, and gave back ZFS — the most advanced filesystem ever built — open sourced in 2005 and ported to FreeBSD in 2007. ZFS complemented jails with instant snapshots and efficient layering.&lt;/p&gt;
&lt;p&gt;The actual timeline of the isolation problem looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://hypha.pub/images/back-to-freebsd-part-1/isolation-stages.svg&quot; alt=&quot;Three stages of isolation, left to right: shared servers with no isolation, then virtual machines, heavy but isolated, then containers, lightweight and isolated.&quot; width=&quot;680&quot; height=&quot;112&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;drawing&quot;&gt;&lt;/p&gt;
&lt;p&gt;FreeBSD reached that third stage in 2000. Linux wouldn’t get there until 2008 with LXC. Docker — the tool most developers think of as the origin of containers — didn’t appear until 2013. When Docker was being celebrated as revolutionary, FreeBSD jails were already thirteen years old, mature and battle-tested.&lt;/p&gt;
&lt;p&gt;So why does nobody talk about it?&lt;/p&gt;
&lt;p&gt;Technical superiority doesn’t win ecosystem wars. Linux won through a combination of fast decisions, the viral GPL licence, and strong enterprise backing from Red Hat and IBM. Then Google, Facebook, and Amazon happened — hungry for datacenters, developing tools to manage growing infrastructure at scale. They set the direction for the entire industry.&lt;/p&gt;
&lt;p&gt;Linux rapidly went from “the free OS for people who can’t afford commercial licences” to “the only acceptable OS for servers”.&lt;/p&gt;
&lt;p&gt;To solve the distribution and isolation problem, Linux engineers built a set of kernel primitives (namespaces, cgroups, seccomp) and then, in a very Linux fashion, built an entire ecosystem of abstractions on top to “simplify” things:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://hypha.pub/images/back-to-freebsd-part-1/linux-stack.svg&quot; alt=&quot;The Linux container stack, from the bottom up: the Linux kernel, then namespaces, cgroups and seccomp, kernel isolation primitives from 2006 to 2013, then LXC, system containers, in 2008, then OCI and runc, standardised container execution, in 2015, then Docker and Podman, in 2013 and 2018, then Docker Hub, commercial third-party distribution, and your application on top.&quot; width=&quot;680&quot; height=&quot;416&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;drawing&quot;&gt;&lt;/p&gt;
&lt;p&gt;Somehow we ended up with an overengineered mess of leaky abstractions for cloud-based, vendor-locked infrastructure.&lt;/p&gt;
&lt;p&gt;And this complexity has quietly reshaped how the industry thinks about deploying software. Today, if you want to run an application in a larger system, the implicit assumption is that you containerise it with Docker and orchestrate it with Kubernetes. It’s not presented as one option among several — it’s presented as the obvious default, the thing you’d be naive or reckless to skip.&lt;/p&gt;
&lt;p&gt;What Docker actually solved well was the shipping problem: a universal standard for packing an application with all its dependencies, distributing it through a registry, and running it identically on any machine anywhere. That was genuinely useful, and the OCI image format became a real industry standard.&lt;/p&gt;
&lt;p&gt;Jails solve the isolation problem beautifully, but they don’t have a native answer to shipping. That gap is real, and it’s one of the main reasons the ecosystem around jails feels underdeveloped compared to Docker’s world.&lt;/p&gt;
&lt;p&gt;The community is aware of it. Some tools attempt to close the gap by mimicking what the modern container ecosystem offers, with moderate success. But there are other approaches too, utilising native FreeBSD primitives that have been quietly sitting there for many years.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;In the next parts, you will see how simple and elegant FreeBSD-based infrastructure can look, how jails work from the ground up, how jail managers help reduce the boilerplate, how you can use Ansible to provision and deploy, why ZFS snapshots are a killer feature worth your attention, and how we put it all together to build robust and scalable infrastructure for Hypha.&lt;/p&gt;
</content:encoded><author>Roman Zaiev</author></item></channel></rss>