5 ms·
> a "hermetic" subset of Python That's funny: I've been using bazel (and previously blaze) for well over a decade, but it has never once occurred to me to thin
by marssaxman 2y ago
> a "hermetic" subset of Python
That's funny: I've been using bazel (and previously blaze) for well over a decade, but it has never once occurred to me to think of starlark as having anything at all to do with Python! I can't see anything about it which is distinctively pythonic.
- IshKebab 2y agoErm... the syntax?
- marssaxman 2y agoI'm curious - what about it strikes you that way? To my eyes, starlark bears more resemblance to YAML, or TOML, or any other generic configuration language, than to Python.
- laurentlb 2y agoYou've probably looked only at the Bazel BUILD files. They are indeed quite declarative (as the syntax is restricted even more). If you open other Starlark files that have functions (in Bazel, that would be in .bzl files), you should recognize the Python syntax (e.g. `def` statements + space indentation).
- IshKebab 2y agoErm what? It's very very obviously based on Python. The docs even explicitly say that. This is the example they give: def fizz_buzz(n): """Print Fizz Buzz numbers from 1 to n.""" for i in range(1, n + 1): s = "" if i % 3 == 0: s += "Fizz" if i % 5 == 0: s += "Buzz" print(s if s else i) fizz_buzz(20) Does that look like YAML or TOML?