glucoscsh


Glucoscsh is available at https://savannah.nongnu.org/projects/glucoscsh/. It is apparently a scheme-level ffi? for scsh.

From the Site

This project makes it ridiculously easy to call C functions from inside your Scsh code. Use one macro to describe the function and it will generate,compile,link, and load glue code as needed.

It makes use of an easily extensible type-code system for defining rules for translating types not natively supported. And also allows you to embed C code helper utilities directly into your scheme source.

The macros and functions are:

(c-function ...) declares function prototye information in Scheme.

(interfacing-rule ...) defines a set of rules for translating a c type into a scheme type.

(load-glue glue-dir) optionally lets you set the directory used as the cache for generated glue code.

(embedded-c ...) Let's you define a C function by providing it's body as a string.

(generate-glue) Optionally you may invoke this function to cause the glue code to be generated early to prevent unseemly delays at unexpected moments.

(generate-interface name) Convenient for making bindings for c-libraries, this function will append "-interface" to name and make a file that defines a scsh interface that exports all the functions you've declared with c-function.


category-software