{"id":13502953,"url":"https://github.com/facebook/starlark-rust","last_synced_at":"2025-12-12T12:47:47.356Z","repository":{"id":37685761,"uuid":"319383495","full_name":"facebook/starlark-rust","owner":"facebook","description":"A Rust implementation of the Starlark language","archived":false,"fork":false,"pushed_at":"2025-04-22T17:33:53.000Z","size":11563,"stargazers_count":791,"open_issues_count":29,"forks_count":69,"subscribers_count":45,"default_branch":"main","last_synced_at":"2025-04-22T18:46:07.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebook.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-07T16:47:27.000Z","updated_at":"2025-04-22T17:33:57.000Z","dependencies_parsed_at":"2023-10-13T15:57:44.327Z","dependency_job_id":"78b7350e-3b71-45bf-b72a-192d6f8f9365","html_url":"https://github.com/facebook/starlark-rust","commit_stats":{"total_commits":4975,"total_committers":88,"mean_commits":56.53409090909091,"dds":"0.42211055276381915","last_synced_commit":"fc908cf5c0e329f36f115f4f48c3da2cb2a8c58f"},"previous_names":["facebook/starlark-rust","facebookexperimental/starlark-rust"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Fstarlark-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Fstarlark-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Fstarlark-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Fstarlark-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebook","download_url":"https://codeload.github.com/facebook/starlark-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251338963,"owners_count":21573645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T22:02:31.609Z","updated_at":"2025-12-12T12:47:47.286Z","avatar_url":"https://github.com/facebook.png","language":"Rust","funding_links":[],"categories":["Rust","Recently Updated","others","Libraries","Python Implemented in Other Languages"],"sub_categories":["[Dec 12, 2024](/content/2024/12/12/README.md)","Scripting"],"readme":"# Starlark in Rust\n\n[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat\u0026labelColor=005BBB)](https://opensource.fb.com/support-ukraine)\n[![GitHub link](https://img.shields.io/badge/GitHub-facebook%2Fstarlark--rust-blue.svg)](https://github.com/facebook/starlark-rust)\n[![crates.io version](https://img.shields.io/crates/v/starlark.svg)](https://crates.io/crates/starlark)\n[![docs.rs availability](https://img.shields.io/docsrs/starlark?label=docs.rs)](https://docs.rs/starlark/)\n[![Build status](https://img.shields.io/github/actions/workflow/status/facebook/starlark-rust/ci.yml?branch=main)](https://github.com/facebook/starlark-rust/actions)\n\nThere are several copies of this repo on GitHub,\n[facebook/starlark-rust](https://github.com/facebook/starlark-rust) is the\ncanonical one.\n\nThis project provides a Rust implementation of the\n[Starlark language](https://github.com/bazelbuild/starlark/blob/master/spec.md).\nStarlark (formerly codenamed Skylark) is a deterministic language inspired by\nPython3, used for configuration in the build systems\n[Bazel](https://bazel.build), [Buck](https://buck.build) and\n[Buck2](https://buck2.build), of which Buck2 depends on this library. This\nproject was originally developed\n[in this repo](https://github.com/google/starlark-rust), which contains a more\nextensive history.\n\nThere are at least three implementations of Starlark,\n[one in Java](https://github.com/bazelbuild/starlark),\n[one in Go](https://github.com/google/starlark-go), and this one in Rust. We\nmostly follow the Starlark standard. If you are interested in trying out Rust\nStarlark, you can clone this repo and run:\n\n```shell\n$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n$ cargo run\n$\u003e 1+2\n3\n```\n\nThis project was started by\n[Damien Martin-Guillerez](https://github.com/damienmg). Version 0.4.0 of this\nlibrary changed ownership [from Google](https://github.com/google/starlark-rust)\nto Facebook.\n\n## Learn More\n\nRead\n[this blog post](https://developers.facebook.com/blog/post/2021/04/08/rust-starlark-library/)\nfor an overview of the library, the reasons behind Starlark, and how it might\nfit in to your project. There is also a\n[2 minute introductory video](https://www.youtube.com/watch?v=3kHER3KIPj4).\n\n## Features\n\nThis project features:\n\n- Easy interoperability between Rust types and Starlark.\n- Rust-friendly types, so frozen values are `Send`/`Sync`, while non-frozen\n  values aren't.\n- [Garbage collected](docs/gc.md) values allocated on [a heap](docs/heaps.md).\n- Optional runtime-checked [types](docs/types.md).\n- A linter, to detect code issues in Starlark.\n- IDE integration in the form of\n  [LSP](https://microsoft.github.io/language-server-protocol/).\n- Extensive testing, including\n  [fuzz testing](https://github.com/google/oss-fuzz/tree/master/projects/starlark-rust).\n- [DAP](https://microsoft.github.io/debug-adapter-protocol/) support.\n\nThis project also has three non-goals:\n\n- We do _not_ aim for API stability between releases, preferring to iterate\n  quickly and refine the API as much as possible. But we do\n  [follow SemVer](https://doc.rust-lang.org/cargo/reference/semver.html).\n- We do _not_ aim for minimal dependencies, preferring to keep one package with\n  lots of power. But if some dependencies prove tricky, we might add feature\n  flags.\n\n## Components\n\nThere are six components:\n\n- `starlark_derive`, a proc-macro crate that defines the necessary macros for\n  Starlark. This library is a dependency of `starlark` the library, which\n  reexports all the relevant pieces, and should not be used directly.\n- `starlark_map`, a library with memory-efficient ordered/unordered maps/sets\n  and various other data structures useful in Starlark.\n- `starlark_syntax`, a library with the AST of Starlark and parsing functions.\n  Only use if you want to manipulate the AST directly.\n- `starlark` the main library, with evaluator, standard library, debugger\n  support and lots of other pieces. Projects wishing to embed Starlark in their\n  environment (with additional types, library functions and features) will make\n  use of this library. This library reexports the relevant pieces of\n  `starlark_derive`, `starlark_map` and most of `starlark_syntax`.\n- `starlark_lsp`, a library providing an\n  [LSP](https://microsoft.github.io/language-server-protocol/).\n- `starlark_bin` the binary, which provides interactive evaluation, IDE features\n  and linter, exposed through a command line. Useful if you want to use vanilla\n  Starlark (but if you do, consider Python3 instead) or as a test-bed for\n  experimenting. Most projects will end up implementing some of this\n  functionality themselves over the `starlark` and `starlark_lsp` libraries,\n  incorporating their specific extra types etc.\n\nIn particular the `starlark_bin` binary _can_ be effectively used as a linter.\nBut for the REPL, evaluator and IDE features the `starlark_bin` binary is only\naware of standard Starlark. Most Starlark embeddings supply extra functions and\ndata types to work with domain-specific concerns, and the lack of these bindings\nwill cause the REPL/evaluator to fail if they are used, and will give a subpar\nIDE experience. In most cases you should write your own binary depending on the\n`starlark` library, integrating your domain-specific pieces, and then using the\nbundled LSP functions to produce your own IDE/REPL/evaluator on top of those.\nYou should still be able to use the [VS Code extension](vscode/README.md).\n\n## Compatibility\n\nIn this section we outline where we don't comply with the\n[Starlark spec](https://github.com/bazelbuild/starlark/blob/master/spec.md).\n\n- We have plenty of extensions, e.g. type annotations, recursion, top-level\n  `for`.\n- We don't yet support later additions to Starlark, such as\n  [bytes](https://github.com/facebook/starlark-rust/issues/4).\n- In some cases creating circular data structures may lead to stack overflows.\n\n## Making a release\n\n1. Check the [GitHub Actions](https://github.com/facebook/starlark-rust/actions)\n   are green.\n2. Update `CHANGELOG.md` with the changes since the last release.\n   [This link](https://github.com/facebook/starlark-rust/compare/v0.4.0...main)\n   can help (update to compare against the last release).\n3. Update the version numbers of the two `Cargo.toml` files. Bump them by 0.0.1\n   if there are no incompatible changes, or 0.1.0 if there are. Bump the\n   dependency in `starlark` to point at the latest `starlark_derive` version.\n4. Copy the files `CHANGELOG.md`, `LICENSE` and `README.md` into each\n   subdirectory.\n5. Run `cargo publish --allow-dirty --dry-run`, then without the `--dry-run`, in\n   each of the component directories in the [order above](#components).\n6. Create a\n   [GitHub release](https://github.com/facebook/starlark-rust/releases/new) with\n   `v0.X.Y`, using the `starlark` version as the name.\n\n## License\n\nStarlark Rust is Apache License, Version 2.0 licensed, as found in the\n[LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebook%2Fstarlark-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebook%2Fstarlark-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebook%2Fstarlark-rust/lists"}