-
Notifications
You must be signed in to change notification settings - Fork 60
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
Support for macros to reduce code duplication #356
Comments
I agree that macros would be quite useful in egglog. However, text-based macros are usually a terrible source of bugs. |
Hmm, I haven't tried Racket but it looks like a good fit. I think there is also a lot of potential in making Egglog more powerful on its own, but maybe this is not important if Egglog is aimed to be a target for code generation. |
Yeah, I think egglog as a target vs a language is up in the air right now |
We have implemented a macro interface in Rust. See https://github.com/egraphs-good/egglog-experimental/blob/main/src/sugar/for.rs for an example. Maybe we can implement your |
Hi, currently when using egglog there is some code duplication in my programs. For example:
If I am not missing something, it is currently not possible to parameterise commands/expressions. The only workaround I see is to write a program in Rust/Python which calls into Egglog.
Would it be possible to add basic support for macros that rely on textual substitution in egglog? This would allow reusing commands such as:
The text was updated successfully, but these errors were encountered: