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

Fully convert to a builder/IR for analyzing input #49

Open
4 tasks
sdboyer opened this issue May 5, 2022 · 0 comments
Open
4 tasks

Fully convert to a builder/IR for analyzing input #49

sdboyer opened this issue May 5, 2022 · 0 comments
Assignees
Labels
kind/docs Improvements or additions to documentation kind/feature New feature or request

Comments

@sdboyer
Copy link
Contributor

sdboyer commented May 5, 2022

#48 began a journey towards a builder/IR-style approach to analyzing CUE inputs as part of outputting them. This issue is for outlining the path to achieving that.

From where we are now, it seems to me that intermediate goals/milestones would be:

  • Replace the generator with the standalone buildContext introduced in Sorta-introduce new system for building output #48
  • Create individual builder/IR-types representing the different output targets, but having some shared interface
  • Refactor utility functions (e.g. tsprintField()) to avoid doing much analysis, moving as much of this as possible instead into the typed builders
  • Create a system of general rules for defining what describing and checking the permissibility of inputs

This last point would be especially valuable, as it would be a basis for explaining to the user what they are and are not allowed to input.

It's also possible that the introduction of a partial evaluator within the language facilities - basically, a new Eval() which can be told to preserve unchanged any nodes marked with a particular attribute - could obviate the need for a lot of the complexity in such an IR. If my thinking on this is correct, then at minimum, such a call could ensure simplification of the input cue.Value is a strictly smaller, better-defined superset of the graph of IR nodes that need to exist.

@sdboyer sdboyer added kind/docs Improvements or additions to documentation kind/feature New feature or request labels May 5, 2022
@sdboyer sdboyer self-assigned this May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/docs Improvements or additions to documentation kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant