SWIG for Lua?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SWIG for Lua?

Norman Ramsey-3
Has anybody spotted SWIG, located at
http://www.cs.utah.edu/~beazley/SWIG
?

This tool reads C and C++ header files and emits bindings of Tcl, Perl,
Python, or Guile.  I thought it would be great to have Lua bindings as
well, and I'm wondering if anybody has looked at this and seen how hard
it might be?

Norman

Reply | Threaded
Open this post in threaded view
|

Re: SWIG for Lua?

Luiz Henrique de Figueiredo-2
>Has anybody spotted SWIG, located at
>http://www.cs.utah.edu/~beazley/SWIG
>?
>
>This tool reads C and C++ header files and emits bindings of Tcl, Perl,
>Python, or Guile.  I thought it would be great to have Lua bindings as
>well, and I'm wondering if anybody has looked at this and seen how hard
>it might be?

I don't know SWIG, but Lua bindings can be automatically created with toLua
(see Lua's home page or the FAQ.)
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: SWIG for Lua?

Norman Ramsey-3
 > I don't know SWIG, but Lua bindings can be automatically created with toLua
 > (see Lua's home page or the FAQ.)

I found toLua not useful for my needs.
In particular, it rolled over and died when faced with things like
  char *remove_def_marker(char *);
The SWIG tool seems more heavily engineered.

Norman

Reply | Threaded
Open this post in threaded view
|

Re: SWIG for Lua?

Waldemar Celes-2
>  > I don't know SWIG, but Lua bindings can be automatically created with toLua
>  > (see Lua's home page or the FAQ.)
> 
> I found toLua not useful for my needs.
> In particular, it rolled over and died when faced with things like
>   char *remove_def_marker(char *);

yes, this example fails with the current toLua.
toLua needs the parameter name.

> The SWIG tool seems more heavily engineered.

It certainly is. I started building toLua to attend my own
needs. As I thought it would be useful for other lua programmers,
I put it available.

toLua can be improved a lot. In fact, the new version 2.0,
that I will release with Lua 3.0, already offers several 
improvements.
I need feedback to know how it can be more useful for others.
For example, the possibility to avoid naming the parameter
seems to be quite easy to implement, but I hadn't needed it yet.

-- waldemar