tech-userlevel archive

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

Re: Lua as a scripting language in NetBSD

On Sat, Oct 17, 2009 at 9:03 PM, Joerg Sonnenberger
<> wrote:
> On Sat, Oct 17, 2009 at 12:48:53PM +0200, Alan Barrett wrote:
>> Are there any tools currently in the base system that you would
>> like to extend using embedded Lua? ÂIf so, which tools, and what
>> sort of actions would be facilitated by embedding a scripting
>> language?
> First is httpd. As written e.g. in the BSD magazine article about
> embedded webservers, CGI has a noticable overhead and glue for using lua
> should be small without a high impact both in terms of code size and
> memory footprint.
> Second is a new small footprint DHCP server. Lua makes a sane
> configuration language here with the possibility of arbitrary
> customisation. The principle of making easy things easy and hard things
> possible applies here. Lua as configuration language can't be any worth
> than the adhoc language employed by ISC and even statically linked the
> result can still be half the size of the current dhcpd.
> For scripts a good candidate for use is pkg_install. The current use of
> sh/awk/sed both requires larger bootstrap kits on !NetBSD and makes it
> difficult to correctly handle e.g. configuration files with spaces (XXX
> add PR reference here). This is not strictly a reason to move it to
> base, but might provide an idea for what it is useful.
> Joerg

I do think that embedding lua into NetBSD would fasten it's
development, and add to the extensibility of the system itself. There
are a lot of tasks that are too hard or complicated to do in C and
impossible or awkward to do in the sh/sed/awk triumvirate.

Lua is indeed the best candidate so far, as it meets all of the
criteria for this task. ECMAScript (or as it's more widely known as
JavaScript) would be also an option, but its implementation lacks the
(POSIX) extensions Lua have, and the language itself is often
criticized by many.  Scheme would be a viable option too, but it's
syntax is way too alien to most of the programmers, who grown up in an
Algol/C like world.
I can't bring up any pros or contras about tcl, maybe others can.

Anyway I am willingly to learn and use Lua if it get's into the base
system, and I think many others would.

Home | Main Index | Thread Index | Old Index