GitHub’s new AI tool can give suggestions to help write better code

GitHub Copilot can draw context from a programmer’s codes and comments, and suggest them individual lines and entire functions swiftly.

July 02, 2021 07:00 pm | Updated 07:00 pm IST

GitHub Copilot preview. | Picture by special arrangement.

GitHub Copilot preview. | Picture by special arrangement.

GitHub has previewed a new artificial intelligence (AI) tool that can give suggestions to people while coding and help them write better code with less work. It was developed in collaboration with the San Francisco-based AI research company OpenAI.

(Subscribe to our Today's Cache newsletter for a quick snapshot of top 5 tech stories. Click here to subscribe for free.)

GitHub Copilot can draw context from a programmer’s codes and comments, and suggest them individual lines and entire functions swiftly, the firm noted.

“It helps you quickly discover alternative ways to solve problems, write tests, and explore new APIs without having to tediously tailor a search for answers on the internet,” GitHub CEO Nat Friedman said in a blog post. “As you type, it adapts to the way you write code—to help you complete your work faster.”

As the name Copilot indicates, the tool is designed to work with a programmer and not independently, and can be used when working in a new language or framework, or while learning to code. Besides, the code suggestions from the tool can be accepted, rejected, and even manually edited by a programmer.

Also Read | Must we always talk in code? No-code and low-code platforms are changing devs discourse

Some of the samples on GitHub’s website show the tool generating code to fetch tweets, get a Goodreads rating, and draw a scatterplot. Copilot works with a broad set of frameworks and languages, however, the technical preview does especially well for Python, JavaScript, TypeScript, Ruby, and Go, according to GitHub.

The Microsoft-owned firm noted that OpenAI’s system powering its tool was trained on a selection of publicly available source code, as well as natural language. “OpenAI Codex has broad knowledge of how people use code and is significantly more capable than GPT-3 in code generation,” Friedman said.

OpenAI’s GPT-3 language model, uses deep learning methods to create human-like text in real-time , and Microsoft received an exclusive license to use the model in its products and services last year.

GitHub Copilot is available as a Visual Studio Code extension. The Copilot editor extension sends comments and code to the GitHub Copilot service, which then uses OpenAI Codex to synthesise and offer suggestions to the user, the company explained.

“Trying to code in an unfamiliar language by googling everything is like navigating a foreign country with just a phrasebook. Using GitHub Copilot is like hiring an interpreter,” Harri Edwards, Research Scientist at OpenAI, said in a blog post.

0 / 0
Sign in to unlock member-only benefits!
  • Access 10 free stories every month
  • Save stories to read later
  • Access to comment on every story
  • Sign-up/manage your newsletter subscriptions with a single click
  • Get notified by email for early access to discounts & offers on our products
Sign in

Comments

Comments have to be in English, and in full sentences. They cannot be abusive or personal. Please abide by our community guidelines for posting your comments.

We have migrated to a new commenting platform. If you are already a registered user of The Hindu and logged in, you may continue to engage with our articles. If you do not have an account please register and login to post comments. Users can access their older comments by logging into their accounts on Vuukle.