Harnessing LLMs with Deterministic Program Analysis for Legacy Code
There is an optimistic and a pessimistic reading of what GenAI does to the problem of large legacy codebases.
Technology and Art
There is an optimistic and a pessimistic reading of what GenAI does to the problem of large legacy codebases.
RedDragon is a multi-language interpreter/compiler that lowers 16 languages (Python, Java, Go, TypeScript, Rust, C, C++, C#, JavaScript, Kotlin, Lua, PHP, Ruby, Swift, Scala, COBOL) down to a shared IR. With 13,000+ tests across 16 frontends, keeping quality high and coverage visible requires a harness that operates at several layers simultaneously. This post documents that harness in full: how…
Two agentic development frameworks applied to the same multi-layer type migration across a 13,000-test compiler pipeline. The first provided process discipline but stalled partway through. The second completed the work because it planned more thoroughly and stopped to ask.
Tracing the full arc of a multi-phase refactoring — from “Java string concatenation crashes the VM” to “every value in the system carries its type” — done across a dozen sessions with Claude Code over two days.
Notes from building a multi-language code analysis engine across 400+ conversation sessions with Claude Code.
A universal IR with per-opcode typed instructions, 15 deterministic frontends, LLM-assisted repair/lowering/execution, a deterministic VM with class hierarchy support, overload resolution, and cross-language slicing, a structured type system with generics/unions/variance/traits and interface-aware inference, and iterative dataflow analysis.
In this post, I’ll talk about how I wrote a small Virtual Machine in Prolog which can both interpret concrete assembly language-like programs, and run basic symbolic executions, which are useful in data flow analyses of programs. The full code is available in this repository.
In this post, I present an abbreviated overview of Prolog and the paradigm of Logic Programming. I’ll discuss why I think it makes for such a powerful domain modelling language (with examples), and a gateway into the techniques of automated symbolic reasoning.
This post talks about a technique to build an ANTLR grammar for HLASM (mainframe assembler) from scratch, without writing the grammar of the entire instruction set by hand. The technique creates a parser which reads a table of instruction formats from IBM’s official documentation, and automates the creation of the actual HLASM grammar based on these instruction formats.
We look at how a Hierarchical Bayes-like model can be used to recursively decompose a hypothesis into sub-hypotheses to form an inference tree. The beliefs of these sub-hypotheses are updated based on the strength of the evidence gathered using MCP tools.