6 ms·
When you say "not a strict subset of Python", is that primarily the stdlib changes? Are there any syntactic differences that mean valid Starlark is not valid Py
by __float 6y ago
When you say "not a strict subset of Python", is that primarily the stdlib changes? Are there any syntactic differences that mean valid Starlark is not valid Python?
- joshuamorton 6y agoThere aren't syntactic differences, syntactically starlark is a strict subset. But there are some semantic differences/weirdnessess. `load` does magic, so that `load('//path', 'name')` puts `name` into the file scope, which is possible in pure python but ewww. Containers are immutable, so they can go in default values, which is good since a lot of bzl and BUILD relies on default arguments for brevity.
- __float 6y agoYep yep, makes sense. I helped migrate a Python monorepo to Bazel, which involved an unfortunate amount of Starlark :-) The mental lines between Starlark and Python are fully blurred at this point, but I've seen the "Starlark isn't Python" a few times this past week already. Thanks for the elaboration :)
- joshuamorton 6y ago(ask me how I know they're source compatible: https://github.com/bazelbuild/bazel-skylib/pull/91 https://github.com/bazelbuild/bazel-skylib/pull/91)