ARexx

Last updated

ARexx is an implementation of the Rexx language for the Amiga, written in 1987 by William S. Hawes, with a number of Amiga-specific features beyond standard REXX facilities. Like most REXX implementations, ARexx is an interpreted language. Programs written for ARexx are called "scripts", or "macros"; several programs offer the ability to run ARexx scripts in their main interface as macros.

Contents

ARexx can easily communicate with third-party software that implements an "ARexx port". Any Amiga application or script [1] can define a set of commands and functions for ARexx to address, thus making the capabilities of the software available to the scripts written in ARexx.

ARexx can direct commands and functions to several applications from the same script, thus offering the opportunity to mix and match functions from the different programs. For example, an ARexx script could extract data from a database, insert the data into a spreadsheet to perform calculations on it, then insert tables and charts based on the results into a word processor document.

History

ARexx was first created in 1987, developed for the Amiga by William S. Hawes. It is based on the REXX language described by Mike Cowlishaw in the book The REXX Language: A Practical Approach to Programming. [2] ARexx was included by Commodore with AmigaOS 2.0 in 1990, and has been included with all subsequent AmigaOS releases. This later version of ARexx follows the official REXX language closely; Hawes was later involved in drafting the ANSI standard for REXX.

ARexx is written in 68000 assembly language, and cannot therefore function at full speed with new PPC CPUs, a version of ARexx has not been rewritten for them and is still missing from MorphOS 3.0. William Hawes is no longer involved in development of Amiga programs and no other Amiga-related firm is financing new versions of ARexx. Notwithstanding this fact, the existing version of ARexx continues to be used, although it is not distributed with MorphOS.

From the ARexx manual:

ARexx was developed on an Amiga 1000 computer with 512k bytes of
memory and two floppy disk drives. The language prototype was
developed in C using Lattice C, and the production version was written
in assembly-language using the Metacomco assembler. The documentation
was created using the TxEd [3] editor, and was set in TeX using AmigaTeX.
This is a 100% Amiga product. [4]

Characteristics

ARexx is a programming language that can communicate with other applications. Using ARexx, for example, one could request data from a database application and send it to a spreadsheet application. To support this facility, an application must be "ARexx compatible" by being able to receive commands from ARexx and execute them. A database program might have commands to search for, retrieve, and save data the MicroFiche Filer database has an extensive ARexx command set. A text editor might have ARexx commands corresponding to its editing command set the Textra editor supplied with JForth can be used to provide an integrated programming environment. The AmigaVision multimedia presentation program also has ARexx port built in and can control other programs using ARexx.

ARexx can increase the power of a computer by combining the capabilities of various programs. Because of the popularity of a stand-alone ARexx package, Commodore included it with Release 2 of AmigaDOS.

Like all REXX implementations, ARexx uses typeless data representation. Other programming languages made distinctions between integers, floating point numbers, strings, characters, vectors, etc. In contrast, REXX systems treat all data as strings of characters, making it simpler to write expressions and algorithms. As is often the case in dynamically scoped languages, variables are not declared before using them, they come into being on their first use.

ARexx scripts benefit from an error handling system which monitors execution and responds accordingly. The programmer can choose to suspend and resume the execution of the program as needed.

The ARexx command set is simple, but in addition to the commands there are the functions of its Amiga reference library (rexxsyslib.library). It is also easy to add other libraries or individual functions. ARexx scripts can also be invoked as functions from other ARexx scripts. Any Amiga program which has an ARexx port built in can share its functions with ARexx scripts.

Examples of ARexx solutions to common problems

Implementing new features and capabilities via scripts

If end user is using a program which builds animations by joining various bitmap image files but which lacks image processing capabilities, he could write an ARexx script which performs these actions:

  1. ARexx locates the image files in their directories
  2. ARexx loads first image
  3. ARexx loads paint program
  4. The image is loaded into paint program which performs modifications to file
  5. The modified image is stored into another directory
  6. ARexx repeats procedure on any image in the directory
  7. The paint program is closed and the animation program is loaded
  8. The animation is built
  9. The animation is saved in its directory
  10. The animation program is closed

Avoiding repetitive procedures

EqFiles.rexx [5] is a well-known example of a simple ARexx script written to automate repetitive and boring procedures. This script uses the ALeXcompare program [6] to compare files, and then finds all duplicates in a set of files and returns output by highlighting any results in a different color.

Expand AmigaOS capabilities

One of the main features of ARexx is the fact it could expand the capabilities of the AmigaOS by adding some procedures the OS lacked. For example, a simple ARexx program could be written to print a warning message on the screen of the monitor, or play an audio alert signal if a certain Amiga program stops, faults or has finished its scheduled job.

The following script is a minimal ARexx script that displays warnings depending on events that take place.

/* Alarm.rexx */ARGevent  IFevent=0THENEXITIFevent=1THENSAY"Program has ended unexpectedly"IFevent=2THENSAY"Program has finished its job"IFevent=3THENSAY"Cannot find data in selected directory"

See also

Related Research Articles

<span class="mw-page-title-main">Macro (computer science)</span> Rule for substituting a set input with a set output

In computer programming, a macro is a rule or pattern that specifies how a certain input should be mapped to a replacement output. Applying a macro to an input is known as macro expansion. The input and output may be a sequence of lexical tokens or characters, or a syntax tree. Character macros are supported in software applications to make it easy to invoke common command sequences. Token and tree macros are supported in some programming languages to enable code reuse or to extend the language, sometimes for domain-specific languages.

<span class="mw-page-title-main">Shell script</span> Script written for the shell, or command line interpreter, of an operating system

A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A script which sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper.

AppleScript is a scripting language created by Apple Inc. that facilitates automated control over scriptable Mac applications. First introduced in System 7, it is currently included in all versions of macOS as part of a package of system automation tools. The term "AppleScript" may refer to the language itself, to an individual script written in the language, or, informally, to the macOS Open Scripting Architecture that underlies the language.

AmigaDOS is the disk operating system of the AmigaOS, which includes file systems, file and directory manipulation, the command-line interface, and file redirection.

<span class="mw-page-title-main">Windows Script Host</span> Automation technology for Windows

The Microsoft Windows Script Host (WSH) is an automation technology for Microsoft Windows operating systems that provides scripting abilities comparable to batch files, but with a wider range of supported features. This tool was first provided on Windows 95 after Build 950a on the installation discs as an optional installation configurable and installable by means of the Control Panel, and then a standard component of Windows 98 and subsequent and Windows NT 4.0 Build 1381 and by means of Service Pack 4. The WSH is also a means of automation for Internet Explorer via the installed WSH engines from IE Version 3.0 onwards; at this time VBScript became means of automation for Microsoft Outlook 97. The WSH is also an optional install provided with a VBScript and JScript engine for Windows CE 3.0 and following and some third-party engines including Rexx and other forms of Basic are also available.

In computers, a printer driver or a print processor is a piece of software on a computer that converts the data to be printed to a format that a printer can understand. The purpose of printer drivers is to allow applications to do printing without being aware of the technical details of each printer model.

<span class="mw-page-title-main">DIGITAL Command Language</span> Command language adopted by several operating systems (OSs)

DIGITAL Command Language (DCL) is the standard command language adopted by many of the operating systems created by Digital Equipment Corporation. DCL had its roots in IAS, TOPS-20, and RT-11 and was implemented as a standard across most of Digital's operating systems, notably RSX-11 and RSTS/E, but took its most powerful form in VAX/VMS. DCL continues to be developed by VSI as part of OpenVMS.

<span class="mw-page-title-main">XEDIT</span>

XEDIT is a visual editor for VM/CMS using block mode IBM 3270 terminals.

<span class="mw-page-title-main">AMosaic</span> Web browser port for Amiga computers

AMosaic was a port to the Amiga of the Mosaic web browser, developed beginning in 1993, and was the first graphical web browser for the Amiga. AMosaic was based on NCSA's Mosaic, but was not distributed by the University of Illinois or NCSA. It was developed by Michael Fischer at Stony Brook University, Michael Meyer at the University of California, Berkeley, and Michael Witbrock at Carnegie Mellon University.

<span class="mw-page-title-main">Ambient (desktop environment)</span> MUI-based desktop environment for MorphOS

Ambient is a MUI-based desktop environment for MorphOS. Its development was started in 2001 by David Gerber. Its main goals were that it should be fully asynchronous, simple and fast. Ambient remotely resembles Workbench and Directory Opus Magellan trying to mix the best of both worlds.

<span class="mw-page-title-main">Amiga Basic</span> BASIC programming language implementation for Amiga computers

Amiga Basic is an interpreted BASIC programming language implementation for the Commodore Amiga, designed and written by Microsoft. Amiga Basic shipped with AmigaOS versions 1.1 to 1.3. It succeeded MetaComCo's ABasiC, which was included in AmigaOS 1.0 and 1.1, and was superseded by ARexx, a REXX-style scripting language, from AmigaOS version 2.0 onwards.

Amiga software is computer software engineered to run on the Amiga personal computer. Amiga software covers many applications, including productivity, digital art, games, commercial, freeware and hobbyist products. The market was active in the late 1980s and early 1990s but then dwindled. Most Amiga products were originally created directly for the Amiga computer, and were not ported from other platforms.

AmigaOS is the proprietary native operating system of the Amiga personal computer. Since its introduction with the launch of the Amiga 1000 in 1985, there have been four major versions and several minor revisions of the operating system.

<span class="mw-page-title-main">Workbench (AmigaOS)</span> Graphical user interface for the Amiga computer

Workbench is the desktop environment and graphical file manager of AmigaOS developed by Commodore International for their Amiga line of computers. Workbench provides the user with a graphical interface to work with file systems and launch applications. It uses a workbench metaphor for representing file system organisation.

Amiga support and maintenance software performs service functions such as formatting media for a specific filesystem, diagnosing failures that occur on formatted media, data recovery after media failure, and installation of new software for the Amiga family of personal computers—as opposed to application software, which performs business, education, and recreation functions.

<span class="mw-page-title-main">AmigaOS</span> Operating system for Amiga computers

AmigaOS is a family of proprietary native operating systems of the Amiga and AmigaOne personal computers. It was developed first by Commodore International and introduced with the launch of the first Amiga, the Amiga 1000, in 1985. Early versions of AmigaOS required the Motorola 68000 series of 16-bit and 32-bit microprocessors. Later versions were developed by Haage & Partner and then Hyperion Entertainment. A PowerPC microprocessor is required for the most recent release, AmigaOS 4.

<span class="mw-page-title-main">Scripting language</span> Programming language for run-time events

A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.

<span class="mw-page-title-main">Rexx</span> Command/scripting/programming language

Rexx is a programming language that can be interpreted or compiled. It was developed at IBM by Mike Cowlishaw. It is a structured, high-level programming language designed for ease of learning and reading. Proprietary and open source Rexx interpreters exist for a wide range of computing platforms; compilers exist for IBM mainframe computers.

<span class="mw-page-title-main">Hollywood (programming language)</span> Programming language

Hollywood is a commercially distributed programming language developed by Andreas Falkenhahn which mainly focuses on the creation of multimedia-oriented applications. Hollywood is available for AmigaOS, MorphOS, WarpOS, AROS, Windows, macOS, Linux, Android, and iOS. Hollywood has an inbuilt cross compiler that can automatically save executables for all platforms supported by the software. The generated executables are completely stand-alone and do not have any external dependencies, so they can also be started from a USB flash drive. An optional add-on also allows users to compile projects into APK files.

<span class="mw-page-title-main">Command-line interface</span> Computer interface that uses text

A command-line interface (CLI) is a means of interacting with a computer program by inputting lines of text called command-lines. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternative to the non-interactive interface available with punched cards.

References

  1. Giguere, Eric. "ARexx Command Hosts".
  2. Cowlishaw, Michael (1985). The REXX Language: A Practical Approach to Programming (1st ed.). Prentice Hall. ISBN   0-13-780651-5.
  3. "Amazing_Computing_1986-03_067.JPG".
  4. ARexx Users Reference Manual
  5. Peruggi, Fulvio. "EqFiles".
  6. Kazik, Alex. "ALeXcompare".
Notes