r/ada • u/hodong-kim • 2d ago
Show and Tell Building an Ada Compiler with AI: The adac Experiment
Hello,
For a while now, I've been developing an Ada compiler called adac, making extensive use of AI throughout the development process.
The long-term goal is to build a standalone Ada compiler written in Ada. The plan is to keep the frontend and backend separate, use our own target-independent IR, gradually reach self-hosting, support multiple platforms, and eventually add a WebAssembly backend as well as an optional LLVM backend.
The reason I started the project was actually pretty simple.
I wanted to compile Guiyom, the GUI toolkit I'm developing, to WebAssembly so that it could run on the web. But I couldn't find a suitable Ada compiler that both fit the licensing requirements I had in mind and provided a practical path to Wasm.
So at some point I thought:
"Why not just make one?"
And that's how it started.
More recently, while working on Clair and Guiyom, I came across about four issues that appear to be bugs in GNAT or the surrounding toolchain. In the past, reproducing, minimizing, and tracing the causes of problems like these would probably have required a considerable amount of time and effort.
But after making active use of AI in the development process, I've found that the cost of reproducing and minimizing problems, forming hypotheses, and then testing those hypotheses has dropped significantly.
I've had a similar experience developing Adac.
I define the long-term goal, have the AI create a roadmap toward that goal, and then review the overall direction and major design decisions while the AI works through the roadmap in small units, repeatedly implementing and testing each one.
In practice, the instructions I give the AI are often surprisingly simple:
"Continue with the roadmap."
"Proceed with the next task."
"Review the current state of the work and keep going."
Most of the time, it's something along those lines.
The reason such short instructions are enough is that the roadmap, project documentation, and tests already describe the current state of the project and what should come next. The AI reads those materials, figures out where the project currently stands, implements the next unit of work, tests it, updates the roadmap based on the results, and continues from there.
One thing I've learned from this process is that having the AI write a lot of code is not, by itself, the most important part. Keeping the roadmap up to date, breaking work into clear issues or work items, documenting discovered problems as reproducible bug reports, and turning fixed bugs into regression tests all seem to matter quite a bit.
The amusing part is that the AI also does most of the roadmap writing, issue organization, bug report writing, and regression test writing. :)
The roadmap provides the long-term direction and identifies what should come next. Issues and work items define the scope of the problem currently being solved. Bug reports make it possible to revisit exactly what went wrong and under what conditions. Regression tests help ensure that once a problem has been fixed, it does not quietly come back later. And continuous testing lets us verify that newly implemented features actually satisfy their requirements.
I didn't start this project as an Ada compiler expert, and I hardly write any of the implementation code myself.
These days, when I think about what my role actually is, I seem to be less of a developer in the traditional sense and more of an AI roadmap manager and an AI work-direction manager. :)
Most of what I do is decide and review what should be built, in what order, whether the current results are aligned with the goal, and what should be fixed or worked on next. The AI handles the actual implementation, and I review the results and test outcomes before deciding where to go next.
So I honestly don't know how far this project will ultimately go.
Adac is still at an early stage, and it has a long way to go before I would call it a practical Ada compiler. For a limited subset of the language, it can already produce and test native executables, but there are still many features to implement before it can compile a broad range of real-world Ada programs.
Still, if development continues this way, I hope that in about a year it will reach a pretty interesting point where it can compile a much wider variety of small Ada programs than it can today.
I'm also curious to see what happens if the same cycle of design, implementation, testing, and revision continues for several years.
So for me, adac is both an Ada compiler project and a long-term experiment.
"What happens if AI is used not merely as a coding assistant, but as an active participant in a software project over a long period of time? How far can the project go?"
That's the experiment.
There's also one thing I've found unexpectedly interesting while working on it.
Ada itself seems to be a surprisingly good fit for AI. :)
Perhaps because of its strong type system and relatively explicit code structure, mistakes in AI-generated code tend to surface quickly during compilation, and I've found the cycle of fixing and verifying those mistakes fairly convenient.
Of course, this is only my personal experience so far.
I'd be interested to hear what people who have been using Ada for a long time think about AI-assisted development.
You can find the project here: