Starlark
A Lightweight, Deterministic, and Secure Scripting Language
CSE 645 - Spring 2025�Seminar in Languages
By
Siva Sathwik Kommi
Large Code Bases ? Configuration and Scaling?
What is Starlark?
Motivation
Evolution of Starlark
Novelty of Starlark
Design, Development and Implementations of Starlark
Design Principles
Deterministic evaluation
Hermetic execution
Simplicity
Parallel Evaluation
Focus on tooling
High Level Abstraction
1
2
3
4
5
6
2. Hermetic Execution
3. Parallelism
4. Simplicity
5. Focus on Tooling
6. High level Abstraction
Starlark Module System
Starlark uses the concept of modularity, where functionalities are implemented as code blocks/files.
Step 1: Read and Parse
What Happens?
Why?
Abstract Syntax Tree for a Simple Addition Program
Step 2: Load Dependencies
Step 3: Static Checks
Step 4: Code Evaluation
Step 5: Freezing Variables
Step 6: Expose Bindings
Starlark - Comparison and Implementations
Starlark vs other Scripting Languages
Feature | Starlark | Python | JavaScript |
Deterministic Execution | Yes | No | No |
Sandboxed Execution | Yes | No | No |
Performance | Medium | High | High |
Why can’t we just use Python? Why is Starlark needed?
Similarities with Python
As mentioned before, Starlark is very similar to python syntactically.
Differences from Python
In terms of functionality, Starlark has some restrictions unlike python including :
Why is thread safety crucial for Starlark ?
1. Organizing and Reusing Code
2. Ensuring Deterministic, Thread-Safe Execution
Code Evaluation and Different Implementations
Go Implementation of Starlark
Design Choices for Go Implementation
Starlark interpreter in Go
Java Implementation of Starlark
Design Choices for Java Implementation of Starlark
Rust Implementation of Starlark
Design Choices for Rust Implementation of Starlark
Common Errors when using Starlark
Major Starlark Users
Google Bazel Build System
What is Bazel?
Starlark in Bazel
Rules
Macros
Advantages of Using Starlark
Limitations of Starlark
Limitations of Starlark
Conclusion
Q n A
Thank You