News for hackers. Stuff that matters.
Re:Luajit IO framework by fasteo on Thursday April 16, 2015 @11:44AM (#9388736)
Looks nice but, why would I use this instead of openresty ?

If I were looking for a stand-alone -no nginx- solution: Why would I use this instead of lev[1] or luvit[2] ?

[1] https://github.com/connectFree/lev/

[2] https://luvit.io/

Re:Luajit IO framework by vasquque on Thursday April 16, 2015 @02:20PM (#9389792)
Also check it:

[3] http://tarantool.org

Re:Luajit IO framework by malkia on Thursday April 16, 2015 @01:25PM (#9389375)
Recently I was made aware of one gotcha of using lua/luajit from multiple threads (with lua/luajit vm context per thread). And the problem is simply due to underlying libc thread safety which I (finally) understood why Python did with it's global (per all VM's in the process) lock.

Simply - things like getenv() are not-thread safe, and not guaranteed to be if there is setenv(). Not lua/luajit's fault, but might be seen as such (higher level language, supposed to guard folks from things like that).

It suddenly changed my thinking of VM's in general and their interaction with the standard library and the OS.

(One can say maybe every function from libc/msvcrt/etc. must be thread-safe, but then there are things like errno, or getenv() returning pointer).

Re:Luajit IO framework by yoklov on Thursday April 16, 2015 @01:28PM (#9389398)
errno is supposed to thread local, so it should be thread safe.
Re:Luajit IO framework by fcambus on Thursday April 16, 2015 @11:11AM (#9388465)
Announcement with more details can be found here : http://permalink.gmane.org/gmane.comp.lang.lua.general/11626...
Re:Luajit IO framework by ishtu on Thursday April 16, 2015 @03:57PM (#9390412)
Speaking of Lua, here is a Lua 5.1 source code guide from creator of LuaJIT [1]. Really nice open source codebase to learn from.

[1] http://www.reddit.com/comments/63hth/ask_reddit_which_oss_co...

Re:Luajit IO framework by tete on Thursday April 16, 2015 @04:14PM (#9390506)
That whole thread is really interesting. Lot's of amazing code bases to read.
Re:Luajit IO framework by sciurus on Thursday April 16, 2015 @11:39AM (#9388697)
At a time when nginx (at least the commercial version) is starting to emphasize nginx+javascript instead of nginx+lua, it's interesting to see a project try the opposite approach: take the nginx+lua combination and replace nginx with more lua.
Re:Luajit IO framework by espadrine on Thursday April 16, 2015 @11:58AM (#9388846)
The code features some extensive use of coroutines: https://github.com/kingluo/luajit.io/blob/master/lib/ljio/so...

I wonder how nice they are to use compared to threads, or even to node-style CPS.

Re:Luajit IO framework by adrusi on Thursday April 16, 2015 @12:06PM (#9388897)
It's basically the same as fibers in node. Also quite similar to goroutines running on just one cpu.
Re:Luajit IO framework by charliesome on Thursday April 16, 2015 @12:57PM (#9389206)
And also quite similar to kernel threads
Re:Luajit IO framework by felixgallo on Thursday April 16, 2015 @03:18PM (#9390186)
Not at all like kernel threads, which are preemptive and in kernel space.
Re:Luajit IO framework by ben_pr on Thursday April 16, 2015 @11:25AM (#9388592)
Very nice! I was looking for something like this a year or two ago, on my next lua/web project I'll try it out.
Re:Luajit IO framework by jhawk28 on Thursday April 16, 2015 @12:27PM (#9389024)
Site appears to be having performance issues. Never good PR for a new IO framework.
Re:Luajit IO framework by trynumber9 on Thursday April 16, 2015 @12:48PM (#9389142)
I wouldn't make too much of that. For all we know it could be running on a Raspberry Pi. It might be slow, but their public site is not the way to tell.