[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Modern Lua binding library
- From: Shunsuke Shimizu <grafi@...>
- Date: Mon, 14 Mar 2016 15:48:54 +0900
Thanks.
I agree that auto-binding doesn't always make sense, and Lua C API
itself is clean and easy to use. But if you are working on C++, template
oriented libraries still can be helpfull, even if you don't need binding
to C++ class. Those provide a type-safer and more concise way to work
with Lua. Caring Lua's stack with the C API is often just tedious.
Anyway "the best/easier/faster Lua binding library" may be Lua C API,
and I also recommend it to beginners, while it is is not a "modern Lua
binding library" at all.
On 03/14/2016 03:28 PM, Sleepers Tang wrote:
> Hi,
> Lua is NOT C++ :D. These "AutoBinding Library or Helper Functions" only
> help if you already had a C++ project, and you wish to import Lua. In
> other words, if you were start to design your application, the Lua C API
> is just enough.
>
> 2016-03-14 13:57 GMT+08:00 Shunsuke Shimizu <grafi@grafi.jp
> <mailto:grafi@grafi.jp>>:
>
> Hi,
> Luwra [1] is another great library.
> Now it supports C++11 compliant compilers, though only C++14 had been
> supported once (shameless plugging: this C++11 support is my
> contribution.)
> In contrast to other libraries, with Luara, there is no need to
> duplicate method names to bind a C++ class to Lua; which is achieved by
> preprocessor macro magic. The following is an example (copied from [1]).
>
> // Register the metatable and constructor
> luwra::registerUserType<Point(double, double)>(
> lua,
>
> // Constructor name
> "Point",
>
> // Methods need to be declared here
> {
> LUWRA_MEMBER(Point, scale),
> LUWRA_MEMBER(Point, x),
> LUWRA_MEMBER(Point, y)
> },
>
> // Meta methods may be registered aswell
> {
> LUWRA_MEMBER(Point, __tostring)
> }
> );
>
> Even though, Luwra is boost-free and not very complex, especially when
> compared to luabind.
>
> Cheers,
> Shunsuke.
>
> [1] https://github.com/vapourismo/luwra
>
>
> On 03/14/2016 12:08 AM, Abhijit Nandy wrote:
> > There is luabind-deboostified which does not need to link with boost,
> > but uses templates, so longer compilation times.
> >
> > https://github.com/decimad/luabind-deboostified
> >
> > On Sun, Mar 13, 2016 at 8:22 PM, ThePhD <jm3689@columbia.edu <mailto:jm3689@columbia.edu>
> > <mailto:jm3689@columbia.edu <mailto:jm3689@columbia.edu>>> wrote:
> >
> > If you're looking for Binding C++ to Lua, I just finished Sol2[1], a
> > fast AND easy Lua <-> C++ binding library. We have documentation now
> > too, and examples. Feel free to take a look: I was going to make an
> > announcement here, but... well, this is a really timely post you've
> > made!
> >
> > [ 1 ] Reddit Post -
> > https://www.reddit.com/r/cpp/comments/4a8gy7/sol2_lua_c_binding_framework/
> >
> > On Sun, Mar 13, 2016 at 10:42 AM, Jose Marin
> > <jose_marin2@yahoo.com.br <mailto:jose_marin2@yahoo.com.br>
> <mailto:jose_marin2@yahoo.com.br <mailto:jose_marin2@yahoo.com.br>>>
> wrote:
> >
> > Hi!
> >
> >
> > What's the best/easier/faster Lua binding library, in your
> opinion?
> >
> > Thanks
> >
> >
> > Jose
> >
> >
> >
> >
>
>