Live data from Hacker News

Luvit – Asynchronous I/O for Lua

luvit.io

1–10 of 37 posts

Re: Luvit – Asynchronous I/O for Lua

#3
post #2

For those interested, lthread now supports AIO. It's still in dev branch, but I'll be merging it soon: http://webmon.com/blog/2013/02/19/lthread-now-supports-userl... https://github.com/halayli/lthread/blob/dev/src/lthread_io.c

lthread is very interesting. Thanks for the links!

Re: Luvit – Asynchronous I/O for Lua

#4
Not sure exactly how duped this is for HN... For those that don't know.. Lua is a scripting language, perhaps a bit more structured than it's more popular counterparts (JavaScript and Python), having very good performance characteristics. It's very popular in terms of Game development.

Luvit is essentially a lua interpreter with bindings to libuv (the same core IO library used in NodeJS). And could mainly be considered an alternative to NodeJS, which it most closely resembles.

Some, who don't like JS syntax may wish to consider Luvit, as it will perform close to, and sometimes better than NodeJS, with some similar gotchas.

Re: Luvit – Asynchronous I/O for Lua

#5
I've been using this lately on a personal project.

For those who don't know, this is basically a clone of the Node.js API in the Lua language (using the LuaJIT compiler). This is interesting because:

- LuaJIT is often faster than V8 and uses less memory

- LuaJIT has a built in C FFI and supports C datatypes for working with low level libraries (or even writing low level code in Lua)

- Lua has coroutines

I think this is already being used in production at Rackspace, mainly because of the lower memory usage.

Re: Luvit – Asynchronous I/O for Lua

#6
post #2

For those interested, lthread now supports AIO. It's still in dev branch, but I'll be merging it soon: http://webmon.com/blog/2013/02/19/lthread-now-supports-userl... https://github.com/halayli/lthread/blob/dev/src/lthread_io.c

digressing from luvit...

how does the stack copying technique (as used in lthread) compare to segmented stacks (as used in go)? The swap technique is very simple but I would assume that the stack copy shows up in profiles and is significantly slower than the segmented stack technique... Are there any benchmarks?

Re: Luvit – Asynchronous I/O for Lua

#7
For a while, I thought that luvit is completely undocumented. But then, I found out that one just goes to nodejs.org ...

So far, I mostly like it. Recently, I used it to build a PoC for an in-house testing tool for embedded devices and decided to slap a web interface onto it for fun (just like Twisted provokes you to add an NNTP and an SSH interface just for fun).

What I'm a bit unhappy with is the decision to be incompatible with the rest of the Lua world. From what I read in the mailing list, it's not just "sorry, that rock uses blocking file IO" but rather "Lua is Lua, and luvit is luvit".

Re: Luvit – Asynchronous I/O for Lua

#10
post #4

Not sure exactly how duped this is for HN... For those that don't know.. Lua is a scripting language, perhaps a bit more structured than it's more popular counterparts (JavaScript and Python), having very good performance characteristics. It's very popular in terms of Game development. Luvit is essentially a lua interpreter with bindings to libuv (the same core IO library used in NodeJS). And could mainly be consider…

> Lua is a scripting language, perhaps a bit more structured than it's more popular counterparts (JavaScript and Python)

I wouldn't say it has more structure than Python or JavaScript. Lua has only these types: number, string, boolean, table, function, nil, userdata and thread. Table acts as a hybrid between list and map, just like Array/Object in JavaScript. And users rarely are exposed directly to userdata/thread, that's more something you'd use when you write a library (use userdata to emulate classes etc). The Lua VM is also much simpler than the other two, it's a simple stack machine. There are no tuples like in python, no first-class support for classes.

Post reply on HN