News for hackers. Stuff that matters.
Re:Should Apache replace its current httpd.conf with Lua? by mgrouchy on Thursday September 10, 2009 @09:34AM (#815199)
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.

Re:Should Apache replace its current httpd.conf with Lua? by scott_s on Thursday September 10, 2009 @10:23AM (#815284)
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:

  <IfModule mod_alias.c>

    #
    # Note that if you include a trailing / on fakename then the server will
    # require it to be present in the URL.  So "/icons" isn't aliased in this
    # example, only "/icons/".  If the fakename is slash-terminated, then the
    # realname must also be slash terminated, and if the fakename omits the
    # trailing slash, the realname must also omit it.
    #
    Alias /icons/ "/usr/local/apache/icons/"
    Alias /icons/ "/var/www/icons/"

    <Directory "/usr/local/apache/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the client.
    # The same rules about trailing "/" apply to ScriptAlias directives as to
    # Alias.
    #
    # ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

    #
    # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    <Directory "/var/www/cgi-bin">
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
    </Directory>

    #
    # "/usr/local/apache/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    # <Directory "/usr/local/apache/cgi-bin">
    #   AllowOverride None
    #   Options None
    #   Order allow,deny
    #   Allow from all
    # </Directory>

  </IfModule>

That is a language, and it's one that exists solely for Apache config files. I think using an actual programming language would be easier for most people.
Re:Should Apache replace its current httpd.conf with Lua? by silentbicycle on Thursday September 10, 2009 @10:29AM (#815299)
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 it as a log/config/etc. file format.

* Tail-call optimization, closures, coroutines, etc.

Re:Should Apache replace its current httpd.conf with Lua? by compay on Thursday September 10, 2009 @11:37AM (#815439)
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? by yesimahuman on Thursday September 10, 2009 @03:05PM (#815922)
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? by scott_s on Thursday September 10, 2009 @03:14PM (#815937)
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? by boredguy8 on Thursday September 10, 2009 @10:26AM (#815292)
Programmatic configuration solutions seem easier to me in a Lua world than the current .conf approach, which means it would be easier to develop tools for the casual user.
Re:Should Apache replace its current httpd.conf with Lua? by silentbicycle on Thursday September 10, 2009 @10:27AM (#815297)
Small thing, but it's "Lua", not "LUA". It means 'moon' in Portuguese, etymologically related to 'luna'/'lunar' in Romance languages. (Lua is from Brazil.)
Re:Should Apache replace its current httpd.conf with Lua? by evgen on Thursday September 10, 2009 @10:09AM (#815250)
Given the complexity to which apache and its ecosystem has grown and the consequences for screwing up this configuration task, this seems quite similar to sendmail in that I think a reasonable argument can be made that casual users should not be configuring this particular system. Period.
Re:Should Apache replace its current httpd.conf with Lua? by mgrouchy on Thursday September 10, 2009 @10:14AM (#815263)
You can make that argument, but reality is that casual users do configure apache so it ends up becoming a concern of the developers whether they want it to be or not.

Like I said, in the long run, it might be better to make the switch, but a change can cause significant risk/inconvenience to casual users or users who have such complicated configurations it would require significant time to replicate in another format.