Luvit - Lua + UV + Jit = NodeJS re-implemented in Lua
lua-list.2524044.n2.nabble.com
lua-list.2524044.n2.nabble.com
Being able to use Lua's coroutines makes this quite interesting.
https://github.com/luvit/luvit/blob/master/examples/fs-corou...
OpenResty aims to run your server-side web app completely in the Nginx server, leveraging Nginx's event model to do non-blocking I/O not only with the HTTP clients, but also with remote backends like MySQL, PostgreSQL, Memcached, and Redis.
OpenResty seems to offer considerably lower app connect time compared with bare PHP in a FastCGI process manager for this "hello world" benchmark, in addition to some unbelievable throughout.
app GETs/sec throughput time to 1st byte, min/mean/max, milliseconds
Nginx + PHP/FPM 5,941 65KB/sec 0.72 / 1.63 / 6.75
Node 0.6.1 10,242 123KB/sec 0.08 / 0.92 / 14.24
OpenResty 27,924 335KB/sec 0.07 / 0.26 / 5.36
The default config for OpenResty does not even use LuaJIT.Data rounded for easier comparisons. See the gory details at http://openresty.org/#Benchmark
Thanks for the pointer!
No matter what I did, someone was going to load an existing blocking Lua library in and ruin it.
Can modern Lua virtual machines outperform V8?
Node depending on how you build it can take between 300 and 1000 ms of time and 10Mb of ram to just start up on the TouchPad. Luvit starts instantly and uses much less ram.
Larger programs are needed to see how the memory usage and performance scales with real work. That could be completely different.
I have used Lua at the command line on machines with 64GB of RAM to do ad hoc data mining that would have otherwise required several days of prep time for writing and debugging C before each run.
Using Lua, I could do things in hours that used to take overnight, or several days.
V8: node fib.js 6.40s user 0.02s system 99% cpu 6.423 total LuaJIT: ./luajit fib.lua 2.02s user 0.00s system 99% cpu 2.026 total
http://www.saltwaterc.eu/but-the-question-is-will-it-recur-p...
Good thing you added "compared" there, because I wouldn't call Node.js exactly "mature".
Never mind that I don't think this will make huge inroads. The big thing about NodeJS is that it's JavaScript, so that some frontend coder could use his already existing knowledge to quickly make a high-performing web service. And it came out with just enough hype to make it popular and create a community.
Lua doesn't really have those advantages. I do like the language a lot better than the mess that's JavaScript, but if a bunch of young coders are looking at a tool to fill a gap in their tech stack, it's not that likely that they'll look for Lua, unless they're all WoW extension programmers…
[1]: http://luarocks.org/
But in your average web shop, the chances of finding someone who has already worked with it is pretty low, whereas JavaScript itself runs at about 100%. And I firmly believe that this is the biggest reason for the popularity of NodeJS. Not the concept (cf. eventlet, EventMachine, POE etc.), but the fact that you've been offered a simple package where you don't have to learn anything really new.
Still, I'm grateful for an extended toolkit myself, and I'm looking forward to what people can do with coroutines and tables to make the programming experience more pleasant.
Where Lua diverges from Javascript:
* time has been taken to design it properly;
* backward compatibility has been broken more than once, to allow cleaning up design mistakes.
Also, it's not accurate to describe Lua as "designed by academinc": early developments have been driven by Petrobras' needs, more recent ones by the gaming industry and some prominent users such as Adobe's Photoshop Ligthroom. If you look at Lightroom team's rants about Lua 5.0 (http://www.lua.org/wshop05/Hamburg.pdf), then at the Lua 5.0 -> Lua 5.1 diff, you'll see that the latter is closely inspired by the former.