TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Lapis – A Lua, Moonscript Framework built on OpenResty

164 点作者 statenjason大约 11 年前

14 条评论

leafo大约 11 年前
Hello, I create lapis.<p>I&#x27;m actually on the verge of releasing a new huge update. New features include:<p>* first class lua support<p>* built in support for a lua templating language: <a href="https://github.com/leafo/etlua" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;leafo&#x2F;etlua</a><p>* a new postgres driver written in pure lua, should play nicer with luajit and and be available in more stages of nginx request cycle: <a href="https://github.com/leafo/pgmoon" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;leafo&#x2F;pgmoon</a><p>* lots of other smaller changes<p>All of this code is in master I just need to write all the documentation for it, <i>sigh</i>.<p>The biggest site I&#x27;ve created with lapis is itch.io: <a href="http://itch.io" rel="nofollow">http:&#x2F;&#x2F;itch.io</a> it&#x27;s currently 43,209 lines of code (excluding libraries).<p>I run it on a really crappy 10 dollar a month vps, memory and cpu usage is tiny. I&#x27;ve handled well over a million requests per day in the past with no issues. The app communicates with a lot of third party payment services over http in the server, because of the non-blocking nature of openresty throughput is not affected when these services are slow (eg. paypal).<p>Another interesting lapis project is MoonRocks: <a href="http://rocks.moonscript.org/" rel="nofollow">http:&#x2F;&#x2F;rocks.moonscript.org&#x2F;</a> it&#x27;s a public lua module hosting site. It&#x27;s opensource so you can check out what a developed lapis application looks like: <a href="https://github.com/leafo/moonrocks-site" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;leafo&#x2F;moonrocks-site</a><p>Thanks for checking out lapis!
评论 #7747103 未加载
评论 #7746570 未加载
评论 #7747720 未加载
评论 #7745464 未加载
评论 #7746516 未加载
fasteo大约 11 年前
As a sidenote, openresty (nginx+lua) is probably one of the most underrated technologies we have available nowadays. In my experience, every webapp can offload a ton of work(1) to openresty. The lua code is usually much simpler that the equivalent code in the app.<p>(1) think caching, auth&#x2F;acl, security filters, some of the stats, some of the logs, etc
评论 #7746326 未加载
erikcw大约 11 年前
We&#x27;ve been using it in production for about 6 months as the endpoint for an analytics system. We went from 5 medium EC2 app servers down to 1 micro instance in testing for our load at the time (we have an HA setup in production). Blazingly fast. Less than 100 LOC for the service.<p>The author of Lapis is also very responsive to PRs and bug reports.
评论 #7746351 未加载
xfalcox大约 11 年前
I just need to say that OpenResty is great, and the mailing list is awesome.<p>After a topic here in HN saying about doing auth in lua+nginx, we successfully migrated our auth from inside the applications (all java) and now it&#x27;s a 100 LOC of Lua, easy and decoupled from the application.
评论 #7745186 未加载
评论 #7748553 未加载
xt大约 11 年前
If someone is eager to try Lapis I have a Dockerfile available here:<p><a href="https://github.com/torhve/lapis-docker" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;torhve&#x2F;lapis-docker</a><p>it includes a readme for getting started with Openresty in general.
评论 #7748256 未加载
avargas大约 11 年前
Lua within Ngnix is amazingly fast. I developed a custom solution for a client last year that basically did bot detection (similar to CloudFlare). It&#x27;s amazing what you can do within nginx without touching an external fastcgi server or proxy.
thinxer大约 11 年前
I don&#x27;t understand. How is Lua&#x27;s performance compared to NodeJS, or compiled languages such as Java or Go ? Does it make sense to stuck everything into a (used to be ) reverse proxy server ?
评论 #7748356 未加载
networked大约 11 年前
Is Unicode ever a problem when you do real-life web development in Lua? Lapis looks appealing otherwise but the lack of a built-in Unicode string type in Lua makes me somewhat wary.
评论 #7745214 未加载
评论 #7745181 未加载
izietto大约 11 年前
This is great! I&#x27;m curious about CPU&#x2F;RAM usage too
评论 #7745284 未加载
评论 #7747644 未加载
dubcanada大约 11 年前
I&#x27;ve been experimenting with this with a fairly large website. The lack of MySQL support is the only thing keeping me away.
评论 #7749913 未加载
reinhardt大约 11 年前
Performance aside, does anyone have experience with how Lapis&#x2F;OpenResty compare to, say, Django or Rails in terms of stability, included batteries, 3rd party libraries and overall developer productivity and production readiness? I guess this overlaps a lot with the respective question for lua vs python&#x2F;ruby ecosystems.
评论 #7747491 未加载
评论 #7745869 未加载
pspeter3大约 11 年前
I was just looking at this yesterday. It seems awesome. My one question is how you do forking dependency graphs since everything is non blocking but looks blocking. Eg. I have takes A, B and C. C depends on A and B so I want to do A and B concurrently but then wait on them for C.
评论 #7745203 未加载
评论 #7745002 未加载
martijn_himself大约 11 年前
Absolutely amazing work. I have been meaning to give this a go for ages.
frik大约 11 年前
Interesting, and I found it in the techempower benchmark too:<p><a href="http://www.techempower.com/benchmarks/#section=data-r9&amp;hw=i7&amp;test=fortune" rel="nofollow">http:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r9&amp;hw=i7...</a>
评论 #7746818 未加载