Can Alexa Say 'Hello World' in Rust?
Alexa skills are coded in a programming language that converts the request and response in a JSON format.
Join the DZone community and get the full member experience.Join For Free
What Is Amazon Alexa?
Amazon Alexa is a voice assistant. It answer questions, schedule events, play songs, turn on and off your smart lights, your AC etc, and it can even remember where your car keys are. The list is endless..... It does all these things with just one input from you - YOUR VOICE.
Amazon came with some really SMART devices called Amazon Echo and Amazon Echo Dot, which were sold like hot cakes as soon as it hit the market. As they advertised, it was called just a SMART SPEAKER. Yesssss, all this was sold under the name of a SMART SPEAKER. So underrated it was.....
Just as your mobile has applications(or apps) Alexa apps are called SKILLS and the analogy continues with the coding part too. Yeah, Alexa skills are coded in a programming language that converts the request and response in a JSON format. Confused?????
Why Rust and Alexa Can Be the Best of Friends?
Alexa skills requires the response in a jiffy and for that to happen we need our back end programming language to be capable enough to handle a large number of requests and be fast at the same time.
This takes us to search for a programming language that is blazingly fast and hey remember what Rust Programming Language advertised...
So, our search has ended too early, Nah??
Now everyone knows this fellow from Amazon, it is Lambda. We write functions and we trigger Lambda to use that function.
But it supports only 5 languages and surprisingly Rust is not one of them......
AWS Lambda is an integral part of any Alexa Skill but it does not support our BLAZINGLY FAST LANGUAGE. But, what it does support is the Custom Run-time and we will try to accommodate RUST in that.
Quick Skill Development
As you go to the developer account of Amazon Alexa, you will find an option for a custom skill. Just click on that and begin with your skill development. Let's take a deep dive into the different options available there:
- Wake Word
- Starting Phrase
- Skill Invocation Name
Let's discuss all these, one by one, for a better understanding.
Wake word, as the name suggests, wakes up the device and tells the device that the user wants to interact with the device.
As of Now, it supports the following wake words
- Alexa (The most common one)
- Computer (For the old fashioned ones!)
Starting phrases like ask, tell, say, search, open, launch, play, run etc. are used before the SKILL INVOCATION NAME to tell the device to LAUNCH a skill.
Starting Phrases may also be called as a Launch Request for a Skill and it depends on the language for which the skill has been designed. The above stated starting phrases are applicable only when the skill's language has been assigned as English.
Skill Invocation Name
This is the name of your skill which user should know! As soon as user speaks this name, the skill starts working. It should be simple and easy to speak phrase of 2-3 words.
More the number of utterances, more the skill becomes user friendly. A wide range of utterances should be pre-defined for the ease of the users.
This article is stretching a lot, so I will stop here. In my next article, I would build a skill and show a little demo with an Amazon echo device.
Thanks for reading!
Opinions expressed by DZone contributors are their own.
Redefining DevOps: The Transformative Power of Containerization
Auto-Scaling Kinesis Data Streams Applications on Kubernetes
Micro Frontends on Monorepo With Remote State Management
Five Java Books Beginners and Professionals Should Read