Skip to content

A First Look at the ISI APL/Windows (APLIWIN) Beta Release

Vector 9:4, page 64

reviews implementations

Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 64

SHARP APL under Windows

When I.P. SHARP Associates ported their SHARP APL from the mainframe to the PC, they chose the unusual route of emulating an IBM/370 mainframe on the PC, and running the unchanged mainframe APL under it. This produced a solid, but very slow, implementation of APL. It was definitely too slow to run the large applications typical of the SHARP APL mainframe environment.

SHARP APL/PC never became commercially important in the APL arena, and was subsequently reclassified as shareware. Iverson Systems Inc. (ISI) acquired the rights to the product from Reuters, and developed several new releases, making it faster and better integrated into the PC architecture.

ISI APL/Windows (APLIWIN) is a major step in that effort, for it seamlessly integrates SHARP APL into Windows. At its core, it still emulates a /370 mainframe, but by using the 32-bit protected mode of the 386 architecture and Windows enhanced mode, it does this much quicker than its predecessors, and also provides large workspaces.

The following notes are based on the Beta release copy of October 1992, marked as APL release 5.0. ISI’s Eric Iverson told me that a new release is planned for April, with significant improvements in the Windows interface and corrections of some of the deficiences that are mentioned in this article.

Language and System Features

APLIWIN features the same language elements as SHARP APL Version 20. This includes nested arrays, operators, packages, a component file system and complex numbers. However, it suffers from the same implementation restrictions as does the mainframe version: operators do not accept defined or derived function arguments and defined operators do not exist. These and some other restrictions have been removed in SAX, the Unix implementation of SHARP APL.

An aside about language differences: The SHARP APL language is different from the APL2 family in many respects. It emphasizes the uniform rectangular and multidimensional nature of arrays over arbitrary nesting. A very important concept of control is the rank of subarrays on which a function is applied directly; in APL2 on the other hand, the depth is more important. The rank concept assumes that a regular, rectangular structure is the normal case, whereas APL2’s nesting and depth concept assumes nonuniformity as normal (see J.P. Benkard, Nested arrays and operators, APL’92 Conference Proceedings, St. Petersburg, July 1992, p.7).

Shared variables and a bundle of Auxiliary Processors were available in SHARP APL/PC under DOS, implementing a somewhat crude multitasking scheme, which was not easy to use from APL. This approach has been abandoned for Windows, and has been replaced by a handful of quad-functions. One family of thirteen system functions provides access to DOS files; some others translate between APL characters and ASCII, and provide a Window editor and link to the Window Driver (see below).

Windows Features

The Session Manager and Window Driver are the same as provided with the PC version of J.

  • Session Manager and Editor: A simple yet sufficient session manager provides for an input area and an editable and scrollable session transcript in a window. It allows cut and paste into the clipboard through DDE.

    A self-contained cover function to invoke an editor is provided in a workspace. The editor handles both functions and text variables.

  • Window Driver: A quad-function and a cover function interface to the Windows GUI through a little language of its own. The reference for this language takes eight pages in the documentation, and a description is beyond the scope of this First Look. Briefly, the approach taken resembles PostScript, in that a program is represented as human-readable ASCII text. It has some object-oriented features, as is to be expected for controlling a hierarchical windows environment. The language supports graphics, and a demo workspace gives some nice illustrative examples of these features.

    Although there is no comprehensive workbench for building a user interface, the basic tools to build an application interface that takes full advantage of the Windows GUI are available.

  • TrueType APL font: The APL font supplied with the product can be used from all Windows applications, and looks nice. Being a TrueType font, it scales well to any size.

  • Printing: There is no built-in command to print. Text to be printed can be copied through the clipboard to an application such as Windows Write. Alternatively, a function supplied in a workspace writes an object to a file and invokes Write through the Window Driver. With the supplied TrueType APL font, good looking APL documents can be produced in a flexible way. However, the facility cannot be used for printing reports without user involvement.

  • Debugger: Although SHARP APL includes the venerable trace and stop vectors, APLIWIN provides a much more powerful debugging aid: a set of function keys can be enabled with a toggle, and they can be used to execute a statement and stop at certain points. Stop points can be set for each function, or can be selected from the first or next line of any function, the current or lower function, or the calling function. As the execution proceeds, the stack and the currently executing function are shown in two separate windows. However, the results of executing the function lines are not shown, unless trace vectors are used.

Problems in the Beta Release

  • It is difficult to import or export an APLIWIN workspace to or from another APL system, including even SHARP APL on the mainframe. The WSIS workspace transfer mechanism should be available for this. I hacked a version taken from SHARP APL mainframe, in order to test some applications, but a proper job should be done here. Eric Iverson told me that a transfer facility will be included in the April release.
  • The library name convention was taken from the original SHARP APL/PC. It associates PC drive letter with file account numbers. DOS path names are not allowed. This convention is old-fashioned and impractical. APL should instead adopt the convention of the underlying file system.
  • The DOS file quad-functions signal domain error for a wide range of invalid arguments. It is sometimes difficult to find the real problem. More specific error reports would be useful.
  • The non-TrueType font required for Windows 3.0 was missing from the disk I received. TrueType under Windows 3.1 provides a much better font support anyway, so I can only recommend the upgrade. Eric Iverson told me that the release version will be announced for Windows 3.1 only.
  • I encountered a few Unrecoverable Application Errors under Windows 3.0, but none under 3.1.
  • Besides the few differences from the mainframe language that are mentioned in the documentation, dyadic ⎕fhold is missing. These differences are not critical to single-user PC applications, but could be a problem if application code is to be taken unchanged from the mainframe.

Comparison with the Mainframe Speed

I’ve tried to measure the speed of APLIWIN on my PC (66 MHz 486 DX2) and compare it to the speed of SAPL on a mainframe (the Risk Management Software RMX system). I used my AIDA workspace (an APL-like interpreter in APL) as the benchmark. It is very CPU intensive, and also uses files, but no screen I/O.

APLIWIN delivers about the equivalent of 3 mainframe CPU units per second (a SAPL CPU unit is one second of CPU time on an IBM 370/158). The RMX mainframe APL delivers about 75 CPU units per second under normal user load. This enables one to decide which applications could be ported; many applications typical of SHARP APL are clearly not candidates, since their interactive transactions (which consume 200 CPU units) typically take 2-3 seconds on the mainframe, but would run for more than a minute on the PC.

It would be interesting to compare APLIWIN’s speed to other PC APLs, and to Dyalog APL/W with the SHARP APL-to-Dyalog translator from Insight Systems ApS. However, such comparison are beyond the scope of this First Look.

Martin Gfeller
Reuters Risk Management Software
Kleinstrasse 6
CH-8008 Zurich
Switzerland