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
We don't currently have a notion of "public" functions.
In the spec, "main" is defined as the "entry point", but surely there are cases where the HUGR is a library and some subset of the top-level functions are "public".
The notion of publicity is important at least for:
removing unused functions (a public function and all it's transitive callees should not be deleted)
dataflow analysis (for a public function we cannot assume we know all callsites)
Maybe a FuncDecl is public, or maybe it is a private alias to a public function. It's not clear to me when the publicity of a FuncDecl would matter. (I suppose when deleting unused functions?
LLVM has the concept of "linkage" which contains this binary notion of publicity. Linkage has lots of details allowing it to model weak symbols etc.
We could:
add a public: bool field to FuncDefn,
establish a convention where hugr.public: true metadata means public.
leave it unspecified, anything that cares should take a set of nodes identifying all public funcs.
The text was updated successfully, but these errors were encountered:
We don't currently have a notion of "public" functions.
In the spec, "main" is defined as the "entry point", but surely there are cases where the HUGR is a library and some subset of the top-level functions are "public".
The notion of publicity is important at least for:
Maybe a
FuncDecl
is public, or maybe it is a private alias to a public function. It's not clear to me when the publicity of a FuncDecl would matter. (I suppose when deleting unused functions?LLVM has the concept of "linkage" which contains this binary notion of publicity. Linkage has lots of details allowing it to model weak symbols etc.
We could:
public: bool
field toFuncDefn
,hugr.public: true
metadata means public.The text was updated successfully, but these errors were encountered: