Jeremy Blackman <[EMAIL PROTECTED]> writes:
> In his case, what was largely the problem was that his Perl was
> misconfigured and was trying to parse through a GREAT many more Perl
> libraries than was needed. Each invokation of resend took about 5
> _minutes_. Believe me, I helped track down and fix the
> misconfiguration...it IS possible to do that. It is much HARDER to do
> something like that (misconfigure in such a way) under C.
Well, it's pretty hard to do that in Perl too (as in, I'm sitting here
reading this and thinking "how on *earth* did you manage to do *that*?").
> I will also admit I am biased against writing applications in scripting
> languages as a general rule, because I've seen some things done very,
> very wrong in them. I've seen some things done wrong in C as well, and
> I've seen some things done right in scripting languages, but as a
> general rule for some reason I feel more like daemons and such should be
> written in C or C++ or SOMETHING that compiles and produces a binary.
Daemons, sure, since daemons pretty much have to handle signals and Perl
doesn't handle signals all that overwhelmingly well. But a list manager
doesn't really need to run as a daemon in the common case.
Scripting languages buy you things like automatic memory management that
are quite useful. Scripting languages also tend to have *massively*
better available libraries than C and C++ at present; for example, look at
all the stuff that Majordomo 2 does with MIME and note that practically no
actual MIME code had to be written specifically for it. There were
already standard libraries.
Of course, Majordomo 1 is hardly a stellar example of writing in a
scripting language; there's a running joke among Perl folks that it's a
good regression suite for Perl 4 compatibility since it does things that
scare Perl programmers. :) To be fair to the authors, Perl lacked a lot
of capabilities for writing cleaner packages back when Majordomo was
originally written, and it's been hacked a lot over the years.
> When I see things on freshmeat like 'HTTP Daemon written in Perl' or
> 'MTA written in Perl' or 'FTP client written in shell scripting
> language', I just want to run screaming and hide under my desk. :)
You don't use an HTTP daemon written in Perl to actually run a large site;
you use it for rapid prototyping because it's way faster to test ideas in
Perl than in C (no memory management to worry about, dynamic string
handling, quick hashes and arrays, etc.). It's a good language for that.
Then you figure out what you want to do and you recode in C. :)
--
Russ Allbery ([EMAIL PROTECTED]) <URL:http://www.eyrie.org/~eagle/>