[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proof of concept dynamic FFI
From: |
Ludovic Courtès |
Subject: |
Re: Proof of concept dynamic FFI |
Date: |
Thu, 19 Jul 2007 10:51:20 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Hi,
Jon Wilson <address@hidden> writes:
> I've written a bit of code that lets you call any function from a
> dynamically loaded shared lib with any args. Well, actually, since it
> is just a proof of concept, it only lets you call functions that take
> zero or one args. The arg (if there is one) must be of type int. The
> return type can be either void or int.
Interesting. If I were to write this, I'd use GNU lightning to compile
natively the glue code instead of having to go through
`foreign-dispatch' (alternatively, there's libffi which can help a bit,
but it adds an indirection). You also need to make sure that building a
"foreign lambda" is fast since this would typically have to be done a
number of times at startup.
Thanks,
Ludovic.