You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian McCallister <br...@skife.org> on 2011/03/15 00:51:59 UTC

a plan mod_lua and 2.4

I have been wrestling for a while now with how to advance the state of
mod_lua, but still have it be a core module. The key problem is that
mod_lua *isn't* especially mature yet, and a lot of the functionality
need to evolve. This doesn't go very well with being a core module,
and forward-incompat changes in stable being blocked until 2.6 :-)

I think the right path for this is to shrink the core mod_lua module
to be the *minimal* set for integration, and pull all the higher level
functionality into a non-core module, which uses the core mod_lua to
hook into the server.

The general scheme I think will work is that the core mod_lua includes
only the for managing lua_State lifecycles, accessing related structs
(request_rec, etc), and catching various hooks (under the new
directive model, "LuaHook <hook> <file> <function>".

This means things like the LuaMapHandler directive, parsing of form
data, etc will be removed from the core module.

-Brian

Re: a plan mod_lua and 2.4

Posted by Dan Poirier <po...@pobox.com>.
On Mon. 2011-03-14 at 07:51 PM EDT, Brian McCallister <br...@skife.org> wrote:

> I think the right path for this is to shrink the core mod_lua module
> to be the *minimal* set for integration, and pull all the higher level
> functionality into a non-core module, which uses the core mod_lua to
> hook into the server.

This sounds like a good plan.

Re: a plan mod_lua and 2.4

Posted by HyperHacker <hy...@gmail.com>.
On Sat, Mar 19, 2011 at 04:57, Dan Poirier <po...@pobox.com> wrote:
> On Tue. 2011-03-15 at 09:08 AM EDT, "Akins, Brian" <Br...@turner.com> wrote:
>
>> How many people actual run mod_lua (or a derivative/relative) in production?
>> Am I the only one on a "real" site?
>
> I guess the others, if any, aren't reading dev@.  And searching gmane's
> archive of the user list only turns up a few mentions in almost 90,000
> posts.
>
> Of course, it's not in a production release of the server yet.  And even
> when 2.4.0 ships, it'll probably still be marked experimental.
>

Actually, I wanted to try it a while ago, but couldn't find any place
to actually obtain it on the Apache website... >.> The documentation
was also pretty sparse last I saw, which is another barrier to entry.

-- 
Sent from my toaster.

Re: a plan mod_lua and 2.4

Posted by Dan Poirier <po...@pobox.com>.
On Tue. 2011-03-15 at 09:08 AM EDT, "Akins, Brian" <Br...@turner.com> wrote:

> How many people actual run mod_lua (or a derivative/relative) in production?
> Am I the only one on a "real" site?

I guess the others, if any, aren't reading dev@.  And searching gmane's
archive of the user list only turns up a few mentions in almost 90,000
posts.

Of course, it's not in a production release of the server yet.  And even
when 2.4.0 ships, it'll probably still be marked experimental.

Re: a plan mod_lua and 2.4

Posted by "Akins, Brian" <Br...@turner.com>.
On 3/15/11 2:25 PM, "Dan Poirier" <po...@pobox.com> wrote:

> I agree too, but the discussion was about whether mod_lua might replace
> PHP some day, and I think if that's your goal (worthwhile or not) you'd
> have to provide web page embedding.

We never, ever run mod_php, only via fastcgi, anyway.  No need to embed
php-like functionality inside mod_lua, IMO.

-- 
Brian Akins



Re: a plan mod_lua and 2.4

Posted by Dan Poirier <po...@pobox.com>.
On Tue. 2011-03-15 at 11:47 AM EDT, Jeff Trawick <tr...@gmail.com> wrote:
> On Tue, Mar 15, 2011 at 10:53 AM, Akins, Brian <Br...@turner.com> wrote:
>> On 3/15/11 10:05 AM, "Dan Poirier" <po...@pobox.com> wrote:
>>
>>> Maybe if people could embed lua in web pages.
>>
>> FWIW, I don't think the web needs yet another web page generator embedded
>> inside a web server.  We apps should be ran by application servers -
>> fastcgi, proxy, etc.
>>
>> But that's just my opinion ;)
>
> +1 :)

I agree too, but the discussion was about whether mod_lua might replace
PHP some day, and I think if that's your goal (worthwhile or not) you'd
have to provide web page embedding.

Dan

Re: a plan mod_lua and 2.4

Posted by Jeff Trawick <tr...@gmail.com>.
On Tue, Mar 15, 2011 at 10:53 AM, Akins, Brian <Br...@turner.com> wrote:
> On 3/15/11 10:05 AM, "Dan Poirier" <po...@pobox.com> wrote:
>
>
>> Maybe if people could embed lua in web pages.
>
> FWIW, I don't think the web needs yet another web page generator embedded
> inside a web server.  We apps should be ran by application servers -
> fastcgi, proxy, etc.
>
> But that's just my opinion ;)

