[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] How to FFI?
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] How to FFI? |
Date: |
Tue, 3 Jul 2007 23:44:02 +0200 |
On 7/3/07, Robin Lee Powell <address@hidden> wrote:
I'm looking at using CDK (the widget library for ncurses) for a TUI
app (unless anyone else has any better TUI library suggestions? I'd
love to hear them).
My primary question is, how should I be doing FFI to make it nice
and simple for me?
http://www.call-with-current-continuation.org/eggs/lazy-ffi.html ?
http://chicken.wiki.br/dollar ? http://chicken.wiki.br/easyffi ?
http://chicken.wiki.br/Interface%20to%20external%20functions%20and%20variables
?
Well, it depends... ;-)
I don't know CDK, so my advice may be completely off the mark.
Easyffi is (naturally) the easiest way to wrap a large set of foreign
functionality, with the result that you'll get a C-like API in Scheme.
You can put higher-level layers on top of it, of course. SWIG is also
an alternative if you need something quick-and-dirty, but usually the
fine-tuning of the generated bindings can be tedious. You normally
will also not need a complete wrapper for CDK, if you plan to write
an application.
I personally prefer "dollar", but you'll get better type-checking with easyffi.
lazy-ffi is only useful for C libraries, and the direct access to libraries may
be fragile.
Do you need good error-checking? Do you want to access CDK in a low-level
manner, or would you prefer a complete CDK wrapper? Or are you just
interested in getting it to work quickly.
cheers,
felix
Re: [Chicken-users] How to FFI?, Robin Lee Powell, 2007/07/03