5 ms·
That's kind of what Bazel does. Skylark is a Python dialect.
by reubenmorais 6y ago
That's kind of what Bazel does. Skylark is a Python dialect.
- pydry 6y agoWhy is an entirely new dialect necessary? Why couldn't it just have been a python library?
- brown9-2 6y agoTo limit what can be done, to make it easier to reason about: https://docs.bazel.build/versions/master/skylark/language.html https://docs.bazel.build/versions/master/skylark/language.ht...
- qbasic_forever 6y agoIt started as that at Google and was a nightmare in the long run. People would sneak in dependencies on non-hermetic or non-reproducible behavior all the time. The classic "this just needs to work, screw it I'm pulling in this library to make it happen" problem. It just kept getting more and more complex to detect and stop those kinds of issues. Hence a new language with no ability to skirt around its hermetic and non-turing nature.
- sfink 6y agoMozilla uses Python, but executes the code in a very limited environment so you can't import anything not on an allowlist, can't write to files, etc. But it's just the regular Python interpreter executing stuff. It produces a set of data structures describing everything that are then used by the unrestricted calling Python code. It seems to work pretty well, though it feels a little constraining when I'm trying to figure something out and I can't do the standard `import pdb; pdb.set_trace()` thing. There's probably a way around that, but I've never bothered to figure it out.
- sltkr 6y agoStarlark is an extremely limited dialect of Python. It is intentionally not Turing complete, to prevent unbounded computation. I think the rationale for making it syntactically similar to Python was: we want to add a macro processing language to our build system, and we want to support common features like integers, strings, arithmetic expressions, if-statements, for-loops, lists, tuples and dictionaries, so why not base our DSL off of Python that has all that stuff, so that people familiar with Python will have an easy time reading and writing it? Then they implemented a very limited but very fast interpreter that supports just the non-Turing-complete DSL.