Litexa is a new language and framework released by the Alexa Games team, specifically written for building Alexa Skills.
đ¨Say hello to Litexa đ A literate style programming language and toolchain for building long form Alexa skills. And we just open-sourced it!
Main website: https://t.co/kVP5IWml8L
Docs: https://t.co/VDrc7LJxy5
Github: https://t.co/gCLQIU3fe4— Marcus Devrelius ę§IPę§ (@devrelius) October 15, 2019
It reminds me of Rails in the best ways – I can see it being the entry level step that allows more companies to easily code their own skills, but it has the flexibility to allow more experienced developers to customise easily. We decided recently to produce our own Christmas game in time for the holidays, and Iâve been wanting to try using Litexa since it was released, so this was the perfect opportunity to test it out!
Litexa compiles into JavaScript, and itâs really easy to write the two interchangeably in the same file, which was great as I usually write in Node.js so the learning curve wasnât too steep. My first impression was that everything took SO FEW LINES. The Alexa team describe the syntax as âsuccinctâ and this is definitely the case. I think this is the first app Iâve ever written thatâs been completed in under 500 lines of code, and I wasnât even trying to be particularly brief. Litexa is also white space dependent, and initially itâs a little weird to have to be so careful with how Iâm using my spaces and alignment. It also makes me realise that Iâve become a sloppy typist and am way too dependent on VS code extensions to keep my formatting nice. The Alexa team have released a VS code extension for syntax highlighting, but sadly not yet autoformatting.
I absolutely love the design of having the different invocation phrases (the things a user might be saying to have a particular intent) alongside the logic and output, rather than in different files. When Iâm debugging it can sometimes be hard to work out whether issues are coming from the way Iâve structured invocation phrases or from my logic, and I usually have to keep switching between files. This makes it considerably easier for me to spot problems simply by eyeballing the code.
âThe Bookâ, as the code documents are entitled, is well written and links really nicely to the relevant parts of the Alexa documentation when necessary. Iâve sometimes found the Amazon documentation a little dense to navigate but thatâs not an issue here. As itâs such a new language, there isnât really any information other than this out there, but luckily it seemed pretty intuitive to work out.