Skip to content

Review: APL*PLUS/PC Release 9

Vector 6:4, page 54

reviews implementations performance

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

Introduction

I assume that APL*PLUS/PC needs no introduction. It has been the de facto standard PC APL system for the last 5 years, and is only now beginning to be challenged by IBM and Dyadic, with their new 32-bit APLs.

This review is aimed at existing APL*PLUS/PC users, who may be wondering whether they should upgrade to version-9. Consequently it concentrates on the new features in this release, and takes as read the general excellence of this product.

The Infamous Smith Benchmarks

I am going to have to give this up! Every time I benchmark one of STSC’s interpreters, it is a little bit bigger, and goes a little bit slower.

      ∇ MAKEOBJ
[1]     V←1000⍴ 4 5 6 0
[2]     M← 100 10 ⍴ 2.5 6.7 0 0 8 ¯5.7
[3]     S←10000⍴'THE CAT SAT ON THE MAT '
[4]     S[999+⍳6]←'ADRIAN'
[5]     I←100?1000
[6]     B←10000⍴V=6
[7]     FF← 800 5 ⍴'TR HGHJ TYE HJBG UGFHF HJ'
[8]     FF[601;]←'EJD..'
[9]     'ALL DONE'
      ∇

I make no claims for the truthfulness of these tests, but at least I can claim a continuity back to Vector 1.4! I feel that the only one worth looking at is FN 1000, which is a simple looper, and does almost no other processing. It seems to me to correlate rather well with the perceived ‘feel’ of the various APL systems I have tested.

APL Expression                       Type      Vn.5   Vn.8   Vn.9   Ext.9
--------------                       ----      ----   ----   ----   -----
⌊⎕WA÷1024                            ⍝ WA      367K   342K   335K   204K

T←⎕TS ⋄ +/V+V   ⋄ DO ⎕TS-T ⍝ INT ....   350    380    390    390
T←⎕TS ⋄ +/V[I]  ⋄ DO ⎕TS-T ⍝ INT ....    50     60     60     80
--------------------------------------------------------------------
T←⎕TS ⋄ V+.×V   ⋄ DO ⎕TS-T ⍝ RL  ....   380    440    460    490
T←⎕TS ⋄ +/V*2   ⋄ DO ⎕TS-T ⍝ RL  ....  3680   3840   3860   3900
T←⎕TS ⋄ X←+/M   ⋄ DO ⎕TS-T ⍝ RL  ....   660    710    710    720
T←⎕TS ⋄ V+.×,M  ⋄ DO ⎕TS-T ⍝ RL  ....  2140   2260   2260   2310
--------------------------------------------------------------------
T←⎕TS ⋄ +/S='T' ⋄ DO ⎕TS-T⍝ CH   ....  3630   3840   3840   3790
T←⎕TS ⋄ 'FAT'∊S ⋄ DO ⎕TS-T⍝ CH   ....    60     60     60    110
T←⎕TS ⋄ X←S∊'FAT' ⋄DO ⎕TS-T ⍝ CH ...   2520   4730   4370   4670
--------------------------------------------------------------------
T←⎕TS ⋄ X←B∨B∧~B ⋄ DO ⎕TS-T ⍝ BL....   4840   5540   5540   5550
T←⎕TS ⋄ ∧/B      ⋄ DO ⎕TS-T ⍝ BL....    110    160    160    210
T←⎕TS ⋄ X←∨\B    ⋄ DO ⎕TS-T ⍝ BL....    220    280    280    300
--------------------------------------------------------------------
T←⎕TS ⋄ FN 10    ⋄ DO ⎕TS-T ⍝ FN....    330    440    490    510
T←⎕TS ⋄ FN 100   ⋄ DO ⎕TS-T ⍝ FN....   3100   4060   4230   4280
T←⎕TS ⋄ FN 1000  ⋄ DO ⎕TS-T ⍝ FN....   30.3s  41.4s  43.5s  43.2s
--------------------------------------------------------------------
T←⎕TS ⋄ X←FF∧.='EJD..'  ⋄ DO ⎕TS-T ⍝    60     90     90     90
T←⎕TS ⋄ X←FF∧.=⍉20 5⍴'EJD..'⋄DO ⎕TS-T⍝33.6s 37.5s 37.5s  37.5s
====================================================================
      ∇ FN N;CT;X
[1]     CT←0
[2]    LP:→(N<CT←CT+1)↑EXIT
[3]     X←+/ 2 3 ⍴⍳6
[4]     →LP
[5]    EXIT:'DONE'
      ∇

The timings on the extended system are rather less reliable, as there seemed to be a much greater variation than with the standard system. This may have been a result of the reduced workspace, or it may be something in the call/return mechanism between the session manager and the interpreter. Either way, I kept APLSM.EXE on my hard disk just long enough to do these checks.

In summary, by upgrading to Version-9 you will lose 7K of free workspace, and you can expect a degradation in speed of between 2% and 5%. In my view, the ‘extended system’ was a bad mistake by the STSC marketing department, and you would do best to ignore it.

What do you get from Version-9?

UK readers should refer to Cocking & Drury’s news on page 15 for the support implications. Those of us who are still mostly on release-5 regard this as a bit of a red herring, indeed I recently had a letter from a contented user of release 3!! However if you work for the kind of company that hates the idea of ‘unsupported products’ you obviously need at least 1 copy of release-9 to reproduce your problems in!

Other than continued support, some of the things you get for your money are listed in STSC’s ‘Summary of Changes’, which comes with the product. These are the usual mix of minor fixes (relevant only to ⎕WIN hackers), and genuine enhancements. Here they are:

  • properly typeset manuals. These are a huge improvement; they are much better organised, and much easier to read. I actually found a couple of ⎕WIN features I had previously totally overlooked, simply because of the terrible presentation in the old manuals. Important bits like the installation instructions are easy to find, and very clearly set out.
  • even bigger numbers in the e= startup parameter. In theory, you can shift rather more of the interpreter into upper memory than you can with e=8192 in version-8. In practice, if you can find 128K of contiguous upper memory (the bit between 640K and 1Mbyte), you are a better man than I am! I suspect this will be of use only to owners of 286 kit with some form of XMS driver; the rest of us will have to be content with the 64K bonus available via e=8192.
  • numeric editing with )EDIT and ⎕EDIT in both the standard and extended system. This is a dead handy facility, particularly as it is quite a hard thing to write efficiently in APL. Well worth a couple of K of ⎕WA.
  • simulated ] commands (as per the mainframe APL*PLUS/1000 system). These are discussed in more detail below.
  • odds and ends, e.g. an interrupt to purge the symbol table, upgraded VDI graphics drivers, better terminal emulation, a new HANDLERS workspace, and printer support for the Epson LQ printers and HP Deskjet.

Simulated ‘User Command Processor’

APL*PLUS/1000 (from release 6 upwards) has had the ability to call ‘user-defined’ commands such as ]VARS, using the ‘]’ key as an analogue of ‘)’ in conventional APLs. The system comes with a number of pre-defined commands, but a major benefit of this is that you can easily define your own, and they then become globally available to all your APL users without the need for everyone to take copies in their own workspaces.

Release-9 simulates this mechanism with a ∆UCMD function, which pulls in appropriately packaged code from a standard .ASF file, and then runs it with everything automatically localised. An example would be ∆UCMD 'FNS M*' which will list all functions beginning with ‘M’. There is a good selection of functions already included in the file, but you will almost certainly want to define new ones of your own. To this end, STSC have provided a set of utility functions, as well as very thorough documentation on the file structure, and the way the user commands operate. In particular, all the cover functions (from ∆UCMD downwards) are unlocked and well commented; this is a highly commendable move towards a more open architecture.

One of these utility functions does some amazing jiggery-pokery with ⎕PFKEY, to mimic the appearance of a ‘]’ on the screen, while actually executing ∆CMD '⍞'. Much as I hate this sort of subterfuge, it works reasonably well, as long as you can train yourself to hit F5 whenever you want ‘]’. A slight snag is that the command is left on the screen in the normal way, and you might get tempted to take the cursor back up to it for another go … this will of course give you a SYNTAX ERROR!

  • ]EDIT … native file editing, but at least you can stop this from putting Ctrl-Z on the end! the APL*PLUS II )EDIT did some really nasty things to my LOGIN.SQL; this is much better!
  • ]FNS … basically this does what )FNS should have done all along; a proper wild-card match, and the ability to list functions from another workspace.
  • ]LIB … a much tidier file listing.
  • ]WSLOC and ]RENAME … find and replace names throughout the workspace. Most of us already have something similar, but if you are new to APL you will find both of these invaluable.

These are the obviously useful ones, and they all work equally well in release 8. My only minor gripes are: (a) they are a bit slow on anything other than a 386 machine; (b) please can we have ‘]’ recognition built in to the interpreter.

Summary

Users of slow old 8088 PCs (like me) should ignore all the above; nothing is worth a 40% loss of speed, or 32K of ⎕WA, so stay with release 5. If you have access to reasonably up to date hardware (say a 20MHz 386), the upgrade to version-9 is well worth the trouble, but please leave APLSM.EXE in its wrappings, and stick with the standard system.