lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I am not sure I understand what is it that you dislike. Lua "standard"
> does not come with support for sockets. You have to do something to get
> that support loaded and available. This can be done with the "require"
> business, or you can build your own interpreter and "preinstall"
> everything so that scripts can just use it as if someone else had called
> "require".

I posted some code the other day (search for "lstatic") which showed
how one can easily do a static build of an extended Lua interpreter
based on 5.0.2 + compat-5.1 + lsocket + socket.lua (all compiled into 
a single binary). 

Then when you write code which does 

 require("socket")

and that code itself says

 require("lsocket")

the require()s simply succeed and...bingo...you have socketing built in.
(But your code will work in Lua builds which have it dynamically 
loadable...how good is that!)

Someone else (forget who) showed how to take my bin2c-based lstatic and
convert it to use Windows resources on Win32, to save run-time memory.

Nice.