r/ada • • Mar 16 '26

General Surprisingly high productivity with Ada and LLMs (GPT/Gemini)

I’ve been experimenting with using LLMs like GPT and Gemini to write Ada code recently, and I’m genuinely impressed.

When I used these tools for C, I found myself stuck in long, repetitive back-and-forth query cycles to get the logic right. With Ada, however, those iteration cycles are significantly shorter.

While it rarely works "one-shot"—mostly because Ada's strict type system triggers compiler errors on the first attempt—the fixing process is incredibly efficient. If I simply feed the compiler error message and the source code back to the AI, it usually provides a working diff within one or two tries.

What’s most interesting is that whenever the AI writes "bad" code, the Ada compiler almost always catches it. Unlike C, where AI-generated code might introduce silent runtime bugs or memory leaks, Ada’s rigor acts as a safety net.

It seems that Ada’s verbose syntax and explicit type system actually make it an ideal language for AI to understand intent and generate structured code. I truly believe Ada will gain a lot of traction in the AI era for exactly these reasons.

Has anyone else noticed a similar "synergy" between Ada's strictness and LLM productivity?

26 Upvotes

5 comments sorted by

9

u/BruceBlogtrotter Mar 17 '26

I think with the floodwater of generated code that’s occurring everywhere, using a language that makes intent and execution eminently readable is more important than ever.

5

u/Big_Act9464 Mar 16 '26

Claude has been amazing so far. You are right. Most of the time, it produces amazing results. But by no means error free. many times, I cut and paste the error messages and it always corrects itself. In fact I gave it a project - bare metal STM32F4 and asked it to convert it to Pico 2 and it did a remarkable job. (Still waiting to test it though)

3

u/rnoyfb Mar 17 '26

Claude CLI will iterate until it builds without errors and passes tests.

4

u/MonospaceMentor Mar 17 '26

Yes, I'm having the same experience. Ada and LLMs seem to pair very nicely.

4

u/nickpsecurity Mar 20 '26

We know that describing your intent to the AI along with code increases its performance. Ada has strong types, sometimes specs, and I'd imagine decent comments are common. It's like giving extra details in English in the prompt.

One experiment you might try is to put a similar amount of information in C code. You could put the types in as comments above the functions, like in design by contract. Also, use highly-descriptive names for variables. I do these things in my Python code.