Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Starlark in Rust
An implementation in Rust of the Starlark language
Disclaimer: This is not an officially supported Google product. This project is supported on a best-effort basis and welcome contributions.
Starlark, formerly codenamed Skylark, is a non-Turing complete language based on Python that was made for the Bazel build system to define compilation plugin.
Starlark has at least 3 implementations: a Java one for Bazel, a go one and this one.
This interpreter was made using the specification from the go version and the Python 3 documentation when things were unclear.
This interpreter does not support most of the go extensions (e.g. bitwise
operator or floating point). It does not include the set()
type either (the
Java implementation use a custom type, depset
, instead). It uses signed 64-bit
integer.
Usage
You can depend on this crate starlark
, it is documented using rustdoc.
A command line interpreter is also provided by this project, it can interpret files passed at the command line and also start a REPL (Read-Eval-Print Loop). The usage of this program is:
Development
Build
This project build with Cargo. Simply
run cargo test
to test it, cargo build --release
to build a release version
and cargo run
to run the command-line interpreter.
Possible improvements and optimizations
- Errors:
- When an identifier is not found, we can suggest close identifier / keyword.
- Fix suggestions maybe?
- Better error spans.
- Recoverable errors (don't stop at the first error, continue parsing).
- Evaluation:
- Static rewrite of the AST before evaluation (e.g. for constant values)
- Awesome feature:
- Implement a debugging protocol