Lua vs PHP/Python/JSP/etc

In brief:

  • Lua gives you a smaller, simpler system that you can understand in its entirety, but it is in a much smaller ecosystem; Kepler is all you get, and you will probably have to build some of your own stuff. I find this easy and fun (I make heavy use of the Lua bindings to the Expat parser and the Lua Object Model, which are part of Kepler), but others may prefer to use what everyone else is using.

  • PHP started out as more of a macro processor than a language, and although it has improved over the years, when people say "X has really gotten a lot better", I tend to be wary of X. I find PHP offputting, but there is a huge ecosystem for web development.

  • Python is a nice language but much bigger than Lua, and in the throes of a major revision (transition from 2.5 to 3.x). Again you get a big ecosystem; the problem I have with Python is that the language and system are too big for any one person to understand all of. I don't like to be in this situation if I don't have to.

  • Ruby is a bit of a cleaner language design, and the large Rails ecosystem is a winner. Ruby is less complex than Python but more complex than Lua. Rails is a bit of a beast.

It comes down to this question:

  • Would you rather understand all the software in your system, even if you have to build a lot of things yourself?

  • Or would you rather have a lot of things already built for you, even if you wind up not understanding exactly how every piece works?

If you want to understand everything, Lua is your game. If you want a lot of stuff already built for you, I can't advise you how to pick among PHP/Python/JSP/Rails and so on.

More on Lua and Python at Which language is better to use, Lua or Python?


Using Lua for web development is pretty rare...you could do it, but it will be a lot more time consuming than using a language that has matured as a web developing language (PHP) or has good web related libraries (python/ruby/etc.) If you do go with Lua, this means you may end up "recreating the wheel" a lot for what may be easily available in mature web languages.

The better question is, what does Lua offer that you need which is not offered in the other languages you listed? Or do you want to help Lua become a better web development platform by creating a Lua MVC framework like Rails did for Ruby?


The Kepler project is probably the best known starting point for web application development in Lua. They have a mailing list whose archives will have a lot of discussion of the merits of various approaches.

The Kepler site is itself built in a CMS framework called Sputnik written almost entirely in Lua, and based on the Kepler project.

The typical approach with Lua is to use a language suited to interfacing to various system components to implement those interfaces, and to use Lua for business logic and glue. Kepler provides libraries written largely in C that provide access to file systems, databases, and the network to Lua code. It also provides a defined API layer to interface with the web server, with implementations for Apache, any CGI capable server, and Xavante which is a complete web server implemented mostly in Lua.