Tuesday, November 25, 2025

AI Code-generation Anecdote

Read today:

"I worked in AI from 1975 to 1995; several years of that was in automatic programming. I constantly hear that AI is replacing programmers and find this to be unbelievable. So I decided to give GROK an impossible task. I asked it to write a merge sort program in Common Lisp. It did using linked lists. So then I asked it to do the same thing but using vectors. It wrote a correct program again. So then I asked it to write it to write a concurrent version. Again, it did. I was amazed! Unfortunately, each version was horribly inefficient. The list and vector versions were identical except for the functions that created lists and vectors.

At each level of the merge they created new arrays instead of manipulating the original storage structures. Similarly, the concurrent version created a new thread for each merge. In real-world applications, these generated functions would have been, I imagine, orders of magnitude slower than a hand-written merge sort. You might as well use bubble sort. :) ChatGPT was even worse. Clearly, what these systems do is the first phase of Sussman's PhD Hacker system.

No intelligence, just simple pattern-matching of a provide specification to the specification associated with code found on the Internet. The impressive part is being to match the two specifications, written in English, which are probably somewhat different."

No comments:

Post a Comment