flix / book

The Flix Programming Book
Other
15 stars 23 forks source link

How to call C functions in Flix? #164

Open kcvinker opened 1 month ago

kcvinker commented 1 month ago

Hi Flix team, Seems like a nice language to try. Thanks for making this nice language. But how do I call C functions in Flix ? I mean I am interested to do some win32 api programming.

magnus-madsen commented 1 month ago

Flix runs on the JVM so interop with C will be annoying. You would have to go through Java JNI.

I believe the JVM will have better C interop in the future, but it is not yet there.

magnus-madsen commented 1 month ago

What do you want to program, specifically?

kcvinker commented 4 weeks ago

@magnus-madsen First of all, sorry for the delayed reply. I was not very well for the last 2 days.

What do you want to program, specifically?

I would like to create a gui library with windows api functions like CreateWindowExW and siblings.

magnus-madsen commented 4 weeks ago

I think this will be difficult, but you could take a look at: https://medium.com/@atrisarkar91/calling-c-from-java-the-easy-way-project-panama-ce68bff0c865

kcvinker commented 4 weeks ago

Thanks. Let me check that.