Skip to content
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

VRL AST for program reflection and visualization #6152

Closed
binarylogic opened this issue Jan 20, 2021 · 5 comments · Fixed by #6353
Closed

VRL AST for program reflection and visualization #6152

binarylogic opened this issue Jan 20, 2021 · 5 comments · Fixed by #6353
Labels
domain: vrl Anything related to the Vector Remap Language needs: approval Needs review & approval before work can begin. needs: requirements Needs a a list of requirements before work can be begin type: feature A value-adding code addition that introduce new functionality. vrl: parser Changes to VRL's syntax parser.

Comments

@binarylogic
Copy link
Contributor

This is something I wanted to put on the map so that we can factor it in as we continue to mature VRL. Especially with #6139 on the horizon.

It is very likely that we'll need a way to visualize a VRL program and build it with a GUI while still letting power users write VRL programs directly (think editor settings where you can switch between a GUI and the "source" JSON). In order to achieve this, I assume we'll need the ability to build an AST from a VRL script.

@binarylogic binarylogic added needs: approval Needs review & approval before work can begin. needs: requirements Needs a a list of requirements before work can be begin type: feature A value-adding code addition that introduce new functionality. domain: vrl Anything related to the Vector Remap Language labels Jan 20, 2021
@binarylogic
Copy link
Contributor Author

@JeanMertz should this have been closed?

@binarylogic binarylogic reopened this Feb 15, 2021
@JeanMertz
Copy link
Contributor

@binarylogic that depends on how far you want to go with this issue.

If the request is "the VRL parser should construct an AST", then yes, we have this now. If you want this AST to be ready to be used in a UI application, then I'm sure there's more work to do, but I don't know yet what that work involves.

@JeanMertz
Copy link
Contributor

To give a bit more context related to the issue description:

The VRL parser (and lexer) construct an AST, which it then feeds to the VRL compiler. This then turns the AST into a runable program.

In the case of the UI, the UI backend itself would generate the AST from direct GraphQL (or similar) queries, and let the compiler generate a valid program from that AST, so the UI would skip the lexing/parsing step, but use the AST types to construct a syntactically valid AST, which the compiler the semantically validates and uses to generate a runnable program.

All of this is there, but I'm sure once we have a second system that wants to construct a valid AST, we'll find some edge-cases that we need to tackle, as usually happens when you go from 1 to n users of a system.

@JeanMertz
Copy link
Contributor

I'm adding this to the backlog. @leebenson has been using the VRL AST a fair bit in his recent work, and while things work, they aren't that ergonomic.

I'll do a pass, see if there are any quick wins, and file issues for anything more involved.

@JeanMertz JeanMertz added the vrl: parser Changes to VRL's syntax parser. label Jun 7, 2022
@jszwedko
Copy link
Member

I'm going to close this since I don't think we have a concrete use-case at the moment. We can reopen if we find one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: vrl Anything related to the Vector Remap Language needs: approval Needs review & approval before work can begin. needs: requirements Needs a a list of requirements before work can be begin type: feature A value-adding code addition that introduce new functionality. vrl: parser Changes to VRL's syntax parser.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants