grin-compiler / grin

GRIN is a compiler back-end for lazy and strict functional languages with whole program optimization support.
https://grin-compiler.github.io/
1.03k stars 38 forks source link

Allow specifying the library an ffi function comes from #127

Closed Z-snails closed 2 years ago

Z-snails commented 3 years ago

The syntax is:

ffi pure|effectful
    <os> "library"

eg

ffi pure
    linux "libc.so.6"
    darwin "libc.dylib"

    strcpy :: T_String -> T_String -> T_Unit

The interpreter also supports this and now does all ffi function loading at the start, rather than when the function is called.

csabahruska commented 2 years ago

thanks!