4 ms·
Hello, I create lapis. I'm actually on the verge of releasing a new huge update. New features include: * first class lua support * built in support for a lua
by leafo 12y ago
Hello, I create lapis.
I'm actually on the verge of releasing a new huge update. New features include:
* first class lua support
* built in support for a lua templating language: https://github.com/leafo/etlua https://github.com/leafo/etlua
* a new postgres driver written in pure lua, should play nicer with luajit and and be available in more stages of nginx request cycle: https://github.com/leafo/pgmoon https://github.com/leafo/pgmoon
* lots of other smaller changes
All of this code is in master I just need to write all the documentation for it, sigh.
The biggest site I've created with lapis is itch.io: http://itch.io http://itch.io it's currently 43,209 lines of code (excluding libraries).
I run it on a really crappy 10 dollar a month vps, memory and cpu usage is tiny. I'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).
Another interesting lapis project is MoonRocks: http://rocks.moonscript.org/ http://rocks.moonscript.org/ it's a public lua module hosting site. It's opensource so you can check out what a developed lapis application looks like: https://github.com/leafo/moonrocks-site https://github.com/leafo/moonrocks-site
Thanks for checking out lapis!
- statenjason 12y agoThanks for the great documentation. It makes lapis stand out from just some weekend project.
- egeozcan 12y agoAwesome work! By the way, does pgmoon support arrays in postgres?
- leafo 12y agoI was just experimenting this today, select queries will be able to deserialize array results into lua tables automatically. Same for json values as well.
- pspeter3 12y agoWith all of these projects, I'm unsure of the relationship between Lua and MoonScript. Is it similar to the relationship between JavaScript and CoffeeScript? Also, does it matter which one is used ultimately?
- erikcw 12y agoYes, that is the relationship exactly. I've used both, but found MoonScript easier to get up and running with since we already use CoffeeScript extensively.
- legutierr 12y agoWe've started using openresty quite a bit in our shop. It's great for making certain things very fast. We looked at lapis, too, but it seems to be more than we need right now. Really, I'm afraid of doing too much complex development using a framework that doesn't provide you with an interactive debugger (like pdb). Is there something out there that I'm not aware of? The following comment by the creator of openresty seems to indicate that there is not: https://groups.google.com/forum/#!topic/openresty-en/VSIM8jYtXo0 https://groups.google.com/forum/#!topic/openresty-en/VSIM8jY...
- leafo 12y agoIt's not something I've experimented with yet. Lua comes with a very low level debugger: http://www.lua.org/manual/5.1/manual.html#pdf-debug.debug http://www.lua.org/manual/5.1/manual.html#pdf-debug.debug but I haven't tried using it inside of an nginx worker. Because the workers are forked you don't have immediate access to their standard in. For lapis I did build a server side console for running code in the same environment as the worker though, it might be useful: http://leafo.net/lapis/reference.html#lapis-console http://leafo.net/lapis/reference.html#lapis-console This project looks interesting, maybe it can be used: http://keplerproject.org/remdebug/ http://keplerproject.org/remdebug/
- paulclinger 12y agoI've been working on extending ZeroBrane Studio (the IDE mentioned in the google groups discussion you referenced) and its debugger and has posted instructions on how to debug OpenResty Lua scripts with it: http://notebook.kulchenko.com/zerobrane/debugging-openresty-nginx-lua-scripts-with-zerobrane-studio http://notebook.kulchenko.com/zerobrane/debugging-openresty-.... It's an early work, but you can set breakpoints, step through the code, run ngx commands remotely, inspect stack/variables, and do all the things you'd expect from an interactive debugger. I included a screenshot in the blog post. I'm interested in getting it to work with moonscript/lapis as well, but ran into issues with mapping source code information between moonscript and lua from the debugger.
- rlander 12y agoAre you sure you're just one person? Seriously, great stuff!