#configuration-language #config-parser #starlark #build #python #bazel #dialect

strangemeadowlark

Parser for the Starlark configuration language. Ported from https://github.com/google/starlark-go

6 releases

0.3.0 Sep 24, 2024
0.2.0 Sep 20, 2024
0.1.4 Jun 19, 2024
0.1.3 May 28, 2024
0.1.0 Nov 1, 2023

#870 in Development tools

Download history 6/week @ 2024-09-11 236/week @ 2024-09-18 81/week @ 2024-09-25 27/week @ 2024-10-02 8/week @ 2024-10-09

277 downloads per month

Apache-2.0

230KB
5.5K SLoC

This is a parser for the Starlark language, a dialect of Python intended for use as a configuration language (for example, to configure builds in bazel).

This implementation is a port of starlark-go to Rust.

Development

Test with Leak Sanitizer

This library uses bumpalo and an AST that is using references. This has the advantage of enabling pattern matching on ASTs. However as the docs bumpalo will not call Drop and that makes it very easy to leak memory.

RUSTFLAGS="-Z sanitizer=leak -Zexport-executable-symbols" cargo test --target x86_64-unknown-linux-gnu

The -Zexport-executable-symbols is a workaround.

The stacktraces will not be useful, unless they are symbolized. For that, you want llvm-symbolizer in your path.

Dependencies

~1MB
~19K SLoC