Google chatbot “Bard” can now code in 20 languages

The AI can now write, explain, streamline, and debug code in two dozen programming languages.

Never one to be left out of a Silicon Valley arms race, Mountain View behemoth Google rolled out its own chatbot AI, called Bard, to compete with the GPTs and Claudes of the world. 

Trained on vast amounts of text, these large language model AIs are capable of creating some pretty interesting stuff. OpenAI’s GPT-4 has shown some impressive capabilities when it comes to code — most famously in turning a literal napkin sketch into a working website.

Specialized AI coding systems, like Github’s Copilot (powered by OpenAI) and Replit’s Ghostwriter, are already available to the public and showing big potential to boost programmer productivity.

Bard now has a suit of coding features designed to help handle various software and program development tasks, as well as providing explanations of what the code does.

Google has found itself in an unusual position in the AI wars, put on the back foot by Microsoft-backed OpenAI and even smaller competitors like Anthropic. As of last month, when TechCrunch asked Bard, GPT-4, and Claude to write some simple code head-to-head, Bard simply declined, while GPT-4 and Claude gave some passable (if buggy) code.

Now, Google has rolled out a suite of coding features for Bard, designed to help handle various software and program development tasks, as well as providing explanations of what the code does, which may be especially helpful for beginners or programmers striking off into a different language or application than usual.

“Since we launched Bard, our experiment that lets you collaborate with generative AI, coding has been one of the top requests we’ve received from our users,” Paige Bailey, group product manager at Google Research, wrote in a blog post announcing the features.

Google’s own engineers had been putting the AI through its paces before its launch, Insider reported from internal emails.

Bard is now capable of coding in over 20 programming languages, Bailey said. C++, Go, Java, Javascript, Typescript, and Python are all within the programming polyglot’s capabilities, and it can translate from one language to another, TechCrunch reported. The AI is also now capable of writing functions for Google Sheets. When it pulls from open source code, it will also cite it.

In addition to creating code, Bard can help streamline it, as well.

“In many cases, Bard can also help optimize your code by making it faster or more efficient,” Bailey said. “Just respond to Bard’s initial output with ‘Could you please make that code faster?’ or ‘Find error handling clauses you might have missed.’”

Bard can also debug code, including its own; just tell it something didn’t work and ask for a fix, and the AI will try. 

As anyone who’s asked ChatGPT to do some simple math, cite a scientific study, or fed it a jailbreak hack knows, AIs are far from infallible. They “hallucinate,” basically making things up. They also present incorrect conclusions with the unchecked confidence of a high school quarterback in a soft conference.

“Bard is still an early experiment, and may sometimes provide inaccurate, misleading or false information while presenting it confidently,” Bailey said. “When it comes to coding, Bard may give you working code that doesn’t produce the expected output, or provide you with code that is not optimal or incomplete.”

Bailey recommended double checking the chatbot’s code, and looking closely for errors or vulnerabilities before incorporating it. Bard does come with the ability to debug code, including its own; just tell it something didn’t work and ask for a fix, and the AI will try. 

“With new coding capabilities, we’re excited to apply generative AI to accelerate software development, inspire innovation, and help people solve complex engineering challenges,” Bailey said.

We’d love to hear from you! If you have a comment about this article or if you have a tip for a future Freethink story, please email us at [email protected].

Related
Autonomous auto racing promises safer driverless cars on the road
Autonomous racing is a testbed where competition spurs innovation and AI-controlled cars chart a course toward safer autonomous vehicles.
The brief history of artificial intelligence: The world has changed fast – what might be next?
Despite their brief history, computers and AI have fundamentally changed what we see, what we know, and what we do.
3D processors could lead to a new era in wireless communication
New 3D processors could unlock more frequencies for wireless communication, unblocking congestion and unleashing new technologies.
Startup accelerates progress toward light-speed computing
A new computer chip takes advantage of light’s latency and bandwidth advantages to link processors faster.
Startup unveils “world’s first” complete AI software engineer
Cognition Labs has unveiled Devin, an AI software engineer that can build websites from scratch, debug code, and more.
Up Next
Subscribe to Freethink for more great stories