Live data from Hacker News

Should Apache replace its current httpd.conf with Lua?

thread.gmane.org

21–30 of 48 posts

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

#21
post #18
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…

I've been using Apache for nearly a decade and it still takes me potentially hours of trial and error to figure out how to do something in an Apache config file. I'm pretty sure I'm not a stupid person, but there's something about Apache configuration that just doesn't fit in my brain. The Lua examples in that thread were instantly obvious to me, and I've never written a line of Lua in my life.

Thing being ... mod_perl let you do most of your configuration in code years ago. Yet I've never done that, and nor have the vast majority of mod_perl users I know (and bear in mind these are people self-selected to already like writing perl, so language wars probably don't make a lot of difference to my argument :).

Configuration isn't code, and I don't really think trying to make it such is necessarily a good idea - I suspect it seems superficially attractive to developers but with my sysad hat on it really doesn't seem wise.

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

#22

Wait, what? key=value is really so hard that we need to replace m4 with lua? Honestly? Before you feel the need to flame, imagine if this proposal had been for implementing the config file in COBOL (a language designed to be code readable by non-technical people). Would you still believe it to be a good idea? What ever happened to wanting to keep things simple?

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

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

#23
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.

The way to encourage adoption is just provide new functionality only possible using the new config syntax. Need dynamic process pool control? Here's a Lua example...

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

#24
post #11
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.

True, though I think it's probably a very large undertaking for a single person. Bringing it up on the mailing list would be a good way to gain mindshare and contributors.

Open source projects usually fair better with one author until they are somewhat stable, in my experience.

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

#25
post #20
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.

well... the XML approach was in fact proposed in the linked thread. mod_perl already allows for a totally dynamic configuration which should be sufficient in terms of automation. The documentation is quite perfect already and would IMHO lose quality if the syntax changes this drastically. The only point I'm willing to hand you is the validation argument, although the current parser seems to be doing a decent enough j…

...but not every Apache server has mod_perl. Adding mod_perl to a Rails or PHP server would eat more memory than its worth.

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

#26
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…

http://people.apache.org/~rbowen/presentations/apacheconEU20... Right, and it's a language with a brittle, inconsistently documented, largely ad hoc syntax. While Lua's syntax has its quirks (the syntax for lambdas is a little cumbersome, arrays are indexed from 1), that's because it is designed to be straightforward for simple use by non-programmers. The advanced features* don't get in the way if you're only using i…

Thank you, I was looking for a link to that presentation this morning and couldn't remember who had given it.

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

#27
post #11

Earlier quoted context omitted.

True, though I think it's probably a very large undertaking for a single person. Bringing it up on the mailing list would be a good way to gain mindshare and contributors.

Open source projects usually fair better with one author until they are somewhat stable, in my experience.

Well, I think that's definitely true in most cases, especially when the direction of a project isn't really nailed down you tend to get a lot of backseat driving and discussions over things that aren't important to the original goals, and people want to make the project about X when it should really be about Y, etc... I guess you need an OSS leader to either lead through strength of character/charisma, or by having already written the bulk of the code, but code trumps everything else so it's better to have written the bulk of the code.

Point being, I think you're right and I think my initial reasoning was wrong. But all the same, a little mailing list discussion generally doesn't hurt.

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

#28
I like this:

http://thread.gmane.org/gmane.comp.apache.devel/37627/focus=...

> I would like to see the output of configuration be a struct (of structs), and the actual config files are never looked at again (until reload). At that point we don't need to care how it is built, and we can try using lua, vcl, xml, jelly, groovy, windows ini files, or plists :)

I wonder what's going on with this, I just noticed the whole discussion is from early June...

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

#29
post #22

Wait, what? key=value is really so hard that we need to replace m4 with lua? Honestly? Before you feel the need to flame, imagine if this proposal had been for implementing the config file in COBOL (a language designed to be code readable by non-technical people). Would you still believe it to be a good idea? What ever happened to wanting to keep things simple?

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. Yeah, that worked great.

Layering Lua (or any language) as your configuration option will not simplify things. In fact, I'm willing to say that it will make it much, much harder as folks suddenly become increasingly "clever" about how they construct those config files.

I want my config files stupid. I want them heavily documented so that when I (or someone else) next has to manage them two years from now after working on multiple other projects in various languages and systems, they don't have to spend a week trying to remember what the hell this is doing, deciphering cryptic compile time errors, or wondering what the complex state machine construct someone layered on top of port allocations is supposed to be doing.

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

#30
post #20
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.

well... the XML approach was in fact proposed in the linked thread. mod_perl already allows for a totally dynamic configuration which should be sufficient in terms of automation. The documentation is quite perfect already and would IMHO lose quality if the syntax changes this drastically. The only point I'm willing to hand you is the validation argument, although the current parser seems to be doing a decent enough j…

"well... the XML approach was in fact proposed in the linked thread."

Yes, but, my point was that I see it as very unlikely to be adopted.

"The documentation is quite perfect already"

Sure it's well-written but "perfect" may be a stretch. Having a more consistent syntax would allow the documentation to be much more terse.

The current documentation reads like a manual, which is great. What's being proposed would mean that the documentation could be presented as a manual, AND as an API.

"The only point I'm willing to hand you is the validation argument"

I think you should hand me "automation" as well. :-) Writing a tool that interprets a Lua config file would be trivial. Writing a tool that interprets the current Apache config is not.

Anyway I'm not really advocating this change. I simply find the proposal interesting because I do a lot of programming with Lua and it's nice to see it get some high-level recognition.

Post reply on HN