Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not trying to bash, honestly curious; why not just use python?


There's some explicit differences with Python[1]. My understanding is that Starlark was specifically created for Bazel so if I had to guess it's to enforce the immutability of values between contexts.

[1] https://bazel.build/rules/language#differences_with_python


The early versions (before it was called Starlark) was indeed just run with a Python interpreter. But in order to have a deterministic and reproducible build, they needed to put some limits on what you can do, and especially what you can accidentally do. Starlark's raison d'etre is to allow a build graph that you can reason about and have a shared cache for.


Embedding the Starlark interpreter into a Rust program took me less than an hour. There's little more to it than adding the crate and calling into it. No futzing with the build process.

If starlark does everything you need (and especially if its limitations are desirable for your use case) then it's the clear choice in my view.


starlark is easily embeddable, minimal, dependency-free language and python is none of those things




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: