Idris2-boot/support
Edwin Brady bb246a072a Experimenting with a new FFI
Functions can be declared as %foreign with a list of calling
conventions, which a backend will work through until it finds one it can
understand. Currently implemented only in Chez backend. If this works
out, I'll implement it for Racket too, and remove the old primitive
functions.

There's a bit more boiler plate here than before, but it has the benefit
of being more extensible and portable between different back ends.

Some examples, pending proper documentation:

%foreign "C:puts,libc" "scheme:display"
putline : String -> PrimIO ()

%foreign "C:exp, libm.so.6, math.h"
fexp : Double -> Double

%foreign "C:initscr, ncurses_glue.so, ncurses.h"
prim_initscr : PrimIO ()
2019-09-02 17:10:48 +01:00
..
chez Experimenting with a new FFI 2019-09-02 17:10:48 +01:00
chicken Experimenting with a new FFI 2019-09-02 17:10:48 +01:00
racket Experimenting with a new FFI 2019-09-02 17:10:48 +01:00