4 ms·
Starlark is a Python dialect implemented by Google. It is rather liberal with compatibility, but as you observed, none of that matters for "ordinary code". It d
by sanxiyn 6y ago
Starlark is a Python dialect implemented by Google. It is rather liberal with compatibility, but as you observed, none of that matters for "ordinary code". It doesn't even pretend to support existing Python library ecosystem.
In exchange, Starlark is GIL-free. This was the primary motivation to reimplement. It really is that easy if you don't need to be compatible.
I think Starlark is a good approximation of the core of Python. It is easy to implement. It DOES 100% look and feel like Python, and if you use it as Python-as-pseudo-code mode, you will never realize it is not Python. On the other hand, almost no Python library will run. This feels paradoxical, but that's what it is.
https://github.com/bazelbuild/starlark https://github.com/bazelbuild/starlark
- Tyr42 6y agoWait I didn't realize it wasn't python. Google engineer for 3 years now.
- sanxiyn 6y agoHaha. It is 100% obvious if you are a Python implementer that Starlark IS NOT Python, but it is ALSO 100% obvious if you are a Python user that Starlark IS Python. Strange, isn't it? Such is life.
- laurentlb 6y agoA lot of Starlark code at Google is still tested using a Python framework. So the code is compatible with Python to a fairly large extent. A Starlark interpreter can easily be compiled to webassembly and run in a browser. I did it here: http://laurent.le-brun.eu/starlark/ http://laurent.le-brun.eu/starlark/
- joshuamorton 6y agoJust to emphasize this: https://github.com/bazelbuild/bazel-skylib/commit/9948d5538b8c400aec0dc23c545ec5094f8e079b https://github.com/bazelbuild/bazel-skylib/commit/9948d5538b... It's possible to `exec` bazel and have it work, with some trickery.
- VectorLock 6y agoThis is quite intriguing since my first thought after reading this is "its too bad we don't have a language thats all the syntax of Python but none of the baggage" and then the #1 child of the #1 comment is almost that. Not quite, but almost.