Google Unveils Revolutionary Python Subset Starlark Thats Redefining Build Systems Forever

Google Unveils Revolutionary Python Subset Starlark Thats Redefining Build Systems Forever

The Rise of Starlark: A Python Subset Redefining Build Systems

In the realm of build systems, a peculiar subset of Python has emerged as a beacon of efficiency and simplicity. Dubbed Starlark, this hermetic language has garnered significant attention from developers worldwide, with Google being one of its most prominent users.

Starlark’s birth was largely driven by the need for a more streamlined build system. Its creators aimed to create a language that could seamlessly integrate with existing applications, providing configuration or scripting functionalities without compromising performance. By leveraging Python’s syntax, Starlark offers an unparalleled level of readability and maintainability, making it an attractive choice for developers.

One of the primary reasons behind Starlark’s appeal is its minimalist approach. With a focus on simplicity and safety, this language eliminates many of the pitfalls associated with Python, such as security vulnerabilities and complex error handling mechanisms. However, this same minimalism also raises questions about the trade-offs involved in sacrificing certain features for the sake of efficiency.

Haoyi Li, a staff software engineer at Databricks, has had extensive experience with Starlark in Bazel. In his opinion, the language’s hermetic nature is both a blessing and a curse. On one hand, it ensures reproducibility, determinism, and enables optimisations like parallelisation and caching. On the other hand, it can lead to the creation of large, complex codebases that rival those of Python.

Ajay Kidave, who is building Clace, a platform using Go and Starlark, concurs with Li’s assessment. While Starlark excels in avoiding Python’s dependency management challenges with easily extensible plugin APIs, it falls short when it comes to traditional error handling features. “There are no exceptions and no multi-value return for error values,” Kidave notes. “This works for a configuration language where a fail-fast behaviour is good. But for a general purpose script, you need more fine-grained error handling.”

Rochus Keller, developer of BUSY, a lean and statically typed cross-platform build system for GCC, CLANG, and MSVC, argues that purely declarative languages are too restrictive. “You need some ‘smart’ code by users,” he explains.

Mike Hearn, creator of Hydraulic Conveyor, sees Gradle as an example of a build system that leans into complexity, using Kotlin to treat building systems as special programs. This perspective highlights the ongoing debate surrounding scripting languages, with some advocates prioritising simplicity and safety, while others champion complexity and customizability.

As Starlark continues to gain traction, its unique position within the Python ecosystem is becoming increasingly clear. The language’s strengths and limitations are being carefully weighed by developers, who must navigate the trade-offs between simplicity and complexity to create scripting languages that cater to diverse needs and preferences.

The story of Starlark serves as a poignant reminder that progress often lies at the intersection of seemingly disparate ideas, waiting to be discovered by intrepid programmers willing to push the boundaries of what’s possible.

Latest Posts