4 ms·
LuaJIT powers OpenResty[1] which powers my web framework Lapis[2] which powers my company itch.io[3]! (wow that's a mouthful) Anyway, it's a stack I'm really h
by leafo 9y ago
LuaJIT powers OpenResty[1] which powers my web framework Lapis[2] which powers my company itch.io[3]! (wow that's a mouthful)
Anyway, it's a stack I'm really happy to be using. Asynchronous IO without any code nesting. I wrote more about the benefits here: http://leafo.net/posts/itchio-and-coroutines.html http://leafo.net/posts/itchio-and-coroutines.html
[1] https://openresty.org/en/ https://openresty.org/en/
[2] http://leafo.net/lapis/ http://leafo.net/lapis/
[3] https://itch.io/ https://itch.io/
I also made web server infrastructure for the Lua package manager LuaRocks in the same stack: https://luarocks.org https://luarocks.org Source is on github: https://github.com/luarocks/luarocks-site https://github.com/luarocks/luarocks-site
Lua (especially with LuaJIT) is a great choice for web development.
- tiffanyh 9y agoLove Lapis. Question, since Lapis just transcode Moonscript into Lua to be used with OpenResty - why is Lapis so much slower than raw OpenResty/Lua? https://www.techempower.com/benchmarks/ https://www.techempower.com/benchmarks/
- killin_dan 9y agoBecause the lua code moonsript emits is inherently slower.
- tiffanyh 9y ago>> "inherently slower" What's "inherent" in moonscript that makes it slower?
- meowface 9y agoNot necessarily. Like CoffeeScript, it depends on what features you use.
- leafo 9y agoNot really, the code mapping is very straightforward and generally has no performance degradation. There are some language constructs that are implemented in a way that can create anonymous functions in order to convert statements into expressions. Future versions of MoonScript can do a better job to eliminate those. If you're aware when they're generated you can avoid them by writing as you might do in Lua. Realistically though, the performance difference is negligible in comparison to all the other things that might happen in your average web request.
- mtw 9y ago"slower" : I see Lapis is ahead of most frameworks, except platform or micro frameworks coded in C++, C or java. I think people should notice instead it's one of the fastest frameworks?
- tiffanyh 9y agoDid you compare Lapis to OpenResty in the benchmark above? In case you're not aware Lapis = Moonscript + OpenResty. And Moonsript is like Coffeescript but for Lua
- kraftman 9y agoLapis ~= Moonscript + OpenResty, Lapis = OpenResty + loads of framework stuff to make development easier, as Leafo explained. You can use Moonscript, but you can also use pure Lua.
- leafo 9y agoLapis is an entire web framework, OpenResty is a relatively low level interface to nginx. Lapis is an abstraction on top of OpenResty's Lua interface to make developing large web applications much more manageable. It has nothing to do with MoonScript. MoonScript generates speedy code.
- tiffanyh 9y agoAny plans to focus on increasing Lapis performance to be closer to raw OpenResty?
- i_feel_great 9y agoThanks for all your work Leaf. I use and recommend Lapis.
- ZenPsycho 9y agoyou also made moonscript and mustache.php. I imagine next you might rewrite nintendo from scratch in lua, and singlehandedly control the entire games industry.
- petre 9y agoIs there something like uwsgi for Lua?
- dom0 9y agohttp://uwsgi-docs.readthedocs.io/en/latest/Lua.html http://uwsgi-docs.readthedocs.io/en/latest/Lua.html