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

Improve Code generation #105

Open
hasezoey opened this issue Oct 29, 2023 · 4 comments
Open

Improve Code generation #105

hasezoey opened this issue Oct 29, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@hasezoey
Copy link
Collaborator

Currently code generation is basically done by string concatenation, which is "good enough" but could be improved, current suggestions are:

@hasezoey hasezoey added the enhancement New feature or request label Oct 29, 2023
@Wulf
Copy link
Owner

Wulf commented Oct 30, 2023

Thanks for creating this -- I like the idea of using quote as it's closer to rust code, but I'm afraid it'll be harder for newcomers to come in and contribute as they'll have to understand quote's intricacies instead of just manipulating strings. That being said, it'll be one step closer to always producing correct code.

@Wulf
Copy link
Owner

Wulf commented Oct 30, 2023

At the same time, Tera is quite heavy for something as simple as doing codegen, so I'm with you there.

@hasezoey
Copy link
Collaborator Author

but I'm afraid it'll be harder for newcomers to come in and contribute as they'll have to understand quote's intricacies instead of just manipulating strings.

as a counter point: we are already using quote / syn (not its macros though) to parse the input file, so we have to already deal with a little quote stuff
and personally, i have not used quotes macros before, but its syntax looks really simple (if you know rust code)

@Wulf
Copy link
Owner

Wulf commented Nov 2, 2023

Although we're using quote/syn to parse rust code, it can be confusing for newcomers, especially the 'repetition' syntax. I don't mind giving it a shot though! We can revert if necessary :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants