I think that the answer to your question is yes. In the article New A.I. application can write its own code, the authors state
Computer scientists have created a deep-learning, software-coding application that can help human programmers navigate the growing multitude of often-undocumented application programming interfaces, or APIs.
Designing applications ...
The other answers cover modern work on this, but it's not even a new topic!
Koza's work in Genetic Programming (1992) led to whole sub-fields doing this. The techniques are widely used, robust, and well understood. They're just very computationally expensive. Enough so that most of the time you're better off just hiring a programmer to do it.
AI has been applied to programming (check out TabNine, my favorite autocomplete engine) although not in as robust a fashion as you describe.
Programming requires a high level of abstract while AI is typically trained to solve a very specific task. Given thousands of examples of insert sort in Python I think a model could be trained (perhaps after ...
I am not an expert on this specific topic, but I can say a few words. I will use the term "programming" to refer to software development (of any kind).
If you are in the camp that this isn't that hard, why hasn't it become mainstream?
It's definitely hard, otherwise, we would have already some useful artificial programmers.
Why is creating AI ...