-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Foreign pointer primitive type #131
Comments
What operations do you need? |
Idiomatic C never passes a struct by value in one of the arguments, only by pointer to avoid copies. |
@csabahruska Passing too and from FFI functions. My current use case is arbitrary precision integers in the idris2-grin backend. @luc-tielen unfortunately not all C libraries are idiomatic. |
Would foreign pointers interact with the garbage collector? |
In the long term, yes (eg for |
This is needed for various features of many functional languages, eg arbitrary precision integers and arrays implemented in FFI.
If there's only support for foreign pointers, that makes code-gen easier as the layout is consistent, however having structs would be useful, eg for interfacing with pass-by-value C libraries.
The text was updated successfully, but these errors were encountered: