Skip to content

Foreign function interface in Val #732

Answered by kyouko-taiga
kcvinker asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 0 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@cvinker
Comment options

@kyouko-taiga
Comment options

Answer selected by kcvinker
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants