Why Can’t I Create Software that Writes Code For Me?

I want to replace myself with a bot so that I can disappear from work unnoticed.

This should not be difficult. I write server code, a soulless job never intended for humans. What would it take to create ProgrammerBot, a bot that writes code?

The first thing ProgrammerBot needs is a Turing-complete model. That is, a general method that can solve any problem a digital computer can compute.

Recurrent neural networks are Turing-complete. Using a neural-network model, ProgrammerBot could generate any solution program in the world.

But the hard part is not producing the software; it’s verifying that the software is correct.

Consider the simplest test for correctness: Will the solution program terminate on all inputs, as opposed to looping forever?

This is an unprovable test, known as the Halting Problem. (There are many other unprovable tests.)

Of course, I don’t need a generic ProgrammerBot. My boss is unlikely to task me with stuff like solving the graph isomorphism problem in polynomial time. ProgrammerBot just needs to write a stupid app that responds to API calls.

For that, ProgrammerBot can use a decision tree model.

Each of my tasks is essentially as an optimization problem, where the goal is to produce software that minimizes the number of server complaints reported in the company Slack channel.

By generating combinations of IF-THEN statements, ProgrammerBot will eventually produce functionally correct software. The combinations don’t have to be random or brute-force; the bot can use metaheuristics to converge on a solution.

ProgrammerBot works closely with SlackerBot, who closes the feedback loop by collecting bug reports from Slack. ProgrammerBot calls this Test-Driven Design.

I made a bot to deal with my coworkers on Slack.
My SlackerBot at work.

Of course, I’m cheating here by throwing broken code over the wall and waiting for people to bitch at me. This again cuts out the hardest part of creating ProgrammerBot: Testing the created software.

Given enough time, and patient enough coworkers, it would indeed be possible to have ProgrammerBot do my job. But I would probably get fired first.

One thought on “Why Can’t I Create Software that Writes Code For Me?

Leave a Reply