lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>> I am evaluating CGILua for a new web application.  There are very few
>> discussion that compares CGILua with PHP.  Would CGILua be more superior
>> in
>> terms of performance and memory utilization?

It is my impression that most people who choose a Lua-based web
development system (CGILua or whatever) over PHP do so because they
want to program in Lua.  I would also guess that most people who end
up using CGILua do not actually seriously consider using PHP.  I
myself, never considered writing something like Sputnik in PHP.  If I
wasn't currently working on a web app in Lua, I would probably be
writing one in Python.  It seems to me that people who choose Lua and
people who choose PHP look for different things in a programming
language.  Those who choose Lua often look for elegance among other
things.  While PHP has its advantages, elegance is hardly one of them.

> Sputnik, an extensible wiki, is based on the Kepler stack:
>
> http://sputnik.freewisdom.org/

Sputnik uses Kepler's WSAPI and can run on top of CGILua, but is not
written as a CGILua application, since I generally try to stay away
from page-oriented web development style.  CGILua's "Lua Pages" allows
you to embed chunks of code in an HTML page, PHP-style.  This approach
is good when you want to add a little bit of dynamic action to an
existing static site, but for developing a web application this mixes
content and presentation too much, for my taste at least.  I also
ended up using a different templating solution - "Cosmo"
(http://cosmo.luaforge.net/).   Again, this was to avoid mixing logic
and presentation.

CGILua does allow you to use "Lua Scripts" instead of "Lua Pages," and
earlier versions of Sputnik were written as a Lua script that relied
on modules for most of the work.  I have since moved to just using
WSAPI, since WSAPI now offers all the functionality of CGILua that I
was relying on.  Sputnik now connects directly to Kepler's WSAPI,
making sure that all requests go through the same function, which then
dispatches them.  This makes it easier to avoid duplication of code.

 - yuri

-- 
http://sputnik.freewisdom.org/