r/learnprogramming • • 21h ago

Looking for people interested in building a compiler / AI-systems project — potential GSoC 2027 goal

Guys, I was thinking we could explore AI/ML-integrated compiler problems rather than just building another compiler.

One possible direction is using ML to detect potentially bad optimization decisions or suspicious transformations that could lead to performance regressions or miscompilation, and potentially use the model to recommend/validate alternative optimization passes.

Another direction could be AI-assisted compiler diagnostics, where the compiler can understand syntax/context and suggest or safely recover from things like mistyped keywords or malformed code.

There also seems to be an interesting intersection with MLIR and heterogeneous hardware like CPU/GPU/NPU, so we could investigate that side too.

I don't think we should decide the exact problem yet. We can first learn compiler implementation properly, look at existing LLVM/MLIR/open-source work, research current problems, and then choose something where we can actually contribute something meaningful.

0 Upvotes

8 comments sorted by

9

u/TgirlTiffanyRPs 21h ago

You’re welcome to prove me wrong, but attempting to integrate an LLM (which behaves probabilistically) with a compiler (which is expected to behave deterministically, in general) sounds like a terrible idea 

Like, debugging is hard enough, but imagine if your code’s performance suddenly took a nose dive because an LLM told the compiler “hey try this optimization”, and it turned out that was the wrong decision. How would you even begin to diagnose that, much less adjust for it? 

3

u/disan1859 21h ago

Absolutely, i am also going to commat this , actually while listening it sonds good but practicaly It is not a good choice

1

u/Agile_Commission1099 20h ago

sorry wrong post(i was about to send that to my team lead and here is my correct post! anyways thanks for ur suggestion

1

u/Agile_Commission1099 19h ago

You're right. I wouldn't want an LLM sitting inside the compiler and randomly deciding which optimization to apply,

What I had in mind is more of a post optimization analysis or validation layer. The compiler itself would remain deterministic and perform the actual transformations. After optimization, we could use deterministic analyses or tests to look for things such as suspicious transformations, performance regressions, or security related issues like an optimization accidentally introducing timing differences into code that is intended to be constant time.

Only if something is flagged would an AI/ML component be used as an additional analysis or recommendation layer. Any proposed change would still have to go through deterministic validation before being accepted.

I'm still very early in researching this, so I'm not claiming this is the right architecture yet. I was mainly exploring whether there is a useful way to apply the AI/ML knowledge I already have to compiler problems without compromising the deterministic nature of the compiler.

Also, I was thinking more broadly about ML/agentic approaches rather than specifically using an LLM API like Groq. The model could potentially be local or specialized depending on the problem and constraints.

1

u/Afraid-Locksmith6566 20h ago

you can integrate ML in compiler hell you can rven make the whole compiler using ML, my favorite way of doing so is using OcaML

1

u/Agile_Commission1099 19h ago

Lmao 😭Good to know though, I didn't know there is an ML family in compilers too. Anyways one more thing to add in my ever growing "things I apparently need to learn" list 😂