After I reviewed Amazon CodeWhisperer, Google Bard, and GitHub Copilot in June of 2023, CodeWhisperer might generate code in an IDE and did safety critiques, but it surely lacked a chat window and code explanations. The present model of CodeWhisperer is now referred to as Amazon Q Developer, and it does have a chat window that may clarify code, and several other different options which may be related to you, particularly should you do a variety of growth utilizing AWS.
Amazon Q Developer at the moment runs in Visible Studio Code, Visible Studio, JetBrains IDEs, the Amazon Console, and the macOS command line. Q Developer additionally affords asynchronous brokers, programming language translations, and Java code transformations/upgrades. Along with producing, finishing, and discussing code, Q Developer can write unit assessments, optimize code, scan for vulnerabilities, and counsel remediations. It helps conversations in English, and code within the Python, Java, JavaScript, TypeScript, C#, Go, Rust, PHP, Ruby, Kotlin, C, C++, shell scripting, SQL, and Scala programming languages.
You possibly can chat with Amazon Q Developer about AWS capabilities, and ask it to assessment your assets, analyze your invoice, or architect options. It is aware of about AWS well-architected patterns, documentation, and resolution implementation.
In line with Amazon, Amazon Q Developer is “powered by Amazon Bedrock” and educated on “high-quality AWS content material.” Since Bedrock helps many basis fashions, it’s not clear from the online assertion which one was used for Amazon Q Developer. I requested, and bought this reply from an AWS spokesperson: “Amazon Q makes use of a number of fashions to execute its duties and makes use of logic to route duties to the mannequin that’s the greatest match for the job.”
Amazon Q Developer has a reference tracker that detects whether or not a code suggestion may be much like publicly accessible code. The reference tracker can label these with a repository URL and challenge license data, or optionally filter them out.
Amazon Q Developer straight competes with GitHub Copilot, JetBrains AI, and Tabnine, and not directly competes with numerous giant language fashions (LLMs) and small language fashions (SLMs) that learn about code, reminiscent of Code Llama, StarCoder, Bard, OpenAI Codex, and Mistral Codestral. GitHub Copilot can converse in dozens of pure languages, versus Amazon Q Developer’s one, and helps numerous extensions from programming, cloud, and database distributors, versus Amazon Q Developer’s AWS-only ties.
Putting in Amazon Q Developer
Given the a number of environments through which Amazon Q Developer can run, it’s not a shock that there are a number of installers. The one difficult bit is signing and authentication.
Putting in Q Developer in Visible Studio Code
You possibly can set up Amazon Q Developer from the Visible Studio Code Market, or from the Extensions sidebar in Visible Studio Code. You will get to that sidebar from the Extensions icon on the far left, by urgent Shift-Command-X, or by selecting Extensions: Set up Extensions from the command palette. Kind “Amazon Q” to search out it. When you’ve put in the extension, you’ll must authenticate to AWS as mentioned beneath.
Putting in Q Developer in JetBrains IDEs
Like Visible Studio Code, JetBrains has a market for IDE plugins, the place Amazon Q Developer is obtainable. You’ll must reboot the IDE after downloading and putting in the plugin. Then you definitely’ll must authenticate to AWS as mentioned beneath. Notice that the Amazon Q Developer plugin disables native inline JetBrains full-line code completion.
Putting in Q Developer within the AWS Toolkit for Visible Studio
For Visible Studio, Amazon Q Developer is a part of the AWS Toolkit, which you could find it within the Visible Studio Market. Once more, when you’ve put in the toolkit you’ll must authenticate to AWS as mentioned beneath.
Signing and authenticating Amazon Q Developer
The authentication course of is complicated as a result of there are a number of choices and several other steps that bounce between your IDE and net browser. You used to need to repeat this course of incessantly, however the product supervisor assures me that re-authentication ought to now solely be essential each three months.
Putting in Q Developer for command line
Amazon Q Developer for the command line is at the moment for macOS solely, though a Linux model is on the roadmap and documented as a distant goal. The macOS set up is mainly a obtain of a DMG file, adopted by operating the disk picture, dragging the Q file to the purposes listing, and operating that Q app to put in the CLI q
program and a menu bar icon that may deliver up settings and the online consumer information. You’ll additionally must authenticate to AWS, which can log you in.
Amazon Q Developer within the AWS Console
In case you are operating as an IAM consumer reasonably than a root consumer, you’ll have so as to add IAM permissions to make use of Amazon Q Developer. Upon getting permission, AWS ought to show an icon on the proper of the display screen that brings up the Amazon Q Developer interface.
Evaluating Amazon Q Developer
In line with AWS, “Amazon Q Developer Agent achieved the very best scores of 13.4% on the SWE-Bench Leaderboard and 20.5% on the SWE-Bench Leaderboard (Lite), a knowledge set that benchmarks coding capabilities. Amazon Q safety scanning capabilities outperform all publicly benchmarkable instruments on detection throughout the most well-liked programming languages.”
Each of the quoted numbers are mirrored on the SWE-Bench web site, however there are two points. Neither quantity has as but been verified by SWE-Bench, and the Amazon Q Developer rating on the Lite Leaderboard has dropped to #3. As well as, if there’s a supporting doc on the internet for Amazon’s safety scanning declare, it has evaded my searches.
SWE-Bench, from Cornell, is “an analysis framework consisting of two,294 software program engineering issues drawn from actual GitHub points and corresponding pull requests throughout 12 common Python repositories.” The scores replicate the answer charges. The Lite information set is a subset of 300 GitHub points.
Let’s discover how Amazon Q Developer behaves on the varied duties it helps in a few of the 15 programming languages it helps. This isn’t a proper benchmark, however reasonably an try to get a really feel for a way nicely it really works. Keep in mind that Amazon Q Developer is context delicate and tries to make use of the persona that it thinks most closely fits the atmosphere the place you ask it for assist.
Predictive inline code era with Amazon Q Developer
I attempted a softball query for predictive code era and used considered one of Amazon’s inline suggestion examples. The Python immediate equipped was # Perform to add a file to an S3 bucket
. Urgent Possibility-C as instructed bought me the code beneath the immediate within the screenshot beneath, after an unlawful character that I needed to delete. I needed to sort import
on the high to immediate Amazon Q to generate the imports for logging
, boto3
, and ClientError
.
I additionally used Q Chat to inform me the best way to resolve the imports; it recommended a pip
command, however on my system that mounted the unsuitable Python atmosphere (v 3.11). I needed to do some sleuthing within the Frameworks listing tree to remind myself to make use of pip3
to focus on my present Python v 3.12 atmosphere. I felt like singing “Daisy, Daisy” to Dave and complaining that my thoughts was going.
I additionally tried Amazon’s two different built-in inline suggestion examples. The instance to finish an array of pretend customers in Python principally labored; I had so as to add the closing ]
myself. The instance to generate unit assessments failed once I pressed Possibility-C: It generated unlawful characters as an alternative of perform calls. (I’m beginning to suspect a problem with Possibility-C in VS Code on macOS. It might or could not have something to do with Amazon Q Developer.)
After I restarted VS Code, tried once more, and this time pressed Return on the road beneath the remark, it labored high quality, producing the test_sum
perform beneath.
# Write a take a look at case for the above perform. def test_sum(): """ Unit take a look at for the sum perform. """ assert sum(1, 2) == 3 assert sum(-1, 2) == 1 assert sum(0, 0) == 0
AWS reveals examples of completion with Amazon Q Developer in as much as half a dozen programming languages in its documentation. The examples, just like the Python ones we’ve mentioned, are both quite simple, e.g. add two numbers, or relate to widespread AWS operations supported by APIs, reminiscent of importing recordsdata to an S3 bucket.
Pure language to code era with Amazon Q Developer
Since I now believed that Amazon Q Developer can generate Python, particularly for its personal take a look at examples, I attempted one thing slightly totally different. As proven within the screenshot beneath, I created a file referred to as quicksort.cpp, then typed an preliminary remark:
//perform to kind a vector of generics in reminiscence utilizing the quicksort algorithm
Amazon Q Developer saved making an attempt to autocomplete this remark, and in some circumstances the implementation as nicely, for various issues. However it was straightforward to maintain typing my specification whereas Amazon Q Developer erased what it had generated, and Amazon Q Developer finally generated an almost appropriate implementation.
Quicksort is a well known algorithm. Each the C and C++ libraries have implementations of it, however they don’t use generics. As a substitute, you must write type-specific comparability capabilities to move to qsort
. That’s historic, because the libraries had been carried out earlier than generics had been added to the languages.