lua-users home
lua-l archive

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


>...
> things.  While PHP has its advantages, elegance is hardly one of them.

PHP is the opposite meaning of elegance. ...

> 
> > 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 second that. It's nice to embed code in a webpage, but for any more complex
application, it tends to be a drawback. With the result that most PHP scripts
start with <? and end with ?>.

I also like about lua that you can load additional libs during runtime. Your
environment is also not affected by some weird configuration scripts which can
defect your scripts in some weird ways (switching on warning/error levels for
ambiguous operations that are normally ignored).

If your application needs to implement some libraries that are not supported by
PHP (special IO stuff for example) or if you need to do heavy number crunching
that should better be done in some highly optimized C code, you might prefer
Lua as well since it's quite easy to compile and use a custom lib that can be
used in lua.

I also find it easier to debug lua scripts via simple print outputs by changing
certain functions. I.e. I want to know which piece of code is calling a certain
function - simply done in lua by overloading the initial function and do a
stacktrace lookup when it's called. 

However it strongly depends on your project you are working on, so maybe you
could write a bit more about in which ways performance / memory footprint is
important for you.

-- eike