This AI-Powered Autocompleter Is The 'Smart Compose' For Programmers

Programmers have long experienced the perils of coding. Not just all the syntax must be correct, the whole work should be flawless.

Over the years, the development of AI has improved dramatically. Using data sets, these intelligent machines can be trained to understand images, sound, as well as text.

And here, there is what's called 'Deep TabNine' which aims to help programmers code.

Programmers can simply install it as an add-on to their editor of choice. And when they start coding, Deep TabNine which uses AI, can start suggesting how to continue each line, offering small chunks at a time.

Think of it like Google Gmail's Smart Compose, but for code.

According to Jacob Jackson, the computer science undergraduate at the University of Waterloo who created Deep TabNine, this sort of software isn’t new, but machine learning has hugely improved what it can offer.

“It solved a problem for me,” he said.

Deep TabNine autosuggestion on Python

Jackson started working on the original version of the software, TabNine, in February 2018 before launching it on November.

On July 2019, Jackson updated the software to leverage deep learning text-generation from GPT-2, which was designed by the research lab OpenAI, to improve its abilities.

Most autocompleters in the market use users' previous interactions to make suggestions. Deep TabNine on the other hand, relies on the ability of machine learning to find statistical patterns in data to make its predictions.

Using GPT-2's transformer network architecture, which was originally developed to solve problems in natural language processing, Jackson trained Deep TabNine on data sets of 2 million files from coding repository GitHub.

Learning from the patterns programmers have previously wrote to create their codes, the AI uses the knowledge to predict what is likely to appear next in any given line of code, whether that’s a variable name or a function.

According to Jackson, the AI can look at programmers' syntax and predict when they're calling an object or a list. It can even generate the name of objects based on documentation in natural language.

Generally, the AI's suggestion doesn't look at users’ own code to make suggestions. Because its knowledge is based on other coders' knowledge, the algorithm can start helping with projects right from start, rather that waiting for them to give it some cues.

And because it uses deep learning to create autocompletion, the software offers several advantages, including the ability to add support for new languages.

By just adding more training data into the algorithm, the AI can learn even more coding patterns.

Initially, Deep TabNine supports Python, JavaScript, Java, C++, C, PHP, Go, C#, Ruby, Objective-C, Rust, Swift, TypeScript, Haskell, OCaml, Scala, Kotlin, Perl, SQL, HTML, CSS, and Bash.

Deep TabNine has impressed coders, but that doesn't mean it's perfect.

Deep TabNine autosuggestion on Java

For example, it can make mistakes in its suggestions and can be useless for some types of coding. It's also less able to write exploratory code.

According to Jackson, the tool isn't made to replace programmers, as they still need to take full control. Deep TabNine is just as helpful as an autosuggestion tool, which aims to speed up the process of coding.

"Imagine all programmers right now are using the equivalent of mobile phone keyboards to type, and going to Deep TabNine is sort of like moving to a regular keyboard," he said.

The software improves how quickly coders can input information, and that makes them more productive "because you can spend more time thinking about the high level stuff rather than the detail." But it won't write codes automatically, and coders need to keep an eye on it.

“It’s the goal of everyone working in this space to tell the computer what code you want to write and it does it for you," he said.

“We’re nowhere close to that at the moment, but I see this as a tool that makes it a little more convenient for you to express your thoughts.”

Published: 
26/07/2019