[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using in C a function defined in guile
From: |
Taylan Ulrich Bayırlı/Kammer |
Subject: |
Re: Using in C a function defined in guile |
Date: |
Sun, 06 Sep 2015 16:54:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Vladimir Zhbanov <address@hidden> writes:
> Hi, guilers.
>
> After speaking with a man who doesn't like scheme and wants to make all
> his work in C, I wonder if there is an easy way to make the procedures
> wholly written in Guile available in C, besides any kind of 'eval'.
> Looking through the guile info I didn't found anything other.
You might want to look into the Dynamic FFI section of the Guile Info
manual: (info "(guile) Dynamic FFI")
Web version:
http://www.gnu.org/software/guile/manual/html_node/Dynamic-FFI.html
In summary, you can get pointers to Guile procedures via
'procedure->pointer' ('scm_procedure_to_pointer' in the C API).
Working with complicated struct types might be somewhat uncomfortable,
and I'm working on https://github.com/taylanub/scheme-bytestructures to
solve that, but I haven't worked on integrating it with the FFI much
yet. On the meanwhile there's (info "(guile) Foreign Structs").
Web:
http://www.gnu.org/software/guile/manual/html_node/Foreign-Structs.html
You might also want to go through the rest of the FFI chapter of the
manual to see if there's anything useful for you:
(info "(guile) Foreign Function Interface")
Web:
http://www.gnu.org/software/guile/manual/html_node/Foreign-Function-Interface.html
> Thanks,
> Vladimir
That's my limited knowledge.
Hope it helps,
Taylan