Only downside with LuaAPR is you're back to writing Apache style servers, with an OS thread for every connection instead of using non-blocking sockets where possible (Didn't find any support for nonblocking sockets or a select\poll variant in the linked docs)<p>For my Lua server [1] I currently use the nixio library from the LuCI project and polling instead[2]<p>Although the downside of both nixio and Lua/APR library is the use of compiled C bindings to manually interact with the virtual machine.<p>The exciting development with LuaJIT is the high performance FFI that allows you to make system calls and create structs directly from in Lua[3], so I am currently considering switching from nixio to ljsyscall when I do a new version [4]<p>[1]<a href="https://github.com/davidhollander/ox" rel="nofollow">https://github.com/davidhollander/ox</a><p>[2]<a href="http://neopallium.github.com/nixio/" rel="nofollow">http://neopallium.github.com/nixio/</a><p>[3]<a href="http://luajit.org/ext_ffi_tutorial.html" rel="nofollow">http://luajit.org/ext_ffi_tutorial.html</a><p>[4]<a href="https://github.com/justincormack/ljsyscall" rel="nofollow">https://github.com/justincormack/ljsyscall</a>
Hi all, author of the Lua/APR binding here. If you have any questions or comments, feel free to post them here. I haven't gotten a lot of feedback on the binding yet so would love to hear what people think about it!
The correct title for this is "Lua/APR: Apache Portable Runtime binding for Lua". I'm pointing this out because I'm tired of seeing submission titles used to make a point instead of describing what's behind the link. This mightn't be a big deal for other people, but personally, I don't like having opinions[#] forced on me like this.<p>[#] The opinion here is that Lua needs a standard library. Maybe it does, maybe it doesn't, but I want to come to that conclusion myself, that's all.
This is very nice. It's good to see examples weaved into the site on how to use it. If anything, main libapr site could use something a bit better than the Doxygen output manual as reading the unit tests from the actual source is more approachable to me than their documentation.
That's a very useful library, and also great example of how easy it is to hook into C code from Lua.<p>Another one which I prefer personally because it's more comprehensive, is Steve Donovan's Penlight. If you have a background in Python you might enjoy using it:<p><a href="https://github.com/stevedonovan/Penlight" rel="nofollow">https://github.com/stevedonovan/Penlight</a>
Don't mean to hijack, but could I be referred to a good introduction to Lua? I keep hearing about it, but it's one of the few languages I know NOTHING about, and I have a free weekend!
Another interesting combination would be:<p><a href="https://github.com/justincormack/ljsyscall" rel="nofollow">https://github.com/justincormack/ljsyscall</a><p>this would work with LuaJIT: <a href="http://luajit.org/" rel="nofollow">http://luajit.org/</a><p>The FFI in LuaJIT is kind of brilliant. Check yourself.<p>EDIT: with FFI in LuaJIT you can jump very comfortably between the high-level Lua code and low-level native calls. It's almost addictive. And the code is running X times faster than the Lua baseline (X between single-digit and triple-digit values).