Starlark is a small language designed to be embedded in another application, to provide configuration or scripting abilities.
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.
Why Starlark
- Deterministic evaluation - Executing the same code twice will give the same results.
- Hermetic execution - Execution cannot access the file system, network, system clock. It is safe to execute untrusted code.
- Parallel evaluation - Modules can be loaded in parallel. To guarantee a thread-safe execution, shared data becomes immutable.
- Simplicity - We try to limit the number of concepts needed to understand the code. Users should be able to quickly read and write code, even if they are not experts. The language should avoid pitfalls as much as possible.
- Focus on tooling - We recognize that the source code will be read, analyzed, modified, by both humans and tools.
- Python-like - Python is a widely used language. Keeping the language similar to Python can reduce the learning curve and make the semantics more obvious to users.
Get Started
- Try Starlark in the playground and play with the code examples.
- Read "A practical introduction to the Starlark language".
- Use the Starlark implementation in Go.
- Use the Starlark implementation in Rust.
Starlark was designed at Google; see bazelbuild/starlark for official documentation. However, this website is not affiliated with Google. You may contribute to this website at laurentlb/starlark-lang.org.