-
Notifications
You must be signed in to change notification settings - Fork 7
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
Const-Decl #233
Comments
Upping the priority of this because such named declarations would be useful for declaring circuit parameters in guppy that are later linked in at the device. |
What information does an external Const store? It must contain the type, and it would seem that it must contain a name(or at least some unique id) if a linker is to merge it with it's definition. Linking is not the only way to eliminate an external Const though; it is also reasonable to elaborate an external Const into a "full" Const during a Hugr -> Hugr pass. My suspicion is that when linking one would not want to constrain the "CustomConst" instance of an external const, wanting the linker to be free to merge with an arbitrary Const of the correct type. I suppose then that a Hugr -> Hugr pass that replaces some external Const nodes with full Const nodes should use either types or metadata to drive this. |
Agreed - much like FuncDecl (and FuncDefn) that has
Right. So given we have the
In all cases the name has no semantics outside of linking, but is probably a useful thing to display/describe. |
It is not necessary to introduce a |
This would be for (a) Hugr use-cases that do not involve lowering to machine code or using a linker provided by a lower level, and/or (b) when the constant is provided by another Hugr, i.e. we are doing Hugr linking (#882) - not mutually exclusive with the previous. (Perhaps Hugr linking could be done by lowering the hugrs separately and then linking together using said lower-level linker, in Hugr use-cases which have one.)
This is an interesting question, and if it means that we don't need a ConstDecl, then great :). (That is, if |
I agree that linking needs to be more general than machine-level-linking. I think a One can also imagine defining a One can imagine a flavour of So linking passes define the semantics of these
You will need the
I don't think so. What I have proposed is that a(!) Hugr linker would interpret some |
i.e. we should allow declaring that there's an external Const (in another Hugr), without giving its value here.
This may mean we need to add a "name" to each Const, paralleling {Alias,Func}{Defn,Decl}. Or, perhaps we should revisit Func{Defn,Decl} having names, and say these are metadata as they affect only the linker.
The text was updated successfully, but these errors were encountered: