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

codegen should use Expr rather than printing directly to strings #222

Open
ExpandingMan opened this issue Oct 20, 2022 · 0 comments
Open

Comments

@ExpandingMan
Copy link
Contributor

There are several reasons for this:

  • It moves the responsibility of string formatting to the Base Julia code generator. (e.g. breaking printing bugs such as was fixed for empty structs in a few small fixes for codegen #221 could not occur unless they are in Julia itself)
  • It can make it easier to use existing metaprogramming and formatting tools within ProtoBuf.jl.
  • It can make some fun shenanigans a little easier, such as evaling protobuf code directly into a module. You could do things like dynamically load new protobufs at run-time more easily, though I'm not necessarily claiming that something like this is ever a good idea.

This would require codegen to be completely rewritten, so it's not a very simple change, but it's good to keep in mind in case major changes are ever made to codegen.

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

No branches or pull requests

1 participant