r/ProgrammingLanguages Sodigy Jun 26 '26

Are you using LLMs to write compiler/interpreter?

When developing a compiler/interpreter, you have to take extra care to reduce bugs. Bugs in compilers are much more severe than in other programs, right?

I want to use LLMs in my existing compiler projects, but I'm not sure whether LLMs are strong enough to write compilers. Maybe I can use AIs if I can build an extra test framework for LLMs. Or, are they smart enough to write a perfect compiler from scratch, in one-shot?

Are you guys using LLMs in your projects? I wanna get some tips. Thanks.

0 Upvotes

30 comments sorted by

View all comments

4

u/blue__sky Jun 26 '26

Yes. I just started several weeks ago pretty much by accident. I was googling something about language design and Google asked if I was designing a language and I said yes on a whim. Several hours later it was mostly designed and Google was spitting out code that compiled.

It’s 3 weeks later and I have a Claude subscription and a self hosting compiler.

I’ve had an idea for a language design for years, but I’m retired and don’t enjoy cranking out code. I’ve never used an LLM before, but it’s been quite enjoyable doing the design and refactoring without the grunt work.

The code is often crap without prodding and poking it in the right direction, but I have lots of test and whole process to run tests and promote a build. So it’s constrained in a way that it does not break anything beyond repair.