Bad analogy. Compilers don't reason, they don't hallucinate. They take the language as given and "compile" it to the equivalent binary based on strict definitions in the language. It's reproducible and consistent. Saying they write code is factually wrong, at best they translate it.
AI will do the same thing in multiple ways or veer of course and do it another way based on spoken language with no strict syntax. It will make logical leaps, it will guess, it will assume etc.
These things are not equivalent at all.
The analogy is fine. AI moves us up to a higher level language, and it is understood that higher level languages come with their own leaky abstractions, but the idea remain the same. It is different, but only to the extent that would be expected from stepping up to the next higher level. It's not something completely different. We don't yet have AGI that will magically produce the software before you even knew you needed it. We still need a programmer to write the programs.