Extension modules in 5.0? [FW: My wish list :)]

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

Extension modules in 5.0? [FW: My wish list :)]

Asko Kauppi-2
Could the authors (or other knowledgable sources) tell, what exactly would
be in 5.0 regarding dynamic extensions.

I've drafted one such extension module (dll/so that knows how to link itself
with Lua) but noticed that the lua_... functions need (of course!) to be
provided to the module by function pointers or otherwise (since they live on
the engine side of the dll/so barrier). I'll want to sleep over this before
using "brute force". If there's a more clever technique already on the way,
I'd like to know.

Thanks, - asko

--
Asko Kauppi
Flextronics Design Finland
Box 23, 39201 Kyröskoski, Finland
www.flextronics.com
PGP: 8348 2AE1 CEDC C81A 2255  2439 E4C8 7308 825E 32C3


> -----Original Message-----
> From:	Philippe Lhoste [SMTP:[hidden email]]
> Sent:	Wednesday, June 05, 2002 12:36 PM
> To:	Multiple recipients of list
> Subject:	Re:My wish list :)    [RE: How can we make lua better?]
> 
> > Here's my current wish-list ( and yes - I do try to keep it small! ):
> > 
> > 1) Extensions to stand-alone interpreter (without recompilation)
> > 
> > Standard way of loading in extensions (C/C++ dlls/so's intended to be
> used
> > >from Lua) without recompiling the stand-alone interpreter. This does
> not
> > need changes in the language itself, just the interpreter (+ some docs).
> > 
> > I'm currently working on this and will be posting some results here
> soon.
> > Thanks for all the hints I got about current loadlib's etc. a while
> back!!!
> > :)
> 
> AFAIK, Lua authors plan to integrate this to Lua 5.0.
> 
###########################################
This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.


Reply | Threaded
Open this post in threaded view
|

Re: Extension modules in 5.0? [FW: My wish list :)]

Luiz Henrique de Figueiredo
>Could the authors (or other knowledgable sources) tell, what exactly would
>be in 5.0 regarding dynamic extensions.

As far as I understand it, only a system-depende module for loading ddls
or shared objects is needed. My bare-bones loadlib does this for Unix and
Windows.

The protocol is simply that you know the name of a function in the ddl/so
that you have to call to do whatever is needed by your library, typically
register modules and functions in Lua.

>I've drafted one such extension module (dll/so that knows how to link itself
>with Lua) but noticed that the lua_... functions need (of course!) to be
>provided to the module by function pointers or otherwise (since they live on
>the engine side of the dll/so barrier).

As far as I know, simply having lualib as a dll/so and creating your module
with it is sufficient. There's a Unix example that does this in my
bare-bones loadlib tarball. I don't know how this would work in Windows,
but I recall that someone in the list tested my Windows module and it worked.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: Extension modules in 5.0? [FW: My wish list :)]

James Hearn
> As far as I know, simply having lualib as a dll/so and creating your
module
> with it is sufficient. There's a Unix example that does this in my
> bare-bones loadlib tarball. I don't know how this would work in Windows,
> but I recall that someone in the list tested my Windows module and it
worked.
> --lhf

I believe that was me. I ran it in both cygwin unix-compatibility mode and
straight win32 api mode. Worked flawlessly as long as the dll had lua.dll as
a dependency. Pretty cool stuff.

--James Hearn


Reply | Threaded
Open this post in threaded view
|

Re: Extension modules in 5.0? [FW: My wish list :)]

Björn De Meyer
I'd like to add to this discusssion that 
GNOME's Glib can portably load DLL's and 
Shared objects on all versions of Linux, 
Windows and HP-ux. Perhaps it's worth 
taking a gander at GLib's source code,
if you are not afraid of the GPL.



-- 
"No one knows true heroes, for they speak not of their greatness." -- 
Daniel Remar.
Björn De Meyer 
[hidden email]