[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is it possible that port node.js to Lua?
- From: Matthew Wild <mwild1@...>
- Date: Mon, 20 Sep 2010 16:22:35 +0100
On 20 September 2010 15:05, Scott Vokes <email@example.com> wrote:
> On Fri, Sep 17, 2010 at 12:03 AM, sagasw <firstname.lastname@example.org> wrote:
>> Now I have a question. Lua should be able to use in server too, and
>> could use libevent/libev as I know,
>> How about the performance that use Lua libevent compare with node.js?
>> Is it possible that port node.js to Lua? or just use node.js with Lua?
> I was working on a similar project (which I started before I was aware
> of node), but put it on the back burner for a while because I decided
> I'd rather just use Erlang for high-performance async servers and
> leave Lua to what it does best. :)
As much as I admire Erlang's pioneering into concurrent language design,
our Lua XMPP server beats an Erlang XMPP server in a number of
benchmarks - perhaps peoples' concepts of what "Lua does best" ought
to change :)
> I will probably get back to it sooner or later, though - I have a
> mostly-complete LPEG grammar for parsing HTML, a wrapper for libev
> (which includes almost all the watcher types, unlike the one on
> github), and separate backends for LuaSocket's select (doesn't scale
> well, but very portable and still quite fast) and the libev wrapper
> (not 100% complete yet). At the very least, I hope to get the libev
> wrapper posted soon.
More activity in this area is a good thing I think - I'm convinced Lua has
a lot of potential that isn't being used to the full.
That said I'm currently using libevent, though I'm pondering a libev backend
written in C that is more integrated with our server logic. Currently during our
event loop we are very frequently crossing from Lua<->C and I think there's
a lot we could gain from having it more one side or the other. Until LuaJIT's
FFI library is unveiled I think that means more of the low-level network code
in C for now.