You don't need AI to learn progrmaming. You just have to write a cli script that writes to a temporary files, compiles it and run it. Then it's easy and quick to make a few tests when you have a doubt.