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 tips@freethink.com.

Related
GitHub CEO says Copilot will write 80% of code “sooner than later”
GitHub CEO Thomas Dohmke goes in depth to answer questions about how AI-powered development will change the future of innovation itself.
No, AI probably won’t kill us all – and there’s more to this fear campaign than meets the eye
A dose of scepticism is warranted when considering the AI doomsayer narrative — there are commercial incentives to manufacture fear of AI.
To fear AI is to fear Newton and Einstein. There are no “dragons” here. 
Who’s afraid of utopia? AI doubters have cold feet. History can warm them.
Apple Vision Pro wasn’t the only major announcement at WWDC23
On Day 1 of WWDC23, Apple announced three new Macs, several new operating systems, and the world’s most powerful personal computer chip.
Apple announces the Vision Pro XR headset
Apple has unveiled the Vision Pro, a VR/AR headset, at their annual WorldWide Developers Conference.
Up Next
Subscribe to Freethink for more great stories