Foreign function interface in Val #732
-
Hi all, |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 4 replies
-
Hello @kcvinker Thanks for your interest! We are only at a very early stage of the design for the FFI support. It is likely that we'll be able to declare and use FFIs as below in the source code and implement the necessary infrastructure to help the linker do its magic: @ffi(c, CreateWindowEx)
fun create_window_ex(...) -> Handle
public fun main() {
let handle = create_window_ex(...)
} I don't see any specific reason why we couldn't support things like 16bit wide character strings, but I guess it might require some handwritten glue code to design all the types used by something like Windows API. |
Beta Was this translation helpful? Give feedback.
-
@kyouko-taiga, Thank you for the explanation. And sorry for the delayed reply. Truly, this is the most easiest FFI declaration i have ever seen. I hope to learn Val soon |
Beta Was this translation helpful? Give feedback.
Hello @kcvinker
Thanks for your interest!
We are only at a very early stage of the design for the FFI support. It is likely that we'll be able to declare and use FFIs as below in the source code and implement the necessary infrastructure to help the linker do its magic:
I don't see any specific reason why we couldn't support things like 16bit wide character strings, but I guess it might require some handwritten glue code to design all the types used by something like Windows API.