From: ph@anweald.exnet.co.uk (Patrick Herring)
Newsgroups: comp.lang.rexx
Subject: Re: Perl to Rexx Conversion
Date: Thu, 21 Dec 95 15:57:34 GMT

Rony.Flatscher@wu-wien.ac.at writes in article <4b964r$sv0@osiris.wu-wien.ac.at>:
>
> Maybe one or two remarks to the discussion Rexx vs. Perl (yes, I would like
> regular expressions in Rexx too).

As a matter of interest, where would you like regexps in Rexx? As parse
templates, or more generally (whatever that could mean :-) )?

> >However, the original article asked for a Perl-to-REXX translator.  A
> >person asking for such a thing is laboring under a misconception,
> >which is that REXX is comparable in power and function to Perl.  I was
> >trying to give this person an idea that was closer to the right one,
> >which is that REXX is comparable in power and function to the Bourne
> >Shell.  Of the three lannguages, the pair that is closest toegther in
> >power is undeniably REXX and the shell.  Perl is much farther ahead of
> >REXX than REXX is ahead of the shell.

Could you give a brief list of Perl's extra features? Hallet German's 'Command
Language Cookbook' compared (amongst others) Rexx v4 with Perl v4 patch 19, and
showed an near equality of power between the two (Rexx won out overall because
of ease of use, but that's another story <g>). So I assume you are referring to
the new things in Perl v5.

Yours, Patrick
__________________________________________________________________

Patrick Herring, Primrose Hill, London, UK
I tend to eat my UUCP feed once a day so replies can take two days

From news.ios.com!news.ece.uc.edu!babbage.ece.uc.edu!newsxfer.itd.umich.edu!newsxfer2.itd.umich.edu!newsfeed.internetmci.com!howland.reston.ans.net!plug.news.pipex.net!pipex!tube.news.pipex.net!pipex!lade.news.pipex.net!pipex!exnet2!anweald!ph Sun Dec 24 10:43:41 1995
Path: news.ios.com!news.ece.uc.edu!babbage.ece.uc.edu!newsxfer.itd.umich.edu!newsxfer2.itd.umich.edu!newsfeed.internetmci.com!howland.reston.ans.net!plug.news.pipex.net!pipex!tube.news.pipex.net!pipex!lade.news.pipex.net!pipex!exnet2!anweald!ph
From: ph@anweald.exnet.co.uk (Patrick Herring)
Newsgroups: comp.lang.rexx
Subject: Re: Perl to Rexx Conversion
Distribution: world
Message-ID: <819654793snx@anweald.exnet.co.uk>
References: <4bbsk9$aej@osiris.wu-wien.ac.at>
Date: Fri, 22 Dec 95 17:53:13 GMT
Organization: Anweald Systems
Lines: 114

Rony.Flatscher@wu-wien.ac.at writes in article <4bbsk9$aej@osiris.wu-wien.ac.at>:
>
> In <819561454snx@anweald.exnet.co.uk>, ph@anweald.exnet.co.uk (Patrick Herring)>  writes:
> >Rony.Flatscher@wu-wien.ac.at writes in article <4> b964r$sv0@osiris.wu-wien.ac.at>:
> >>
> >> Maybe one or two remarks to the discussion Rexx vs. Perl (yes, I would like
> >> regular expressions in Rexx too).
> >
> >As a matter of interest, where would you like regexps in Rexx? As parse
> >templates, or more generally (whatever that could mean :-) )?
>
> Well, if I could wish:  with parse templates and with functions working on
> strings and streams (also with the replacement functionality).

as in (if [RegExp, MatchedString] is the syntax - I'd prefer {} to []
because regexps are actually sets of strings, but I think curly brackets are
definitely not portable (?))?,

  Str = 'asdsabababasd'

  parse var Str S1 [ 'ab'*, S2 ] S3 /* S1='asds' S2='ababab' S3=asd */

  say pos( [ 'ab'*, SubStr ], Str ) SubStr   /* gives: 5 ababab */

  File is Str || EOF
  call charin File, , [ 'ab'*, S ]  /* S='ababab', read pointer is at 11 */

ie length parameters can be regexps so that their meaning is 'whatever length
is needed to satisfy the regexp', which may lead to problems when there's no
match but lets leave that one for a bit. How would the replacement
functionality work (other than having regexps in translate() args)?

Am I right in thinking that there's no standard syntax for regexps, even in
UNIX?


> >> >However, the original article asked for a Perl-to-REXX translator.  A
> >> >person asking for such a thing is laboring under a misconception,
> >> >which is that REXX is comparable in power and function to Perl.  I was
> >> >trying to give this person an idea that was closer to the right one,
> >> >which is that REXX is comparable in power and function to the Bourne
> >> >Shell.  Of the three lannguages, the pair that is closest toegther in
> >> >power is undeniably REXX and the shell.  Perl is much farther ahead of
> >> >REXX than REXX is ahead of the shell.
> >
> >Could you give a brief list of Perl's extra features? Hallet German's 'Command>
> >Language Cookbook' compared (amongst others) Rexx v4 with Perl v4 patch 19,>  and
> >showed an near equality of power between the two (Rexx won out overall because>
> >of ease of use, but that's another story <g>). So I assume you are referring>  to
> >the new things in Perl v5.
>
> Is Hallet German's Cookbook available via WWW somehow (at least the table
> comparing the feature set of both languages) ?

Not so far as I know. The table is 7.5 pages; the rest of the book shows how
the various languages do various tasks. I must say I found a few small errors
in the Rexx treatment, but the book is generally useful.

> To be honest, I did read about the concepts, functionality of Pe(a)rl and from
> time to time encounter Perl programs (did just experimental programming to get>  a
> "feeling" for it).
>
> One important thing IMHO is its history, which explains why the language was
> defined the way it is, where it came from and therefore what functionality it
> supplies:  according to Larry Wall it was originally written to ease
> administration of Unix and VAX boxes (via TCP/IP) and enhanced with the
> functionality found in Unix' awk and sed (among other things).  It resembles
> somewhat C from the distance :)  and allows for utilizing features usually>  found
> in Unix systems resp.  in sh and csh for that matter.
>
> So, maybe some functions in standard Perl, not found in Rexx itself (but these
> functions *are* available one way or the other in the form of Rexx function
> packages for the appropriate problem domain, except for a nice implementation>  of
> regular expressions, AFAIK):
>
>         e.g. for TCP/IP, socket-programming like "bind", "gethostbyaddr",
>              "listen", "getnetbyaddr", "setsockopt", ...
>
>         e.g. op-/file-sys related (Unix derived) like "chmod", "chown",
>              "chroot", "getpriority", "mkdir", "msgrcv", "pipe", "readlink",
>              "semget", "setpriority"

Yes, this is like BASIC having it's own CHDIR(). I think Rexx v5/ANSI's
extension of address to put the results into a stem will make a lot of
difference to the ease of using system utilities, so that Rexx will become seen
as having just as much 'access' to eg chmod as Perl or a shell, whereas
currently it's not quite as nice (the gap is cosmetic really).
...
> One thing which has been keeping me away from Perl is the observation that many
> Perl utilities are written in a way which make it cumbersome (to say the least)
> to understand them in a fast and easy manner (this sometimes holds for the
> programmers themselves who sometimes have to literally decode the meaning of
> their own code).  This probably also leads to quality problems as it easy to
> oversee the cause of errors unless you invest a *lot* of time to understand what
> is really happening with some piece of "Perl art code" or unless you are
> *really* experienced with it.

Quite. It surprising how a really difficult language gets more popular than an
easy one that can do the same thing. Partly, I suppose it's because there have
usually been Perl gurus available to Perl learners (mostly in university
computing departments one suspects), but I think it's also because people want
to join the elite who actually understand all this garbage. You just have to
notice the popularity of C and it's inappropriateness for many of the things
people use it for. In fairness C was for many years the only generally
available general-purpose language for PCs, but now the situation has changed
and you can just feel the resistance of professional programmers to 'making do'
with code that ordinary mortals could maintain. IMHO a great deal of time &
effort has been wasted, but hey it's Christmas.

Yours, Patrick
__________________________________________________________________

Patrick Herring, Primrose Hill, London, UK
I tend to eat my UUCP feed once a day so replies can take two days

