[about why anybody would ever use perl]
On Thu, 27 Jan 2000, Tommy Thorn wrote:
> "D. Tweed" wrote:
>
> > Another reason for the popularity of Perl is that it's _popular_ &
> > _ubiquitous_.
Indeed, popularity does beget further popularity until the point of
ubiquity. But I think that misses some of the point.
[snip]
>
> That true, there are other contributing factors. Look and the
> following list, and notice how ever point is in striking contrast to
> Haskell:
>
> - Perl has one implementation
> - The implementation is rather lightweight *and* reasonable efficient
> - A large class of problems can be solved %90 very quickly with Perl
> - Perl has a _very_ complete library, including _all_ of unix api
> - The language has remained fairly stable
> - In the begining Perl advotates would tirelessly answer every
question in comp.unix with some Perl code that answered the question
> - Perl is easy to install and is omnipresent
This is getting somewhere, but I think it misses a few very important
points. Many of these (and the ones below) strike me as being exactly
the ones mentioned by Wadler in his editorial on "why nobody uses
functional languages".
- Perl has a stable FFI, and can be targeted by SWIG
- Perl has a truly mature interface to Tk
- Perl has documentation that should be the envy of all other languages
- Perl modules are also easy to install
- Perl really does make easy things easy and hard things possible
> Notice that the language itself is far from the whole story. In fact,
> while the language "features" will get you 90% of the solution fairly
> quickly, I know from professional experience that maintaining Perl
> scripts written by others can be a living nightmare and that the
> Quick'N'Dirty style promoted by Perl _will_ bite you in the end.
Actually, I find the big problem is not generally the succinctness itself,
but the lack of a type system outside of the object-oriented features,
which are a mixed bag. (But even then, at least Perl has a record syntax
that real people can use.)
When a perl script is performing some function that would have a Haskell
signature of
String -> String (or [String] -> String, etc.)
I'm usually hard-pressed to think of anything substantially better than
the Perl way. Moreover, it's easy to forget that Perl really does have
stuff like lexical closures, anonymous functions, map, and other nice
things.
> > Of course, what can be done to help the start an epidemic `infecting'
> > people & machines with Haskell I don't know...
>
> Apart from the obvious of engineering better implementations and more
> complete libraries, we could publish code that solves common problems.
> Unfortunately it takes time to do properly, and in contrast to Perl,
> Haskell really shines on larger problems...
I have no argument with this. I would point out, though, that some short
Haskell solutions to some common problems are going to look a lot nastier
than they really are due to things like the current record and array
syntax, not to mention the "fine" points of I/O. And a lot of Haskell
solutions are going to be wildly inefficient due to, e.g., the way strings
are handled.
jking