Live data from Hacker News

Should Apache replace its current httpd.conf with Lua?

thread.gmane.org

31–40 of 48 posts

Re: Should Apache replace its current httpd.conf with Lua?

#31
Tcl's nice for this kind of thing too, as it's really easy to make your own "DSL"'s (or is that passe`?)

    directory "/usr/local/foo/bar" {
        options bee bop doo wah
        if { $someotheroption } {
            order allow deny
        }
    }
Lua might or might not be better for processing requests: it's sure fast. Config files don't really need to be fast though.

Re: Should Apache replace its current httpd.conf with Lua?

#33
post #22

Earlier quoted context omitted.

m4? key=value? Have you ever either read or written an Apache httpd config file?

yep, on a daily basis. I also handle php.ini, java properties files and a slew of others. (Including the ever loving satan spawn of sendmail.cf). All of which are simple key value pairs. Apache (and a few others) introduce scoping with psuedo XML, but again, it's not complex logic. I brought up m4 because that was the last time someone tried to solve the configuration problem with a "simple and easy" macro language.…

clearly you've never ran any big site (yahoo, netflix, unitedheroes, etc) where complex configs are required.

Re: Should Apache replace its current httpd.conf with Lua?

#34

Earlier quoted context omitted.

yep, on a daily basis. I also handle php.ini, java properties files and a slew of others. (Including the ever loving satan spawn of sendmail.cf). All of which are simple key value pairs. Apache (and a few others) introduce scoping with psuedo XML, but again, it's not complex logic. I brought up m4 because that was the last time someone tried to solve the configuration problem with a "simple and easy" macro language.…

clearly you've never ran any big site (yahoo, netflix, unitedheroes, etc) where complex configs are required .

I don't see how that's clear at all. And which of those three do you work at, btw?

Re: Should Apache replace its current httpd.conf with Lua?

#35
post #34

Earlier quoted context omitted.

clearly you've never ran any big site (yahoo, netflix, unitedheroes, etc) where complex configs are required .

I don't see how that's clear at all. And which of those three do you work at, btw?

heh. I used to work at Yahoo, I currently work at Netflix, and my personal site is unitedheroes.net.

I also know chad and he's being a dork. (hey, i appreciate a well crafted troll.)

Re: Should Apache replace its current httpd.conf with Lua?

#36
post #10
post #6

I wonder what is wrong with the current way of configuring apache. I might be biased, but I have experience with both lighttpd and apache and I always found the apache way of doing things perfectly fine and actually prefer it to the kind-of procedural style of lighty. Let's just hope they don't switch to an XML based configuratino file. We don't need even more filler-code in our configuration files. XML just isn't hu…

As far as I can tell XML config files (at least those intended to be hand-edited) have largely fallen out of favor in non-Java open source projects. I also don't mind the current config file, but I've been using Apache for more than 10 years so I've probably lost all perspective at this point. Having the config file in Lua would certainly make it eaiser to automate, validate and document though.

As far as I can tell XML config files (at least those intended to be hand-edited) have largely fallen out of favor in non-Java open source projects.

I think it's too bad that people seem to be diverging towards either a crappy, barely readable data format or full-fledged programming languages. The advantage of XML is that it's a well-specified and reasonably flexible way of representing structured data. You can interpret an XML document as code (e.g., XSLT) but basically XML is just data until you say otherwise. Configuration file formats should be dumb. You shouldn't be able to program your configuration file to play chess. The only significant downside of XML is its verbose and barely readable syntax, and you don't need a configuration file that has its own byte compiler and runtime system to provide readable syntax.

Re: Should Apache replace its current httpd.conf with Lua?

#37
post #3

Surprised to see so much discussion on that. Instead, would expect someone to simply implement it, throw it on the table, and provide instructions for building it into your own apache. If it catches on, then you have a replacement to the current config syntax. That said, in my experience, admins are slow to change. There are still sites running Apache 1.3 out there.

It might be a harsh stereotype, but it has been said that the Apache project is an exercise in bureaucrats doing open source. Alternatively, it's an ideal outlet for bikeshedding.

Re: Should Apache replace its current httpd.conf with Lua?

#38
post #12
post #2

Its a neat idea, but I would echo the sentiment brought up in the thread linked that casual users would have a much harder time with a lua config in comparison to the current one. Its probably a good idea to move in this direction in the long run, but there is always a risk of displeasing your current users.

I wonder if the people who made those comments are in denial about the complexity of Apache configuration files. Having never seen one, I Googled "apache sample config file" and I came up on this page: http://www.pantz.org/software/apache/apache13config.html This is representative of the more complex entries: # # Note that if you include a trailing / on fakename then the server will # require it to be present in the…

In your example though, the complexity comes from having to know what things like "Order allow,deny" are. If you moved to lua I assume they would still use the same terminology, you would just have to represent it in lua instead of the current format. I think a file like this is easier for someone who has even a little bit of HTML experience to understand versus lua.

Re: Should Apache replace its current httpd.conf with Lua?

#39
post #12

Earlier quoted context omitted.

I wonder if the people who made those comments are in denial about the complexity of Apache configuration files. Having never seen one, I Googled "apache sample config file" and I came up on this page: http://www.pantz.org/software/apache/apache13config.html This is representative of the more complex entries: # # Note that if you include a trailing / on fakename then the server will # require it to be present in the…

In your example though, the complexity comes from having to know what things like "Order allow,deny" are. If you moved to lua I assume they would still use the same terminology, you would just have to represent it in lua instead of the current format. I think a file like this is easier for someone who has even a little bit of HTML experience to understand versus lua.

To me, the complexity comes from using a pseudo-XML syntax to indicate control flow and function (?) calls.

Re: Should Apache replace its current httpd.conf with Lua?

#40
post #36
post #10

Earlier quoted context omitted.

As far as I can tell XML config files (at least those intended to be hand-edited) have largely fallen out of favor in non-Java open source projects. I also don't mind the current config file, but I've been using Apache for more than 10 years so I've probably lost all perspective at this point. Having the config file in Lua would certainly make it eaiser to automate, validate and document though.

As far as I can tell XML config files (at least those intended to be hand-edited) have largely fallen out of favor in non-Java open source projects. I think it's too bad that people seem to be diverging towards either a crappy, barely readable data format or full-fledged programming languages. The advantage of XML is that it's a well-specified and reasonably flexible way of representing structured data. You can inter…

While Lua is a programming language, it was designed to have a subset usable for data. It's very similar to Javascript / JSON, in that regard. (Lua grew along parallel lines to Javascript in many ways.) You can run it in a sandbox, remove recursion, etc., and its compiler has been optimized for reading large dumps of such data.
Post reply on HN