Pepsi, when they don't have coke

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A practical exploration of configuration language options for Python developers, focusing on Starlark as a sandboxed, Python-flavored DSL. The author compares common config formats (TOML, JSON, YAML) and dedicated languages (CueLang, Dhall, Jsonnet), explaining why CueLang is ideal but lacks Python bindings. Starlark is presented as a workable alternative via the starlark-pyo3 Rust-backed library, with code examples showing how to execute Starlark files from Python, expose callables, and implement a custom import loader. The conclusion is nuanced: Starlark is useful for exposing a sandboxed DSL to untrusted third parties, but for personal projects it adds too much ceremony without schema support, making plain Python config still preferable.

10m read timeFrom bitecode.dev
Post cover image
Table of contents
SummaryConfiguration sucksWill I use Starlark in the future?

Sort: