TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Luajit IO framework

74 pointsby fcambusabout 10 years ago

8 comments

fasteoabout 10 years ago
Looks nice but, why would I use this instead of openresty ?<p>If I were looking for a stand-alone -no nginx- solution: Why would I use this instead of lev[1] or luvit[2] ?<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;connectFree&#x2F;lev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;connectFree&#x2F;lev&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;luvit.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;luvit.io&#x2F;</a>
评论 #9389792 未加载
malkiaabout 10 years ago
Recently I was made aware of one gotcha of using lua&#x2F;luajit from multiple threads (with lua&#x2F;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&#x27;s global (per all VM&#x27;s in the process) lock.<p>Simply - things like getenv() are not-thread safe, and not guaranteed to be if there is setenv(). Not lua&#x2F;luajit&#x27;s fault, but might be seen as such (higher level language, supposed to guard folks from things like that).<p>It suddenly changed my thinking of VM&#x27;s in general and their interaction with the standard library and the OS.<p>(One can say maybe every function from libc&#x2F;msvcrt&#x2F;etc. must be thread-safe, but then there are things like errno, or getenv() returning pointer).
评论 #9389398 未加载
fcambusabout 10 years ago
Announcement with more details can be found here : <a href="http:&#x2F;&#x2F;permalink.gmane.org&#x2F;gmane.comp.lang.lua.general&#x2F;116266" rel="nofollow">http:&#x2F;&#x2F;permalink.gmane.org&#x2F;gmane.comp.lang.lua.general&#x2F;11626...</a>
ishtuabout 10 years ago
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.<p>[1] <a href="http:&#x2F;&#x2F;www.reddit.com&#x2F;comments&#x2F;63hth&#x2F;ask_reddit_which_oss_codebases_out_there_are_so&#x2F;c02pxbp" rel="nofollow">http:&#x2F;&#x2F;www.reddit.com&#x2F;comments&#x2F;63hth&#x2F;ask_reddit_which_oss_co...</a>
评论 #9390506 未加载
sciurusabout 10 years ago
At a time when nginx (at least the commercial version) is starting to emphasize nginx+javascript instead of nginx+lua, it&#x27;s interesting to see a project try the opposite approach: take the nginx+lua combination and replace nginx with more lua.
espadrineabout 10 years ago
The code features some extensive use of coroutines: <a href="https:&#x2F;&#x2F;github.com&#x2F;kingluo&#x2F;luajit.io&#x2F;blob&#x2F;master&#x2F;lib&#x2F;ljio&#x2F;socket&#x2F;tcp.lua#L23" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kingluo&#x2F;luajit.io&#x2F;blob&#x2F;master&#x2F;lib&#x2F;ljio&#x2F;so...</a><p>I wonder how nice they are to use compared to threads, or even to node-style CPS.
评论 #9388897 未加载
ben_prabout 10 years ago
Very nice! I was looking for something like this a year or two ago, on my next lua&#x2F;web project I&#x27;ll try it out.
jhawk28about 10 years ago
Site appears to be having performance issues. Never good PR for a new IO framework.
评论 #9389142 未加载