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

Tracking issue: refactor CodegenExtension #107

Closed
6 tasks done
doug-q opened this issue Sep 18, 2024 · 0 comments
Closed
6 tasks done

Tracking issue: refactor CodegenExtension #107

doug-q opened this issue Sep 18, 2024 · 0 comments

Comments

@doug-q
Copy link
Collaborator

doug-q commented Sep 18, 2024

The current interface codegen extensions has a few problems:

  • Only one codegen extension per HUGR extension. This is an annoying and unnecessary limitation
  • It has an unnecessary lifetime paramater `'c``. Everything should work with a context of arbitrary lifetime.
  • Handlers for custom types depend on the H parameter, when they have no reason to.

I suggest changing to a builder pattern, where adding a codegen extension amounts to passing callbacks for ops, types, constants that the extension handlers, finishing by providing glorified HashMaps for each of op, type, constants.

TODO sketch example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant