-
Notifications
You must be signed in to change notification settings - Fork 13
docs(spec): mention HUGR entrypoints #2775
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
base: main
Are you sure you want to change the base?
Conversation
| not be executable. | ||
| root Module node has a `FuncDefn` child node that is the designated entry point. This function must take no arguments as input. Modules that act as libraries need not be executable. | ||
|
|
||
| In Hugr, an entry point is just a distinguished node. This node could be a `FuncDefn` and its children would define the body of the function. This `FuncDefn` node, together with its children define a region of the HUGR graph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be something other than a FuncDefn node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't a dataflow block be an entrypoint to a region? I could well be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean idk ottomh, but that would be my question if I was reading the spec. It seems from the bit about executable hugrs that entrypoints have to be FuncDefn
| root Module node has a `FuncDefn` child node that is the designated entry point. This function must take no arguments as input. Modules that act as libraries need not be executable. | ||
|
|
||
| In Hugr, an entry point is just a distinguished node. This node could be a `FuncDefn` and its children would define the body of the function. This `FuncDefn` node, together with its children define a region of the HUGR graph. | ||
| When performing optimizations or rewrites on the HUGR it may be desirable in some cases to optimize certain regions and leave others unchanged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence doesn't really seem to fit in here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. I did think this sort of thing would be worth mentioning somewhere though. I'll try and see if I can make it fit better.
mainfunction as an entrypoint for execution.This is my first contribution to the spec so there may well be things I've missed out. Maybe entrypoints should have their own section? Not sure there's so much to say.
I've gone with "entry point" as opposed to "entrypoint" as this is consistent with what is already in the spec. However I'm quite used to seeing the later in function names, parameters, attributes etc.
Also not sure what I should say about dataflow entrypoints and the other varieties.
closes #2182