+1 :)

Re: a plan mod_lua and 2.4

Posted by HyperHacker <hy...@gmail.com>.
On Tue, Mar 15, 2011 at 08:05, Dan Poirier <po...@pobox.com> wrote:
> On Tue. 2011-03-15 at 09:36 AM EDT, HyperHacker <hy...@gmail.com> wrote:
>
>> I've been eagerly looking forward to a stable mod_lua with which to
>> make my sites. If done well, Lua could replace PHP as the #1 web
>> scripting language
>
> Maybe if people could embed lua in web pages.
>

Mm, personally I dislike the "embed code in HTML" thing, as I'm one of
those purists who likes to keep code, presentation, and data separate.
However I did, just for fun, write a web server in Lua which had that
capability. It basically just did a gsub on the HTML file being sent:
str = str:gsub('<%?lua%s.-%s%?>',
	function(code)
		local func = loadstring(code:sub(7, -4))
		setfenv(func, self.Request.Environment)
		return tostring(func())
	end)

This is one of the things I love about Lua - once you have the
language, whatever additional functionality you want can be
implemented pretty easily. Little is built in. I imagine you could
work this into your mod_lua configuration fairly easily, and there you
go, code embedded within pages.

-- 
Sent from my toaster.

Re: a plan mod_lua and 2.4

Posted by "Akins, Brian" <Br...@turner.com>.
On 3/15/11 10:05 AM, "Dan Poirier" <po...@pobox.com> wrote:


> Maybe if people could embed lua in web pages.

FWIW, I don't think the web needs yet another web page generator embedded
inside a web server.  We apps should be ran by application servers -
fastcgi, proxy, etc.

But that's just my opinion ;)

-- 
Brian Akins



Re: a plan mod_lua and 2.4

Posted by Dan Poirier <po...@pobox.com>.
On Tue. 2011-03-15 at 09:36 AM EDT, HyperHacker <hy...@gmail.com> wrote:

> I've been eagerly looking forward to a stable mod_lua with which to
> make my sites. If done well, Lua could replace PHP as the #1 web
> scripting language

Maybe if people could embed lua in web pages.

Re: a plan mod_lua and 2.4

Posted by HyperHacker <hy...@gmail.com>.
On Tue, Mar 15, 2011 at 07:08, Akins, Brian <Br...@turner.com> wrote:
> On 3/14/11 7:51 PM, "Brian McCallister" <br...@skife.org> wrote:
>
>> I think the right path for this is to shrink the core mod_lua module
>> to be the *minimal* set for integration, and pull all the higher level
>> functionality into a non-core module, which uses the core mod_lua to
>> hook into the server.
>
> +1
>
> How many people actual run mod_lua (or a derivative/relative) in production?
> Am I the only one on a "real" site?
>
> FWIW, moving more and more of the code into Lua and having only very thin
> wrappers in C is a good idea as well.  Plays really nicely with luajit, as
> well.
>
> --
> Brian Akins
>
>
>

I've been eagerly looking forward to a stable mod_lua with which to
make my sites. If done well, Lua could replace PHP as the #1 web
scripting language, especially if it avoided making the same mistakes
(e.g. dumping everything into the global namespace with no consistent
naming or parameter schemes).

-- 
Sent from my toaster.

Re: a plan mod_lua and 2.4

Posted by Brian McCallister <br...@skife.org>.
On Tue, Mar 15, 2011 at 7:08 AM, Akins, Brian <Br...@turner.com> wrote:
> On 3/14/11 7:51 PM, "Brian McCallister" <br...@skife.org> wrote:
>
>> I think the right path for this is to shrink the core mod_lua module
>> to be the *minimal* set for integration, and pull all the higher level
>> functionality into a non-core module, which uses the core mod_lua to
>> hook into the server.
>
> +1
>
> How many people actual run mod_lua (or a derivative/relative) in production?
> Am I the only one on a "real" site?

I have a version of mod_wombat but not mod_lua.

>
> FWIW, moving more and more of the code into Lua and having only very thin
> wrappers in C is a good idea as well.  Plays really nicely with luajit, as
> well.

Yes.

>
> --
> Brian Akins
>
>
>

Re: a plan mod_lua and 2.4

Posted by "Akins, Brian" <Br...@turner.com>.
On 3/14/11 7:51 PM, "Brian McCallister" <br...@skife.org> wrote:

> I think the right path for this is to shrink the core mod_lua module
> to be the *minimal* set for integration, and pull all the higher level
> functionality into a non-core module, which uses the core mod_lua to
> hook into the server.

+1

How many people actual run mod_lua (or a derivative/relative) in production?
Am I the only one on a "real" site?

FWIW, moving more and more of the code into Lua and having only very thin
wrappers in C is a good idea as well.  Plays really nicely with luajit, as
well.

-- 
Brian Akins