#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

#557 in Development tools

Download history 115/week @ 2024-06-17 9/week @ 2024-07-01 13/week @ 2024-07-29 150/week @ 2024-09-16 156/week @ 2024-09-23 41/week @ 2024-09-30

347 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