A Small History Of Airscript

zacharyc
Airkit
Published in
3 min readMar 18, 2022

Airscript is the language used to build apps in Airkit Studio. It started with humble beginnings and has come to a point where it is a very functional programming language. This post will talk about why we have Airscript, what it is and some of the basics behind it.

For detailed information and reference information on Airscript, check out the support documentation: https://support.airkit.com/reference/reference

These notes are based off of the view of me, and are not officially endorsed by the leadership at Airkit. I reserve the right to be wrong about EVERYTHING.

How It Started

Bare with me here, I wasn’t around when Airscript was first invented, so some of this comes third hand. When Airkit started (it wasn’t then called Airkit), the team wanted the platform to be friendly to people who worked with data. Our goal was to create a language for data manipulation that had several key features:

  • Secure: We are dealing with sensitive data, so no evals or anything else that could cause problems.
  • Familiar: We wanted a language that would seem familiar to a large population of our targeted developers.
  • Powerful: despite the need for security, Airkit Apps deal with data, sometimes larger amounts of data, and this language had to provide tools for sifting through data, sorting data, and modifying data.

Because of these key features we ended up with a language that has some really nifty ideas in its creation.

Security

There have been some questions about why create a new language instead of using Javascript as our language. While there are familiarity and ease of use concerns about using Javascript, one of the main reasons to not use Javascript is around security. Javascript has functions like Eval() and functions that modify existing data. Because Airscript uses pure functions, less modification of existing data occurs.

Also because we control the language, it is possible to allow certain actions and not others. Airscript is for modifying and searching data. To get data, we use data flows and data operations.

Familiarity

One of the core powers of Airscript is it’s function library. The set of functions were designed to feel familiar to anyone working with spreadsheets. Functions cover everything from math functions, date functions and list modification functions. Functions are pure in that they don’t modify the data passed in but return a new copy of data after performing their action.

In addition the power of the functions, the object structure should look similar as well to many people. Object structure is very similar to JSON. Meaning if you have familiarity with Javascript and web technology the objects should feel very comfortable.

Powerful

Aside from the super expressive function library, Airscript also has a couple of powerful secrets up it’s sleeve. The query syntax allows for searching collections of data. Because it is possible to embed a query expression inside a query expression, there is really no limit to the amount of searching a user can perform on data. Here is a small example

FROM 
item
IN
collection
WHERE
item.score > 80
SELECT
item

While similar to SQL (which will feel familiar to some), there are some subtle differences here (like the select being at the end).

In addition to the query syntax there is also some features of JSONPath. This is another way of processing collections of data and searching through lists and complex objects to find the data you are looking for.

Conclusion

Airscript is still evolving. We are still writing new functions (I recently wrote ADD_TO_DATE() and we have some fun new comparison operations coming for dates in an upcoming version), but Airscript is very powerful and has been backing our customer implementations from the beginning.

For more information on the spec, please visit the reference documentation:

https://support.airkit.com/reference/reference

--

--

zacharyc
Airkit
Writer for

programmer, coach, photographer, skier, snowboarder, sailor, hiker, biker, runner, gymnast