Usually, humans wrote code to make robots work, but sometimes, it’s a bit tricky, with one wrong character breaking the entire thing, meaning it doesn’t work at all.

Now researchers have created a robot that can write code for you, so you can forget about asking the experts on StackOverflow or pasting code from Github, with a robot writing the correct code for you instead.

“I see Bayou as a smarter version of the kind of code-completion that’s supported by IDEs,” one of the robot’s creators Vijayaraghavan Murali told The Register.

“Bayou can generate more complex pieces of code, such as API calls, loops, and exception handling blocks, and it does this by learning common patterns from data. Our vision for Bayou would be to have it integrated within an IDE, running in the background suggesting snippets of code as the programmer is typing in their program.”

The Bayou robot has been developed by Rice University in Texas and it uses deep learning algorithms and training data taken from GitHub to automate the code writing process. The robot is trained using neural sketch learning, which, far from just replacing a piece of code with what it thinks is correct, involves training a neural network to find multiple answers that could work.

“The advantage of using open-source projects in GitHub is that the patterns that Bayou learns from that data are the most common ones across a wide variety of programmers,” Murali explained.

“Having said that, we had to be meticulous with the quality of data that Bayou is trained on, as not all GitHub projects are of the same quality. We also had to be careful with forks and duplicates, as they would bias the patterns that Bayou ends up learning. An officially vetted corpus would mitigate such problems.”