[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Embedding Lua in an application
- From: "Murray S. Kucherawy" <msk@...>
- Date: Sun, 10 Jan 2010 01:10:13 -0800
> -----Original Message-----
> From: firstname.lastname@example.org [mailto:lua-
> email@example.com] On Behalf Of Paul Beckingham
> Sent: Wednesday, December 30, 2009 8:47 AM
> To: firstname.lastname@example.org
> Subject: Embedding Lua in an application
> Option 2)
> The product passes a handle to the Lua script. The product then
> implements a series of functions that the Lua can call, to get more
> data, modify data.
> Pro: Minimal initial data transfer, marshaling on demand
> Con: ?
The con is the time it takes to implement all the object accessor/modifier functions that the Lua-called functions will need. In my experience though it ends up being a lot of copy-and-paste, and about half of that is just making sure your C functions exported to Lua have a proper argument set.
> I'm leaning towards option 2, but maybe there is a third I'm not aware
> of. Does anyone have any advice on "the Lua way" to do this?
I did what you're calling option 2. Works like a charm, and easily extensible if I need to add more functions on either side of the line.