Skip to content

Conversation

@CalMacCQ
Copy link
Contributor

@CalMacCQ CalMacCQ commented Dec 22, 2025

  • corrected outdated information about the special status of the main function as an entrypoint for execution.
  • Tried to say that an entrypoint is just a distinguished node and that its children define a HUGR region.

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

@CalMacCQ CalMacCQ requested a review from a team as a code owner December 22, 2025 11:56
@CalMacCQ CalMacCQ requested a review from croyzor December 22, 2025 11:56
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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.
Copy link
Contributor

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

Copy link
Contributor Author

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add entrypoints to hugr spec

3 participants