lua-users home
lua-l archive

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


On Thursday 25 November 2004 11:22 am, Andre Carregal wrote:
> While I have to agree with your arguments, may I suggest a different
> approach?

of course... i have no plans of doing yet another template processor.  i'll 
research a bit more about that CGILua layer to make my system usable as just 
a new optional launcher.

what i have in mind would be something like this:

- mod_CGI with SA
- a fastcgi launcher (i think yours can work as-is)
- a main lua script, that calls a user's script on startup (before any 
request).
- that user script registers some functions on a table, keyed by path strings
- on every request, if the path specified by the URL is on the table, the 
referenced function is called
- if the URL isn't on the table, a Lua Page is called just as in CGILua, but 
the venv() would be optional.

a few additions would be pretty obvious:

- add a user sessions table, with an entry for every web user.  the main loop 
would fetch it before calling the registered functions or Lua Pages, who can 
do anything they want on this object.
- the startup script could create a few venv()s and register them with 
subtrees, so the web app could have a few separate environments.


my long-term goal would be to hide the statelessness of http; and later create 
an API that would talk to a simple JavaScript on the client, to create a 
GUI-like programmin plattform.  In principle, that would make html templates 
far less needed.  most of the programming would be GUI-like, with call that 
create elements, read user input, open windows, get user events, etc.


-- 
Javier

Attachment: pgpLTtwXiyaFZ.pgp
Description: PGP signature