Preferences

Yes, but.

OpenResty is a platform with multiple advantages. It's fast (Nginx), it's async via stackless coroutines (no function coloring), it's again fast (LuaJIT), it's relatively easy to deploy, it's feature-rich (all the Lua packages available), and it integrates well with some other tech like Redis (also Lua-enabled).

On the other hand, Lua is an extension language. It's not designed to support large codebases. You can, of course, with enough discipline, make it work - just as you can, with enough grit, make Perl, JavaScript, Ruby, or older Python work, but you're on your own then. You need to invent your own code organization scheme and adhere to it religiously. You need to reinvent half of the stdlib that Python provides out of the box. The reinventing process extends to the need to create a set of helpers to define classes and inheritance between them, which are only provided as powerful but inconvenient primitives (metatables) in Lua.

It's incredible how much you can do with just 100 sloc in OpenRESTY - it's absolutely amazing as a component of a larger system. However, writing lengthy, uninspiring, yet complicated business logic in Lua under OpenResty is not a good idea.


This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal