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, in R.call_packed, we give a type argument indicating the return type, but we do not indicate the argument types, which results in less informative type checking. I think there should be a mechanism to indicate the expected argument types for a call to a packed function.
I think an easy way to achieve this might be by adding some syntactic sugar for wrapping packed calls in an ordinary function call, like so:
We could inline the calls to the wrapper func at a later stage of compilation, but an advantage would be that there would be type checking for the argument expressions. Would the proposed syntactic sugar be feasible with the ir_module decorator? I think it should be. If we encourage users to include such signatures, it would also mean that calls to packed funcs would also look like ordinary function calls and they wouldn't need to use call_packed directly as much.
The text was updated successfully, but these errors were encountered:
Currently, in
R.call_packed
, we give a type argument indicating the return type, but we do not indicate the argument types, which results in less informative type checking. I think there should be a mechanism to indicate the expected argument types for a call to a packed function.I think an easy way to achieve this might be by adding some syntactic sugar for wrapping packed calls in an ordinary function call, like so:
R.wrap_packed
could desugar toWe could inline the calls to the wrapper func at a later stage of compilation, but an advantage would be that there would be type checking for the argument expressions. Would the proposed syntactic sugar be feasible with the
ir_module
decorator? I think it should be. If we encourage users to include such signatures, it would also mean that calls to packed funcs would also look like ordinary function calls and they wouldn't need to usecall_packed
directly as much.The text was updated successfully, but these errors were encountered: