On 21 Mar 2000, Ketil Malde wrote:
> "Jan Brosius" <[EMAIL PROTECTED]> writes:
>
> >> But this example task was chosen as unlucky for Haskell.
> >> In other, average case, I expect the ratio of 6-10.
>
> > This seems that Haskell cannot be considered as a language for real
> > world applications but merely as a toy for researchers .
>
> Yeah. Let's just lump Haskell in with Perl, Python, Java, Lisp and
> all those other toy languages, completely useless in the "real world".
Not sure I understand this statement. Compiled common lisp and scheme are
pretty competitive with C at this point for a great many things. Java is
designed to be portable as byte codes, which is a different aim than the
others. On the string/text processing programs where it excels,
performance of both perl and C (at least in my hands :-)) tend to be I/O
bound, and perl is waaay easier to get written. I know less about python,
but I do know they've got a version (jpython) that produces java
bytecodes, while there is also an effort going on to introduce stronger
type-checking into the language (to improve its performance). I'm not
sure there is any pair of these 6 languages I would lump together other
than possibly perl and python.
A more reasonable question might be: what real world applications would
you use choose Haskell for today? And other people have given better
answers here than I could.
Which I guess is a cue to bring up my hunch that hugs/ghc *could* end up
being a language that could eventually "out-perl perl" in some
applications, since it's a good choice for parsing, and many
text-filtering applications look like good matches for a functional
programming language.
In that regard, I think the biggest problems remaining are the lack of a
standard "fast" string type, and some remaining warts in hugs. These are
maybe easiest to see when you do something like "strace -c" on a hugs
program and the comparable perl program. So, in my naive version of
"hello world", the hugs version generates 803 calls to 'lstat', 102 calls
to 'stat', and a performance-killing 13 calls to 'write'; yup, that's
one for every character. :-( throw most of those out, and you're within
shouting distance of perl. And that would be something to shout about.
Oh yeah: my code. :-)
#!/usr/bin/runhugs
module Main where
main = putStr "Hello, world\n"
---------------
#!/usr/bin/perl
print "Hello, world\n";
jking