The idea sounds neat, but I'm wary of concepts that aren't seeing real-world use. Node.js has momentum, Luvit has a little bit of momentum, this? In the web development community, I've never heard of the approach, which suggests using it might be more DIY than I'd like. Also the copyright date is 2004-2007. Abandoned?
There is the Kepler project http://www.keplerproject.org/ , which appears to be much like the commonJS project for javascript- with luasocket at its core. Kepler project lists http://slimfastclinic.com/ and http://www.bestjuicer.biz/ as websites that were built with lua. (though they may be out of date since the slimfastclinic.com says it's wordpress)
It might also be worth pointing out, just as a side note, that mod_lua for apache has existed for a while https://httpd.apache.org/docs/trunk/mod/mod_lua.html
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.
Luvit.io is specifically being used in our Host Monitoring Agent, which is open source and you can find here:
https://github.com/racker/virgo
This is used to collect all kinds of host metrics (CPU, disk, ram, custom scripts, mysql, etc) for the Cloud Monitoring Product.
- Lua (as a language) is for the most part better designed than JavaScript
Blogging about your experience using it would probably get you some decent traffic, too.
We're working on splitting this out into a reusable platform for writing lightweight host-based agents. Luvit works out fairly well for this - our monitoring agent runs in around 5mb resident memory, works on Windows (although we haven't released that yet) and is relatively easy to code on.
Shameless plug: if this sort of stuff interests you, hit me up, my email is in my profile.
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
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?
Lthread is in C, an environment where you control/manage your memory. Using slab allocators and high performance malloc like jemalloc, you can avoid allocating a lot of your variables on the stack and the stack copy will become minimal. In most of the production code I have running using lthread, stack copying is on the average of 300 bytes.
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.
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.
Lua has true multiple return value support. The overall usefulness of tuples in light of this feature is not clear.
Lua has first class support for functions and actually supports functional programming unlike Python which cripples many techniques and where Javascript has broken lexical scoping. Lua uses metamethod programming to allow you to build functionality like classes; Javascript has prototype inheritance which is different than Python's classical inheritance. Each is just different; not necessarily more or less structured.
Also, never confuse simple for being primitive. Lua IS incredibly simple and elegant. But all the simple things in the language work together elegantly to allow for amazingly sophisticated things.
EDIT: Also, I just remembered that Lua started as a stack-based VM, but moved to register-based at around version 5. So you could be thinking of the old Lua, too.
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".
[1] http://tarantool.org/dist/master/tarantool_user_guide.html#s...