Keep it SSA, stupid A developer's experiment testing whether large language models reason more easily about static single assignment (SSA) code than mutable-variable code generated 40 small programs, each threading three variables through eight steps of branches and helper calls, written in three notations: mutable Rust, single-assignment Rust, and LLVM IR compiled from the mutable Rust. The hypothesis, published in a blog post, is that LLMs will find SSA-style code easier to reason about than code with mutable variables, drawing an analogy to word2vec's dense versus context-dependent token embeddings. The work builds on borrIR, a borrow checker and toolchain for raw LLVM IR the author previously released on GitHub. Ever since I have been coding agentically the last few months, looking less and less at the actual code, I have been looking to better understand my relationship with code itself. I seem to still “prefer” language implementations because I steer the agents through them, using the language as a scaffold for reasoning and communication. Does it even matter? I know it’s an overused analogy but I don’t care about which instructions the compilers emit, as long as the meaning is preserved and performance is acceptable. I tried taking this to an extreme: I wanted to see if I could work entirely with the low-level representation, bypassing human-readable languages altogether. In my last post https://fzakaria.com/2026/11/27/programming-languages-are-for-humans I built borrIR https://github.com/fzakaria/borrir , a borrow checker and toolchain for raw LLVM IR. Most of the motivation was pure commitment to agentic programming: if our dutiful clankers are writing all the code anyway, why keep a human-facing front-end? Beyond the sensationalized motivation, I had a deeper gut feeling that there could be a benefit to working directly with a lower-level representation of code. Have you tried to code in OCaml or Haskell? It’s wonderful but it definitely requires more cognitive effort to keep track of all the types and abstractions in your head. Could the same be true for our clankers? Are all tokens of equal density in the context? In 2013 a team at Google published word2vec https://arxiv.org/abs/1301.3781 . It turns every word into a vector, a list of numbers learned from the company the word keeps. By treating words as vectors, we can perform arithmetic on their meanings and discover relationships between them: This continues to be my basic understanding of how LLMs work. An LLM still starts this way. Every token is looked up in a table and comes out as one vector. In our embeddings not all vectors are equally informative. Some words have dense, specific representations, while others are more diffuse and context-dependent. Take queen for example: its vector is highly specific and informative whereas bank is more ambiguous and context-dependent. One vector has to cover multiple senses, so the model relies on the surrounding context to disambiguate it. The same is true for mutable variables. When variable names are reused for different values, the model has to rely on context to disambiguate them, just like it does with polysemous words in natural language. Compilers face a similar challenge when reasoning about programs with mutable variables, and by and large, gave up. GCC, LLVM, Go, V8 and HotSpot all lower your program into static single assignment https://en.wikipedia.org/wiki/Static single-assignment form before they try to reason about it. Tip In SSA every value gets one name, once. Nothing is mutated in place and nothing shadows an outer variable. A name means the same thing everywhere it appears. If mutable assignments are hard for compilers to reason about, they are likely hard for LLMs to reason about as well. This is my hypothesis: LLMs will find SSA-style code easier to reason about than code with mutable variables. § does-an-llm-read-ir-better-than-rust Does an LLM read IR better than Rust? The evaluation setup was designed to test whether LLMs find SSA-style code easier to reason about than code with mutable variables. In order to make a fair comparison, each program was written in three different notations: 1. Mutable Rust : ordinary Rust with let mut and reassignment. 2. Single-assignment Rust : the same Rust, with a fresh name for every new value. 3. LLVM IR : the compiled SSA form of the mutable Rust. I generated 40 different small programs. Each one threads three variables through eight steps of branches and helper calls, and each one exists in three notations that return the same value: