-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write/serialize starlark #31
Comments
Currently that is not possible. We do have a However, what's the use of writing the Starlark module back to disk? Given there is no way to modify the module I would have thought there wasn't much benefit? We do imagine that one day Starlark will provide an explicit AST in Rust, and perhaps formatters etc, but haven't done all the work required for that yet. |
I'm looking for something that can generate Starlark code with some additional configuration options to also ingest it and combine it in an output file. I've been able to use black successfully in the past to make things human readable modules but rendering the module in the first place is by far the most complicated step.
I don't understand what you mean here. Can you expand on this?
Forgive my ignorance, |
The data type My general approach to writing some Starlark with configuration has been to use a standard textual interpolation approach - e.g. https://mustache.github.io/, which can generate Starlark as well as anything else. |
Yeah, this is where all the complexity comes from. It'd be nice if there was some common functionality for writing starlark (or some subsets of it). My primary use case is not writing arbitrary Starlark but instantiations of macros/functions. I don't have a need for writing anything defining conditionals or control-flow. |
Makes sense - I think that one day this Starlark library will expose the internals of You might be able to get away with using a Python parser/printer library, given that Starlark is a subset of Python. |
Sounds good, thanks
Are you familiar with one written in Rust? |
Not really, although a quick Google shows a few possible ones - although not really sure of their capabilities |
Is it possible to write or serialize starlark that's been parsed in using this module to a file?
The text was updated successfully, but these errors were encountered: