I was wondering, is it possible to use Artificial Intelligence to make compilers better?
Things I could imagine if it was possible –
- More specific error messages
- Improving compiler optimizations, so the compiler could actually understand what you’re trying to do, and do it better
If it is possible, are there any research projects on this subject?
4
Answers
Are you refering to something like Genetic Programming?
http://en.wikipedia.org/wiki/Genetic_programming
This is indeed a field being researched. Look at the milepost branch for GCC, which relies on profile-guided optimization and machine learning. The recent scientific literature for compilers is full of papers using a combination of data mining, machine learning (through genetic algorithms or neural networks), and more “classical”, pattern-recognition of certain code patterns.
You should look at MILEPOST GCC –
An optimizing compiler is actually a very complex expert system and Expert systems is one of the oldest branches of artificial intelligence.