Create C functions for embedded Racket CS

40 views
Skip to first unread message

dotoscat

unread,
Sep 2, 2020, 5:05:12 PM9/2/20
to Racket Users
There are a function such scheme_make_prim_w_arity
for the CS version? The idea is to use Racket
as a scripting language for a C program.

Thank you.

Hendrik Boom

unread,
Sep 2, 2020, 5:38:18 PM9/2/20
to Racket Users
On Wed, Sep 02, 2020 at 02:05:11PM -0700, dotoscat wrote:
> There are a function such scheme_make_prim_w_arity
> <https://docs.racket-lang.org/inside/Procedures.html#%28cpp._scheme_make_prim_w_arity%29>
> for the CS version?

> The idea is to use Racket
> as a scripting language for a C program.

That's what guile was designed for.
How does Racket measure up as a scripting language for C?

-- hendrik

Matthew Flatt

unread,
Sep 3, 2020, 9:35:06 AM9/3/20
to dotoscat, Racket Users
At Wed, 2 Sep 2020 14:05:11 -0700 (PDT), dotoscat wrote:
> There are a function such scheme_make_prim_w_arity
> <https://docs.racket-lang.org/inside/Procedures.html#%28cpp._scheme_make_prim_w
> _arity%29>
> for the CS version? The idea is to use Racket
> as a scripting language for a C program.

There's currently no support in the C API of Racket CS for constructing
a Scheme procedure that calls a C procedure. You have to work from the
Scheme side using `foreign-procedure` to create a wrapper for a C
function.


Matthew
Reply all
Reply to author
Forward
0 new messages