From: ···········@gmail.com
Subject: Is it possble to develop ipod touch application by using lisp which 	generate c libraries?
Date: 
Message-ID: <dc587bd8-bce9-48fa-8350-5bccd45fa9f3@g17g2000prg.googlegroups.com>
Hello.

Nowadays, I'm trying to make ipod touch toy applications. When I write
object-c or c code, I can't help miss macro and repl of lisp. As the
subject, I hope that I develop core functions with lisp (e.g. In game
application, they will be artificial intelligence parts), and make
them into c dynamic or static libraries. If cocoa touch application
can use shared libraries, object-c will be need in only GUI and
controller parts. Is it possible?

If it is possible, is there implementation which generate c libraries?
I looked around ECL, bigloo, and some other lisps, but I couldn't find
how to export symbols of var and function to external C and generate a
library rather than make standalone executable. Would you recommend a
good implementation(generate small binaries as possible, good
documentation...) for it?

Regards.
From: Juanjo
Subject: Re: Is it possble to develop ipod touch application by using lisp 	which generate c libraries?
Date: 
Message-ID: <a9d13c31-9da4-47ad-8b71-c9f87d7e2409@z28g2000prd.googlegroups.com>
On Nov 13, 2:22 pm, ············@gmail.com" <···········@gmail.com>
wrote:
> If it is possible, is there implementation which generate c libraries?
> I looked aroundECL, bigloo, and some other lisps, but I couldn't find
> how to export symbols of var and function to external C and generate a
> library rather than make standalone executable. Would you recommend a
> good implementation(generate small binaries as possible, good
> documentation...) for it?

I do not know about other implementations. The problem with generating
static code is that it can violate the semantics of the original lisp.
ECL allows you to export certain lisp functions with C names, and we
use this in the core library. That makes it easy to call functions
from the core Common Lisp language from C. See
  http://ecls.wiki.sourceforge.net/Simple+embedded+usage

For doing the same with your own functions you have to use an ECL
extension which is
  (proclaim '(si::c-export-fname my-package:my-function))
If this is invoked prior to compiling a file, then the compiler will
generate a public functino with the name and signature
  my_package_my_function(int narg, ...)
which takes a variable number of arguments.

However, as you said, the nice thing about lisp is the dynamic nature.
I would rather recommend using a more dynamical approach which is
based on directly funcalling the lisp symbols, not the C functions.
This way you can redefine the lisp functions whenever you want,
replacing them with interpreted versions, recompiling them, etc. You
will find some examples in the mailing list, as
  http://sourceforge.net/mailarchive/message.php?msg_id=1218537868469%40names.co.uk
but I should write up some more.

Juanjo