lua-users home
lua-l archive

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


It was thus said that the Great Michal Kottman once stated:
> On Fri, Jan 24, 2020, 3:28 PM connor horman <chorman64@gmail.com> wrote:
> 
> > I have a question. Would a socket api fall under this discussion for a
> > “Batteries” API. Having basic TCP and UDP (and maybe Bluetooth as well when
> > hardware supports it) would be rather useful, especially in making lua its
> > own standalone language.
> 
> I must be missing something obvious, but what is wrong with LuaSocket?

  The most glaring problem (in my opinion) is that LuaSocket only supports
select() for event driven IO, and select() is about the worst event driver
API out there.  And there's no way (that I can see, as I'm looking at the
source code right now) to use a different event API (like poll(), epoll() or
kqueue(), depending upon the underlying operating system).

  I also think the API could be cleaner.  I haven't looked too deeply into
the differences between LuaSocket, luaposix (which include a networking API)
and my own org.conman.net module, but from what I've seen, they are all
quite different in their apprach, with the first two being more C'ish, and
the latter being more Lua'ish (in my opinion).

  But before we get there, I want to discuss wrappers for select().  Soon.

  -spc