Skip to main content

Starlark

What is Starlark

Starlark is a dialect of Python. Like Python, it is a dynamically typed language with high-level data types, first-class functions with lexical scope, and garbage collection. Independent Starlark threads execute in parallel, so Starlark workloads scale well on parallel machines. Starlark is a small and simple language with a familiar and highly readable syntax. You can use it as an expressive notation for structured data, defining functions to eliminate repetition, or you can use it to add scripting capabilities to an existing application.

For more details, see Starlark.

How is it different from Python?

  • Configuration language: Starlark is a dialect of Python designed as a configuration language.
  • Limited standard library: Unlike Python, Starlark is intended to be a smaller, more constrained language, with a limited standard library. This is to ensure that Starlark scripts are hermetic and deterministic, which is important for build systems where reproducibility is key.
  • Deterministic: Starlark is designed to be deterministic, meaning that a Starlark program should produce the same output given the same inputs, with no side effects or dependencies on the system state. This property is crucial for the reproducibility of builds and configurations.
  • Sandboxed execution: Starlark is intended to be used in environments where safety and security are important, so it runs in a sandboxed environment. This limits the ability to perform certain operations like I/O operations or accessing the network, which are typically available in Python.

Why does AutoKitteh use Starlark?

The characteristics of Starlark being deterministic and secure language are a fair compromise between the flexibility required for workflow automation and orchestration, and the deterministic and secure environment AutoKitteh provides.

The lightweight and secure nature of StarLark makes it very efficient in resources.

What you should not do with Starklark

Starlark has it's limits and not support many general libraries supported in Python, such as NumPy, pandas, Flask etc. Thus, it is not suitable for tasks requiring external libraries. If you need to use Python libraries, use Python SDK.