chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] game C++ doability


From: felix winkelmann
Subject: Re: [Chicken-users] game C++ doability
Date: Tue, 14 Feb 2006 07:33:16 +0100

On 2/13/06, Brandon J. Van Every <address@hidden> wrote:
> Initially I ignored a lot of C++ game projects on Sourceforge because I
> do not have a sense of Chicken's C++ capabilities.  Let's say one has a
> very big, very complicated game project written mostly in C++.  Is
> interfacing Chicken to such a project going to be readily doable, or is
> it going to be painful?  Two different scenarios:
>
> - Chicken by itself
> - Chicken using SWIG
>
> I'm really leery of the SWIG route.  My previous experience with SWIG is
> its output is quite bloated, unreadable, slow, and many developers hate
> it.  I don't know about Chicken's SWIG output specifically.  SWIG was
> originally designed for interpreted languages where performance isn't
> much of an issue, and it shows.
>

I don't think that SWIGs output is *that* bloated, really. What it does is
handle a lot of corner cases and allows one to bind to libs that use
C++ features extensively. If you can't wrap it with SWIG, then things
are going to be hard.
The output looks pretty ugly, but shouldn't be slower than using the
Chicken ffi directly. John Lenz (and Jonah Beckford) did a splendid
job by using the core machinery (CPS functions) directly, so a SWIG
wrapper for a function is not slower than a Chicken primitive.
Things are different for TinyCLOS wrappers, of course, as TinyCLOS
is pretty slow. But that is only an option - SWIG can also generate
procedural wrappers.
In short: for wrapping complex C++ stuff there is nothing that can
remotely compare with SWIG.
For simple things, Chicken's ffi (or writing C code that wraps the C++)
is ok, or when you have really stringent performance requirements.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]