{"slug": "programming-languages-are-for-humans", "title": "Programming languages are for humans", "summary": "Developer Farid Zakaria released borrIR, a static analysis pass that enforces affine ownership and borrow-checking rules directly on textual LLVM IR, sitting in front of the llvm-as assembler. borrIR parses LLVM IR or disassembles .bc bitcode via llvm-dis, builds each function's control-flow graph, tracks pointer provenance, and runs a forward fixed-point dataflow analysis; running `borrir check` on a use-after-move example emits an error[E0001] diagnostic comparable to Rust's borrow checker. The project also includes a zero-libc standard library (libir) and a bitcode package manager, and Zakaria positions it for AI coding agents that generate code without human review.", "body_md": "**tl;dr** [borrIR](https://github.com/fzakaria/borrir) is a borrow checker, a\nzero-libc standard library (`libir`), and a bitcode package manager for raw\nLLVM IR. Try it live in the [browser playground](https://fzakaria.github.io/borrir/), \nand commit yourself to the *agentic engineering way of life*.\n\nWelcome AI disciples. This post is for you.\n\nWe are just past the year mark when [Opus 4.5 was released](https://www.anthropic.com/news/claude-opus-4-5)\non November 24, 2026, when the way in which we craft and generate code changed overnight.\nWe ushered in the era of *agentic coding*, where AI agents can autonomously generate,\nmodify, and reason about code with minimal human intervention.\n\nDespite the loss of joy that comes with knowing the codebase inside and out or bickering\nwith my friends about esoteric language features, there is no denying how much more prolific\nI have become by embracing the *agentic engineering way of life*.\n\nWith the blindfolds on, the language du jour seems to be Rust for our dutiful clankers.\nAnthropic even made a large splash at how they rewrote their whole messaging system from Python\nto Rust [[cite](https://newsletter.pragmaticengineer.com/p/how-anthropic-builds-software-in)]\nfor those sweet sweet performance gains.\n\nAfter numerous projects coded 100% by agents, where I have had 0 insight into the code itself: why are we even bothering with a language at all?\n\nRust seems like a reasonable choice but it has its fair share of criticisms: complexity, slow compile times, and everyone seems to enjoy complaining about the generated build artifacts.\n\nOf course the popular opinion now is that the compile-time verification of Rust from the borrow-checker is what gives it the appeal. Coupling provable-verification with the stochastic reasoning of AI agents seems to be the current trend.\n\nHear me out: a borrow checker does not require Rust.\n\nTo commit to the *agentic engineering* way of life, we need the implementation to be\nso low-level that you are disuaded from even looking at it.\n\nWe need the LLM agents to code directly in assembly, but not any ordinary assembly. We need a form of assembly that carries enough type information to allow the agents to reason about memory safety without human intervention.\n\nWe need LLVM IR as our assembly language, *with a borrow checker built on top of it*.\n\nI built [borrIR](https://github.com/fzakaria/borrir). It is a borrow checker for LLVM IR, \ndesigned to enforce memory safety at the assembly level. Check out [the playground](https://fzakaria.github.io/borrir/#playground) for an interactive demo.\n\nWtf did I just build?<sup>1</sup>1Yes, I am using **I** in the sense of “I, the author, built this tool.” even though it’s 100% LLM-generated code. \n\n`borrIR` is a static analysis pass that sits in front of `llvm-as` (assembler for LLVM IR).\nIt parses textual LLVM IR (or disassembles `.bc` bitcode via `llvm-dis`), builds each\nfunction’s control-flow graph, tracks pointer provenance, and runs a forward\nfixed-point dataflow analysis to enforce affine ownership.\n*All the fancy stuff Rust’s borrow checker does, but at the LLVM IR level.*\n\nHere is the same use-after-move bug in Rust on the left and raw LLVM IR on the right:\n\n``` php\nfn bad_move() -> i64 {\n    let mut buf = Box::new(42i64);\n    consume(buf);\n    *buf\n}\ndeclare noalias ptr @libir_alloc(i64)\ndeclare void @consume(ptr \"borrir.own\")\n\ndefine i64 @bad_move() {\nentry:\n  %buf = call noalias ptr @libir_alloc(i64 64)\n  store i64 42, ptr %buf\n  call void @consume(ptr %buf)\n  %x = load i64, ptr %buf\n  ret i64 %x\n}\n```\n\nWe can then run `borrir check` on the LLVM IR file and get a diagnostic\nequivalent to what Rust’s borrow checker would produce for the same use-after-move bug.\n\n``` bash\n$ borrir check examples/bugs/use-after-move.ll\nerror[E0001]: use of moved pointer `%buf` (root `%buf`)  --> examples/bugs/use-after-move.ll:10:3 (in @use_after_move)\n   |\n 9 |   call void @consume(ptr %buf)\n   |   ---------------------------- ownership of `%buf` moved into `@consume` here   |\n10 |   %x = load i64, ptr %buf\n   |   ^^^^^^^^^^^^^^^^^^^^^^^ value used here after move\n   |\n   = help: borrow `%buf` with `readonly` instead of moving it, or finish reads before calling `@consume`\n```\n\n**Aside**\nFor those wanting the juicy compiler details: borrIR gets **Non-Lexical\nLifetimes (NLL)** almost for free. In early Rust a borrow lasted until the\nclosing `}` of its scope, even if you never touched the reference again.\nFixing that meant inventing MIR so the compiler could track where each\nreference was last used. LLVM IR has no scopes to begin with.\nSimplicity wins.\n\nAs of the first release, the checker reports eight error classes (`E0001`–` E0008`) and one warning from use after move to laundering a pointer through `inttoptr`. You can see the full list of error classes and the warning on [the borrIR documentation](https://fzakaria.github.io/borrir/#rules).\n\nIn the pursuit of pure blind agentic engineering zeal, I decided to abandon all libraries that might have been generated by higher-level languages and rely solely on our verified LLVM IR modules.\n\n`borrir` includes a set of verified LLVM IR modules for common low-level operations, `libir`, such as memory allocation, I/O, and string manipulation, all of which pass the borrow checker itself. Think of these as the replacement for the standard libraries you would normally get from C or Rust: `libc` and friends.\n\nNo `crt0`, no `libc`, no dynamic linker.\n\nThe binaries produced by this pipeline are fully static ELF executables, with no dependencies on `libc` or any other external libraries.\nThey are incredibly small and self-contained, and the build process itself produces very little overhead or intermediate artifacts.\n\n**Aside**\nYou actually have to ask LLVM to disable passes such as `LoopIdiomRecognize`, otherwise\nLLVM will happily rewrite your hand-written loops into calls to standard library functions,\nwhich then fail to link if you don’t have `libc`.\n\nThere is even a package-manager built into `borrir` for handling pre-assembled `.bc` packages,\nmaking it easier to share and reuse verified LLVM IR modules. Details are unimportant\nfor this post but suffice it to say that we can build a complete ecosystem purely\nout of verified LLVM IR modules.\n\nThis has been a nagging thought bugging me for the last few months as I have gotten more-and-more comfortable with having projects purely written by an LLM agent.\n\nI already trust the compiler to turn whatever language I write into correct, optimized assembly, and I never read that output. Having the agent write LLVM IR directly is the same trust, moved one layer up.\n\nThe borrow checker is what makes that trust reasonable. It is a safety net for me and a feedback loop for the agent. Ownership is checked one function at a time, so the agent does not have to hold the whole program in its context to know who frees what.\n\nTry breaking the borrow checker in the\n[live WebAssembly playground](https://fzakaria.github.io/borrir/), or poke around\nthe [repo](https://github.com/fzakaria/borrir) and run ```\nnix run\ngithub:fzakaria/borrir -- run examples/hash-demo\n```\n.\n\nProgramming languages are for humans. Nobody asked the clankers if they wanted one.", "url": "https://wpnews.pro/news/programming-languages-are-for-humans", "canonical_source": "https://fzakaria.com/2026/11/27/programming-languages-are-for-humans", "published_at": "2026-11-28 05:00:00+00:00", "updated_at": "2026-11-28 05:43:44.428618+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "ai-tools", "developer-tools"], "entities": ["borrIR", "Farid Zakaria", "LLVM IR", "Rust", "Anthropic", "Claude Opus 4.5", "libir"], "also_reported_by": [], "takeaway": "borrIR adds a borrow-checking pass over raw LLVM IR, so `borrir check` flags a use-after-move of a pointer marked \"borrir.own\" with an error[E0001] diagnostic before llvm-as assembles it.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/programming-languages-are-for-humans", "markdown": "https://wpnews.pro/news/programming-languages-are-for-humans.md", "text": "https://wpnews.pro/news/programming-languages-are-for-humans.txt", "jsonld": "https://wpnews.pro/news/programming-languages-are-for-humans.jsonld"}}