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
{{ message }}
This repository has been archived by the owner on May 22, 2023. It is now read-only.
Currently, there is no way to indicate which packed funcs are safe to call inside a dataflow block, since any of them can potentially have side effects. It would be useful to have a system of annotations to indicate properties about functions that might be relevant to the compiler. For example, we could have a "dataflow" property that indicates that the function is pure and does not have control flow and "pure" to indicate simply a pure function.
Here are some ways we could achieve this:
Add annotations to the type signature. These properties could be checked during type checking. We might indicate them as a decorator, like so:
@R.function@R.dataflowdeff(...):
# error during type checking if there is a recursive call, an if-else expression, or a call to a function or packed func that is not marked as dataflow
...
(for calls to call_packed, we could take an annotation argument). The type checker could potentially infer dataflow or purity properties as well.
Include "dataflow" or "pure" as an attribute at call sites. This would be easier in terms of type checking but might be harder to automatically enforce and would require attributes to be indicated in many places.
Any other thoughts on how we might add a mechanism for indicating what is safe to call inside a dataflow block?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently, there is no way to indicate which packed funcs are safe to call inside a dataflow block, since any of them can potentially have side effects. It would be useful to have a system of annotations to indicate properties about functions that might be relevant to the compiler. For example, we could have a "dataflow" property that indicates that the function is pure and does not have control flow and "pure" to indicate simply a pure function.
Here are some ways we could achieve this:
(for calls to
call_packed
, we could take an annotation argument). The type checker could potentially infer dataflow or purity properties as well.Any other thoughts on how we might add a mechanism for indicating what is safe to call inside a dataflow block?
The text was updated successfully, but these errors were encountered: