[comp.sys.amiga] ARexx question

bmacintyre@watsol.waterloo.edu (Blair MacIntyre) (09/29/88)

Ok, I've been reading about ARexx, programs that support it, etc.

Time for the stupid question of the century:

  What exactly is it the point of having an ARexx port in a program?

I'm not asking this as a 'why bother?' kind of question, but an honest
out-of-curiosity question ... what could I use it for?

Just curious.

Blair
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
= Mr. Blair MacIntyre (bmacintyre@watsol.waterloo.edu)                        =
= Using computers is like parachuting ... if you don't get it the first time, =
= chances are you won't try it again.                                         =

vkr@osupyr.mast.ohio-state.edu (Vidhyanath K. Rao) (10/01/88)

In article <8759@watdragon.waterloo.edu> bmacintyre@watsol.waterloo.edu (Blair MacIntyre) writes:
>Ok, I've been reading about ARexx, programs that support it, etc. [...]
>  What exactly is it the point of having an ARexx port in a program? [...]

There are two advantages: The first is getting a full fledged macro language
(almost) for free. Right now that seems to have caught everybody's attention.
Especially since macros with loops, condintional execution and recursion are
not that common in many applications running on micros.

Another advantage is the fact that AREXX allows the end user to 'integrate'
programs of his/her choice. For example, I can use Emacs or DME or TxEd(Plus)
or UEdit or (you get the idea) with AmigaTeX and do so in an integrated fashion
like in the built-in editors on certain other micro implementations. The key
point is that it is I who selects the editor.

There is a whole new territory that is as yet unexplored: ARexx function hosts.
Since I don't know of any example (except ARexx itself) I don't know what is
possible, but it is promising. 

------------------------------------------------------------------------------
[What is a signature and how do I get one]
						Nath Rao
					vkr@osupyr.mast.ohio-state.edu

cmcmanis%pepper@Sun.COM (Chuck McManis) (10/01/88)

In article <8759@watdragon.waterloo.edu> (Blair MacIntyre) writes:
>Time for the stupid question of the century:
>  What exactly is it the point of having an ARexx port in a program?
>Blair

Not really a stupid question, having an ARexx port is like having 
multitasking, you can't really think why you need it until you have
it and then you can't understand why it took you so long to figure
out that you did need it. 

An ARexx port is a remote control, done right it offers complete control
of the program from ARexx. It is this aspect of it that causes some 
people to think of ARexx as a glorified Macro package, the difference
is that ARexx is much smarter than your average macro package and indeed
may only be the messenger for even higher intelligence :-). 

Of course the best way to explain something is to start with an example
that is close to home, text editing. 

TxED+ is a text editor that has full control of the editor available
through the ARexx port. TxED is a nice "programmers" editor because
the commands are simple and don't get in your way, and the executable
is small so you can have it around all of the time. Now let's suppose
you are writing a letter or something and find your self making lots
of little changes to a paragraph. Since TxED has no justification 
features you find yourself going back, adding and removing carrige
returns, to keep the paragraph in a semblance of reasonableness. 
With ARexx however, you can automate this process with a simple macro
that "clips" the selected region, does the justification, and then 
"pastes" the result back into your buffer. Further, TxED lets you
attach ARexx programs to Menu items so now you can add a menu item
"justify" that becomes part of the editing environment. Now this is
not more than any particular macro package can do either. Except
that what if MicroEMACS takes the same basic commands as TxED+ ? 
If so you paragraph justification program will work equally well on
*both* editors.

Big deal, you might think so you establish some defacto standards and
a bunch of editors can share macros. And you're right it isn't much
of a big deal (but it's a start). No the real power becomes evident
when the thing on the other end of your ARexx program *isn't* ARrexx.

You can add another program into the loop. Consider TeX the text formatter
that Radical Eye Software sells. Now instead of selecting a region 
in TxED+ and selecting "justify" you identify the region and select 
"typeset". Suddenly a screen jumps to the front and your text is
displayed, fully justified with all the various margins and such set.
Now you have *leveraged* TxED by giving it typesetting abilities thru
TeX. Now how much would you pay ? [just kidding]. Now let's bring it
closer to home, what about a compiler that has a ARexx port? Now you
can set up a "compile" menu option *IN ANY REXX COMPATIBLE EDITOR*
and have an integrated environment. The compiler notes errors and
positions the cursor for you, even jumping to other source files 
if necessary. Now you have a Borland Turbo Pascal like environment
except that the compilers and editors are all interchangable. Some
people compile Modula-2, others C, fortran, or Assembler! Some us
vi like editors, some use EMACS like editors. That's *powerful*.

With startup files you can customize your editor to be a word processor,
compiler environment, phone book, directory organizer, anything. 

But what if you aren't some hacker type who writes a bunch of code?
Maybe your just a graphic artist that likes to use these machines.
So you add an Arexx port to your paint program. Now connect that
thru Arexx to a ray tracer or some other renderer. Draw a circle,
send the specifics to ARexx (like radius, pos, etc) and have Arexx
forward it to a sphere generator, or do it in ARexx since there is
a fairly complete programming language available. 

The answer to your question is, "Adding an ARexx port to your program
will allow it to use and be used by other programs to create tools
that are more powerful than either separately." 




--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.

mp1u+@andrew.cmu.edu (Michael Portuesi) (10/03/88)

> *Excerpts from ext.nn.comp.sys.amiga: 30-Sep-88 Re: ARexx question Chuck*
> *McManis@Sun.COM (4222)*

>  Now let's bring it
> closer to home, what about a compiler that has a ARexx port? Now you
> can set up a "compile" menu option *IN ANY REXX COMPATIBLE EDITOR*
> and have an integrated environment. The compiler notes errors and
> positions the cursor for you, even jumping to other source files
> if necessary. Now you have a Borland Turbo Pascal like environment
> except that the compilers and editors are all interchangable. Some
> people compile Modula-2, others C, fortran, or Assembler! Some us
> vi like editors, some use EMACS like editors. That's *powerful*.

So when is Lattice or Manx going to add an AREXX port to their compiler?  Given
the ferocity of the competition between them, this would be a big selling point
that wouldn't be a big deal to implement.

                        --M


Michael Portuesi / Information Technology Center / Carnegie Mellon University
ARPA/UUCP: mp1u+@andrew.cmu.edu                     BITNET: rainwalker@drycas

"my friends say she's a dumb blonde, but they don't know she dyes her hair"

kasper@csli.STANFORD.EDU (Kasper Osterbye) (10/03/88)

Here is my two cents of why I found ARexx to be more than a glorified
Macro language. Some one said it was like having a remote control to
the program. That was exactly what I used it for. TxEd+ do not auto
save the text every so often, and some other program made the machine
crash, and I lost 2 hours of creative thesis writing. 

I then wrote a little ARexx program that would send TxEd+ a message every
5 minutes telling it to save. No other `macro' language allows you to
run your macros concurrently with the editor.

Btw. Last time I was at the dealer I found that `Zing-spell' has a
spelling checker. This means that all ARexx compatible editors now have
a spelling checker.

This again means that the possible market for Zing-spell is much greater
than had it been just a standalone spell-checker (hint to all developers:-)

--Kasper (who needs a spelling checker badly)

Kasper Osterbye                                |||  ///   ///|
Internet: kasper@csli.stanford.edu             ||| ///   ///||
UUCP: {backbones..}!csli.stanford.edu!kasper   |||<<<   ///|||
AT&T: (415) 323 9604                           ||| \\\ ///=|||
USMAIL: 2420 Tasso st. #3, Palo Alto CA 94301  |||  \\X//  |||MIGA

peter@sugar.uu.net (Peter da Silva) (10/03/88)

In article <4XFfRWy00VsfQ0UVJX@andrew.cmu.edu>, mp1u+@andrew.cmu.edu (Michael Portuesi) writes:
> So when is Lattice or Manx going to add an AREXX port to their compiler?
> Given the ferocity of the competition between them, this would be a big
> selling point that wouldn't be a big deal to implement.

Actually, it would be pretty hairy. You would have to set up an interactive
interface to what is essentially a batch program. I'd rather have a filter
that grokked the output of make and cc and sent the commands to the editor.
Kick it off from wsh. How about Arexx itself? You can pipe to it in wsh.

Why, look, you don't need that port after all!
-- 
		Peter da Silva  `-_-'  peter@sugar.uu.net
		 Have you hugged  U  your wolf today?

vkr%osupyr.mast.ohio-state.edu@UDEL.EDU (10/04/88)

Received: from CUNYVM by CUNYVM.BITNET (Mailer X2.00) with BSMTP id 5161; Fri,
 30 Sep 88 20:34:14 EDT
Received: from UDEL.EDU by CUNYVM.CUNY.EDU (IBM VM SMTP R1.1) with TCP; Fri, 30
 Sep 88 20:34:09 EDT
Received: from Louie.UDEL.EDU by Louie.UDEL.EDU id aa14157; 30 Sep 88 16:56 EDT
Received: from USENET by Louie.UDEL.EDU id aa14052; 30 Sep 88 16:48 EDT
From: "Vidhyanath K. Rao" <vkr@osupyr.mast.ohio-state.edu>
Subject: Re: ARexx question
Message-ID: <894@osupyr.mast.ohio-state.edu>
Date: 30 Sep 88 20:13:08 GMT
Organization: Dept of Math., Ohio St. U. at Newark
To:       amiga-relay@UDEL.EDU
Sender:   amiga-relay-request@UDEL.EDU

In article <8759@watdragon.waterloo.edu> bmacintyre@watsol.waterloo.edu (Blair
 MacIntyre) writes:
>Ok, I've been reading about ARexx, programs that support it, etc. [...]
>  What exactly is it the point of having an ARexx port in a program? [...]

There are two advantages: The first is getting a full fledged macro language
(almost) for free. Right now that seems to have caught everybody's attention.
Especially since macros with loops, condintional execution and recursion are
not that common in many applications running on micros.

Another advantage is the fact that AREXX allows the end user to 'integrate'
programs of his/her choice. For example, I can use Emacs or DME or TxEd(Plus)
or UEdit or (you get the idea) with AmigaTeX and do so in an integrated fashion
like in the built-in editors on certain other micro implementations. The key
point is that it is I who selects the editor.

There is a whole new territory that is as yet unexplored: ARexx function hosts.
Since I don't know of any example (except ARexx itself) I don't know what is
possible, but it is promising.

------------------------------------------------------------------------------
[What is a signature and how do I get one]
                        Nath Rao
                    vkr@osupyr.mast.ohio-state.edu

cmcmanis%pepper@UDEL.EDU (10/04/88)

Received: from CUNYVM by CUNYVM.BITNET (Mailer X2.00) with BSMTP id 7734; Sat,
 01 Oct 88 00:40:04 EDT
Received: from UDEL.EDU by CUNYVM.CUNY.EDU (IBM VM SMTP R1.1) with TCP; Sat, 01
 Oct 88 00:39:58 EDT
Received: from Louie.UDEL.EDU by Louie.UDEL.EDU id ac17521; 30 Sep 88 20:58 EDT
Received: by Louie.UDEL.EDU id ad17361; 30 Sep 88 20:48 EDT
Received: from USENET by Louie.UDEL.EDU id aa17019; 30 Sep 88 20:21 EDT
From: Chuck McManis <cmcmanis%pepper@sun.com>
Subject: Re: ARexx question
Message-ID: <71155@sun.uucp>
Date: 30 Sep 88 22:42:32 GMT
Organization: Sun Microsystems, Mountain View
To:       amiga-relay@UDEL.EDU
Sender:   amiga-relay-request@UDEL.EDU

In article <8759@watdragon.waterloo.edu> (Blair MacIntyre) writes:
>Time for the stupid question of the century:
>  What exactly is it the point of having an ARexx port in a program?
>Blair

Not really a stupid question, having an ARexx port is like having
multitasking, you can't really think why you need it until you have
it and then you can't understand why it took you so long to figure
out that you did need it.

An ARexx port is a remote control, done right it offers complete control
of the program from ARexx. It is this aspect of it that causes some
people to think of ARexx as a glorified Macro package, the difference
is that ARexx is much smarter than your average macro package and indeed
may only be the messenger for even higher intelligence :-).

Of course the best way to explain something is to start with an example
that is close to home, text editing.

TxED+ is a text editor that has full control of the editor available
through the ARexx port. TxED is a nice "programmers" editor because
the commands are simple and don't get in your way, and the executable
is small so you can have it around all of the time. Now let's suppose
you are writing a letter or something and find your self making lots
of little changes to a paragraph. Since TxED has no justification
features you find yourself going back, adding and removing carrige
returns, to keep the paragraph in a semblance of reasonableness.
With ARexx however, you can automate this process with a simple macro
that "clips" the selected region, does the justification, and then
"pastes" the result back into your buffer. Further, TxED lets you
attach ARexx programs to Menu items so now you can add a menu item
"justify" that becomes part of the editing environment. Now this is
not more than any particular macro package can do either. Except
that what if MicroEMACS takes the same basic commands as TxED+ ?
If so you paragraph justification program will work equally well on
**both* editors.

Big deal, you might think so you establish some defacto standards and
a bunch of editors can share macros. And you're right it isn't much
of a big deal (but it's a start). No the real power becomes evident
when the thing on the other end of your ARexx program *isn't* ARrexx.

You can add another program into the loop. Consider TeX the text formatter
that Radical Eye Software sells. Now instead of selecting a region
in TxED+ and selecting "justify" you identify the region and select
"typeset". Suddenly a screen jumps to the front and your text is
displayed, fully justified with all the various margins and such set.
Now you have *leveraged* TxED by giving it typesetting abilities thru
TeX. Now how much would you pay ? [just kidding]. Now let's bring it
closer to home, what about a compiler that has a ARexx port? Now you

vkr%osupyr.mast.ohio-state.edu%UDEL.EDU@cunyvm.cuny.edu (10/04/88)

Received: from CUNYVM by CUNYVM.BITNET (Mailer X2.00) with BSMTP id 7079; Tue,
 04 Oct 88 01:04:52 EDT
Received: from UDEL.EDU by CUNYVM.CUNY.EDU (IBM VM SMTP R1.1) with TCP; Tue, 04
 Oct 88 01:04:49 EDT
Received: from Louie.UDEL.EDU by Louie.UDEL.EDU id ap10567; 3 Oct 88 18:16 EDT
Received: from USENET by Louie.UDEL.EDU id aa10438; 3 Oct 88 18:01 EDT
From: vkr%osupyr.mast.ohio-state.edu@UDEL.EDU
Subject: Re: ARexx question
Message-ID: <4388@louie.udel.EDU>
Date: 3 Oct 88 21:58:13 GMT
To:       amiga-relay@UDEL.EDU
Sender:   amiga-relay-request@UDEL.EDU

Received: from CUNYVM by CUNYVM.BITNET (Mailer X2.00) with BSMTP id 5161; Fri,
 30 Sep 88 20:34:14 EDT
Received: from UDEL.EDU by CUNYVM.CUNY.EDU (IBM VM SMTP R1.1) with TCP; Fri, 30
 Sep 88 20:34:09 EDT
Received: from Louie.UDEL.EDU by Louie.UDEL.EDU id aa14157; 30 Sep 88 16:56 EDT
Received: from USENET by Louie.UDEL.EDU id aa14052; 30 Sep 88 16:48 EDT
From: "Vidhyanath K. Rao" <vkr@osupyr.mast.ohio-state.edu>
Subject: Re: ARexx question
Message-ID: <894@osupyr.mast.ohio-state.edu>
Date: 30 Sep 88 20:13:08 GMT
Organization: Dept of Math., Ohio St. U. at Newark
To:       amiga-relay@UDEL.EDU
Sender:   amiga-relay-request@UDEL.EDU

In article <8759@watdragon.waterloo.edu> bmacintyre@watsol.waterloo.edu (Blair
 MacIntyre) writes:
>Ok, I've been reading about ARexx, programs that support it, etc. [...]
>  What exactly is it the point of having an ARexx port in a program? [...]

There are two advantages: The first is getting a full fledged macro language
(almost) for free. Right now that seems to have caught everybody's attention.
Especially since macros with loops, condintional execution and recursion are
not that common in many applications running on micros.

Another advantage is the fact that AREXX allows the end user to 'integrate'
programs of his/her choice. For example, I can use Emacs or DME or TxEd(Plus)
or UEdit or (you get the idea) with AmigaTeX and do so in an integrated fashion
like in the built-in editors on certain other micro implementations. The key
point is that it is I who selects the editor.

There is a whole new territory that is as yet unexplored: ARexx function hosts.
Since I don't know of any example (except ARexx itself) I don't know what is
possible, but it is promising.

------------------------------------------------------------------------------
[What is a signature and how do I get one]
                        Nath Rao
                    vkr@osupyr.mast.ohio-state.edu

vkr@osupyr.mast.ohio-state.edu (Vidhyanath K. Rao) (10/04/88)

In article <2744@sugar.uu.net> peter@sugar.uu.net (Peter da Silva) writes:
>Actually, it would be pretty hairy. You would have to set up an interactive
>interface to what is essentially a batch program. I'd rather have a filter
>that grokked the output of make and cc and sent the commands to the editor.
>Kick it off from wsh. How about Arexx itself? You can pipe to it in wsh.
>
>Why, look, you don't need that port after all!

AmigaTeX, like all faithful TeX implementations, is batch oriented.
(Yes it has loop mode but that is an add-on. I would like it on the
compiler too so that it doesn't take up space on VD0:)
Yet it works quite well with an ARexx port. At worst you will have to
take an exception on the ARexx port signal. 
Yes you do need another modification: the compiler must stop after every error
rather than after every five or only at the end. That very well could be
selectable at the invocation.
If you want to know how a compiler+ARexx+editor setup must work, take look
at AmigaTeX.

-------------------------------------------------------------------------------
What is a  signature and how do I get one?
						Nath Rao
					vkr@osupyr.mast.ohio-state.edu

bmacintyre@watcgl.waterloo.edu (Blair MacIntyre) (05/02/89)

Ok, heres a simple(?) ARexx question:

	How can I get the output of a DOS program, say date or
"ls -l fred", etc. into a variable inside of an ARexx program?
I couldn't find anything skimming through the manual, so the
closest I could get was something like:

	date ">pipe:date"
	call open mydate,"pipe:date",read
	datestr = read(mydate)
	call close mydate
	
which seems very round about, to me anyway.

	What I am trying to do is modify Archie.rexx to behave like
the temporary backup deamon on Unix - I want it to create a directory
for each file ( no problem ) and store modifications in it with the
filenames being the timestamp it was changed at.

Speaking of which, does anyone have ( or know where I can get )
some more Rexx scripts?  Mostly for learning/modifying ...
not BIX please, I have no access to that!

Thanx,
 Blair, slowing dwindling to being just another Amiga "user"
        ( I wish I had a project on my Amiga ... sigh )
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-///-=
= Blair MacIntyre, bmacintyre@watcgl.{waterloo.edu, UWaterloo.ca}     \\\///  =
=   now appearing at the Computer Graphics Lab, U of Waterloo!         \XX/   =
= "Don't be mean ... remember, no matter where you go, there you are." BBanzai=

mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) (05/03/89)

In article <9479@watcgl.waterloo.edu> bmacintyre@watcgl.waterloo.edu (Blair MacIntyre) writes:
<
<Ok, heres a simple(?) ARexx question:
<
<	How can I get the output of a DOS program, say date or
<"ls -l fred", etc. into a variable inside of an ARexx program?
<I couldn't find anything skimming through the manual, so the
<closest I could get was something like:
<
<	date ">pipe:date"
<	call open mydate,"pipe:date",read
<	datestr = read(mydate)
<	call close mydate

There's a tool that comes with wshell - "execio". Use it, like so:

	'date | execio var datestr'

done.

Furthermore, you can get multiple lines, for instance:

	'execio read' file 'stem data.'

data.0 will have the number of lines, and data.[1-#] will have the
lines. This is about an order of magnitude faster than reading the
stuff in yourself.

execio also does "grep-like" things for you. For instance, to get the
free space on the disk whose name is in volume, I do:

	'info | execio locate' volume 'for 1 var infoline'
	freespace = word(infoline, 4)

Of course, "info volume" could also be used and you could drop the
"for 1".

	<mike

--
I'm gonna lasso you with my rubberband lazer,		Mike Meyer
Pull you closer to me, and look right to the moon.	mwm@berkeley.edu
Ride side by side when worlds collide,			ucbvax!mwm
And slip into the Martian tide.				mwm@ucbjade.BITNET