[Ecls-list] Tighter c/c++ integration, toplevel inline c/c++ code ???
Seth Burleigh
seth at tewebs.com
Mon May 3 11:57:29 UTC 2010
Woops, i even typed in incorrect code, but the idea is correct. Also, if
it were possible to do this, it would also have to be possible to call
the lisp functions by creating something which maps the lisp function
calls in the c/c++ code to the obfuscated names.
On Mon, 2010-05-03 at 13:39 +0200, Juan Jose Garcia-Ripoll wrote:
> On Mon, May 3, 2010 at 5:04 AM, Seth Burleigh <seth at tewebs.com> wrote:
> (1) A C/C++ program wants to call a lisp function with its own
> data
> structures:
>
>
> These are called "callbacks". All foreign function interfaces for Lisp
> support them, including CFFI and ECL. However ECL currently gives them
> rather "obscure" names and does not export them.
>
>
>
> (2) Intertwined development/tight integration: if an algorithm
> needs to
> be implemented in c/c++ for efficiency, it is much more
> convenient to
> define it in the lisp code than create another c/c++ file
>
>
> CLINES allows you to embed arbitrary C/C++ code in the file. The only
> thing you will not get is that the code is produced in an order which
> is consistent with the execution of Common Lisp forms. In other words,
> if you insert a CLINES statement in a function it will be moved out of
> it to the beginning of the generated C file.
>
>
> Of course, the code would also have to be able to call lisp
> functions
> defined in the current package in order for this to be
> effective (or to
> be able to call lisp functions which have been designated as
> 'callbackable', like in gambit-c scheme) [...]
>
>
> Se above.
>
>
> (3) Programs built in c++ already have a class hierarchy. If
> you want to
> create a subclass which the c++ program can use, you need to
> be able to
> directly input toplevel code (i.e. define a class, methods,
> etc).
>
>
> CLINES
> http://ecls.sourceforge.net/new-manual/re13.html
>
>
> I insist that this is mostly used for headers, but it need not be.
>
>
> Juanjo
>
>
> --
> Instituto de Física Fundamental, CSIC
> c/ Serrano, 113b, Madrid 28006 (Spain)
> http://tream.dreamhosters.com
More information about the ecl-devel
mailing list