Skip to content

Conversation

kyleconroy
Copy link
Collaborator

Currently, we generate code by using Go templates. While this approached has served us well, the code generators themselves are getting more complicated and difficult to understand. Templates aren't fully typed-checked. Functionality is split across Go code and template code.

I'm experimenting with a new approach, starting with Python. Instead of using templates, we'll build an AST and then print that AST to a file. I'm aiming to replicate the go/ast and go/printer packages. Lastly, the AST itself is defined via Protocol Buffers so that we can serialize the AST. This will be helpful in the future when we have plugin support.

@kyleconroy kyleconroy marked this pull request as ready for review December 11, 2021 03:00
@kyleconroy kyleconroy merged commit c7a0afe into main Dec 11, 2021
@kyleconroy kyleconroy deleted the kyle/python-writer branch December 11, 2021 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant