In my experience, AI does really well with a good type system. It tries something, if it doesn't compile, looks at the message, fixes, etc etc.
The compiler itself acts as a steering function for the AI. I've also had this experience with Rust.