Skip to content

Comment on Lapis – A Lua, Moonscript Framework built on OpenRestyparent

Comments

We'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/VSIM8jY...

It'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 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

This project looks interesting, maybe it can be used: http://keplerproject.org/remdebug/

I'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-....

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.