# Starlark

> configuration language used by Bazel and other build systems

**Wikidata**: [Q104094003](https://www.wikidata.org/wiki/Q104094003)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/Starlark)  
**Source**: https://4ort.xyz/entity/starlark

## Summary
Starlark is a configuration language used for build automation, most notably by the Bazel build system. It is a dialect of Python, intentionally simplified to ensure that build processes are deterministic and reproducible. Starlark provides a familiar, scriptable way to define how software is built while enforcing strict rules for reliability.

## Key Facts
- **Primary Use:** Build automation and writing configuration files.
- **Based On:** A dialect of the Python programming language.
- **Used By:** The Bazel build system.
- **Alias:** Formerly known as Skylark.
- **License:** Apache Software License 2.0.
- **Typing Discipline:** Dynamic typing.
- **Programming Paradigm:** Procedural programming.
- **Classification:** An instance of a computer language, scripting language, and strict programming language.
- **Source Code Repository:** `https://github.com/bazelbuild/starlark`

## FAQs
### Q: What is Starlark used for?
A: Starlark is primarily used for build automation and to write configuration files for build systems. It is the language used to define build rules and targets in tools like Bazel.

### Q: Is Starlark the same as Python?
A: No, Starlark is a dialect of Python but is not identical. It is a restricted subset of Python, intentionally removing features like arbitrary I/O to ensure that build configurations are deterministic and produce the same output from the same input.

### Q: What was Starlark previously called?
A: Starlark was previously known by the alias Skylark.

## Why It Matters
Starlark's significance lies in its solution to the problem of unreliable and non-reproducible software builds. Traditional build scripts written in general-purpose languages can introduce non-determinism, where the same code can produce different results depending on the environment. This makes debugging and scaling builds difficult.

Starlark addresses this by providing a language that is powerful enough for complex configuration but strict enough to guarantee hermetic (self-contained) and deterministic builds. By being a dialect of Python, it offers a familiar syntax to developers, lowering the barrier to entry. However, its intentional limitations—such as disallowing network access or arbitrary file I/O during analysis—are its key feature. This design enforces best practices for build systems, ensuring that builds are fast, correct, and consistent across all developer machines and continuous integration environments. This reliability is critical for managing large-scale software projects.

## Notable For
- **Python-based Syntax:** Its syntax is based on Python, making it familiar and accessible to a large number of developers without requiring them to learn a completely new language.
- **Deterministic Execution:** Starlark is designed for hermetic and deterministic execution. This guarantees that a given configuration will always produce the same result from the same inputs, which is critical for reproducible builds.
- **Intentional Limitations:** Unlike a general-purpose language, Starlark intentionally lacks features like arbitrary file I/O or network access within build rules to enforce build purity and prevent side effects.
- **Core Language of Bazel:** It is the defining configuration language for Bazel, a popular open-source build and test tool used for large-scale software development.

## Body
### Language Design and Characteristics
Starlark is a computer language designed with specific constraints for use in build systems.
- **Foundation:** It is based on the Python programming language, inheriting much of its syntax.
- **Paradigm:** It follows a procedural programming paradigm.
- **Typing:** The language uses a dynamic typing discipline.
- **Classification:** Starlark is classified as a scripting language and a strict programming language.

### Use and Application
The primary application of Starlark is in the domain of software development and deployment.
- **Function:** It is used for build automation and for writing configuration files.
- **Adoption:** The Bazel build system uses Starlark as its configuration language.

### Licensing and Availability
Starlark is an open-source project.
- **License:** The source code is distributed under the Apache Software License 2.0.
- **Copyright:** The project is copyrighted.
- **Source Code:** The official source code repository is hosted on GitHub at `https://github.com/bazelbuild/starlark`.
- **Official Website:** The language documentation is available at `https://docs.bazel.build/versions/master/skylark/language.html`.

### Identity and Naming
- **Current Name:** Starlark
- **Alias:** The language was formerly known as "Skylark".

## References

1. [Source](https://api.github.com/repos/bazelbuild/starlark)