You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The current interface codegen extensions has a few problems:
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
'c
lifetime parameter toCodegenExtension
#111trait EmitOp
#112trait CodegenExtension
with a builder #115TypeMap
, use it to compute llvm types, put it inTypeConverter
. Move theiw_context
intoTypingSession
, removeH
generic parameter fromTypingSession
. #116crate::extensions
fromcrate::custom
. #121The text was updated successfully, but these errors were encountered: