From: allbery@NCoast.ORG (Brandon S. Allbery KF8NH)
Subject: Re: should I use ICON for a specific problem ?
Reply-To: allbery@ncoast.org (Brandon S. Allbery KF8NH)
Organization: North Coast Public Access *NIX, Cleveland, OH
Date: Sat, 11 Apr 1992 18:13:00 GMT
Followup-To: comp.lang.icon

As quoted from <rantapaa.702783275@s6.math.umn.edu> by rantapaa@s6.math.umn.edu (Erik E. Rantapaa):
+---------------
| In general, Icon has better support for data sturctures than Perl does.
| It's not real easy to implement 'recursive' data structures in Perl, although
| it can be done (although usually a way is found to get around it.)
+---------------

As one of those credited with a technique for "recursive" data structures:  it
can be done but should be avoided if at all possible.  If you really need
things like tree structures or true multidimensional arrays (especially
multidimensional associative arrays), Perl is probably not the language to use.
Icon does these well, as does Python.

+---------------
| Icon wins with the arbitrarily large integers.
+---------------

Recent versions of Perl come with a sort of "bignum" library, but it is not
integrated; you must use library subroutines to perform operations, as Perl
cannot overload existing operators to make e.g. "+" work in the "expected" way
on bignums.

+---------------
| Perl has labels like C does.  Icon has more powerful subroutines, however.
| They are, in fact, more like co-routines, something I wish Perl had.
+---------------

Icon has real co-routines as well as fully-functional subroutines (procedures).
Perl does possess labels, but they should only be uused to label loops; a
"goto" operation is available but is implemented solely for use by a sed-to-
Perl translator and its semantics are not guaranteed for anything but that use.

I will mention one more thing:  Perl has awk-like regexps, whereas Icon has a
more flexible and powerful --- but incompatible --- string scanning feature.
Python (contact guido@cwi.nl, Guido Van Rossum) has a regexp package; I don't
know if it has more powerful string scanning capabilities.

Which one you should use probably depends on the exact set of features you
need.  If you require fast regexps and translating them to string scans is
difficult or the regexps are constructed dynamically at runtime, Icon is
probably not the language to use; if you need non-flat data structures, Perl
is not the language to use.  I haven't enough experience with Python to say
whether it has any specific weak spots to be avoided; except that Python may
not be as portable to some non-Unix systems as Icon is.  Python is, however,
available for Macintosh and, I believe, MS-DOS.  Perl is available for MS-DOS
but not Macintosh.  I don't believe either is available for VMS or other
large-system proprietary OSes.  (All three, of course, are available for Unix.)
Icon, on the other hand, runs on virtually everything, so is very much the
language of choice if portability is a major concern.

(I don't believe in "best languages", except for a particular task.  I use
both Perl and Icon as well as several other interpreted and compiled
languages, and was only stopped from using Python by incomplete documentation
and implementation for my environment in an early version, both of which have
been corrected.)

++Brandon
-- 
Brandon S. Allbery, KF8NH [44.70.4.88]        allbery@NCoast.ORG
Senior Programmer, Telotech, Inc. (if I may call myself that...)
Newsgroups: comp.lang.icon,comp.lang.lisp,comp.lang.scheme