Skip to content

A Case Story about Moving an APL Application

Vector 8:2, page 127

development practice applications

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

When I read the Editorial in Vector Vol.7 no.4, about the differences between APL Dialects, I was inspired to tell the following story.

It all started back in October 1990, when I was asked about the possibility of moving an APL-application from one machine to another. Having already participated briefly in a similar move, I said that of course it was possible. I even added that there was a standard way of doing so. Little did I know the kind of problems that awaited me. I was told that the application used Digital’s APLSF and ran on an old DEC20. This machine would soon be taken out of service and my job was to ‘save’ this application. The new platform for the application was to be APL2 under VM/CMS on one of the IBM-mainframes, since VSAPL was closed down just one month earlier.

As background information it may be mentioned that the application was located in one of three banks that were to be merged, but I in another where I had my APL-experience (mostly VSAPL). The application was a data base of real estate etc. owned by the bank together with taxation formulas.

Since I had no knowledge about APLSF or this application, I asked for an APL-manual on APLSF and the documentation. I got both at the beginning of December. From a friend I also got an important copy of APL-Quote-Quad vol.9 no.3 (March 1979) with the full WSISO-standard. In addition I had a copy of 4 pages from MicroAPL, with a good example of how to write the functions in the “old” system.

The APLSF-manual showed me a range of specialities:

  • ⎕AV has 512 elements (9-bit per element).
  • The files were component-files.
  • Filehandling with quad-arrow-primitives as in APL.68000.
  • A $-format much alike ⎕FMT.
  • Monadic decode and epsilon as special executes (unquote).
  • The “;” separator.
  • Printing as part of the session with special characters to start and stop the printer.

The documentation was quite good except that the latest changes in functions were missing. But I could see about 240 functions to move and the specialities above were heavily used in the functions. In addition there was an undocumented use of monadic omega as an index generator from booleans.

Late December I finally got access to the system at another office some 3 miles away. They had an old VDU (not cleaned for years) but there was no full-screen facility. Happily I started the old del-editor and I was soon able to do a first test only to get the nice message ‘WS FULL’. As far as I could see the reasons were limited workspace and many space-consuming booleans (i.e. one boolean used 36 bits, or one word). According to the WSISO-standard the booleans were necessary because of the conversion from a 9-bit structure to a more common 8-bit. It was then necessary to rearrange the sending functions in a more space-economic way. I had to use a lot of time on other work but in mid-January 1991 I was told that the DEC20 would be closed on February 1st. This date was not the greatest problem as the final tapes with functions and data were shipped to the IBM-site on January 31st.

There were no real problems with reading functions or data to APL2 as ⎕TF is very easy to work with. One minor problem was that every time the DEC20 delivered 36 bits I received 40 bits at the IBM-machine. It turned out to be necessary to throw away bits 33-36 and not the last four. Another problem was the first of my three translation-table errors. The high minus was translated to a normal minus although this was easy to handle for the data.

The case was put aside again for some months, but in May the process could continue. In advance of the real work a few decisions had to be made:

  • Format by example should replace the $-format.
  • A locally developed “object-file system” using function and variable names as “keys” should replace the component files.
  • Printing through library-routines.
  • The omega function should be replaced by a subroutine.
  • The user should be able to use a terminal (PC) without the APL-symbols.

The work was time-consuming. Every function should be revised and with 240 functions I had to use about 8 full days for the first pass. The most time-consuming parts were file-handling and printing because no utilities were used. The three translation errors used considerable time as well.

Of course, I discovered some ‘bugs’ during the test-phase but nothing very serious. I will mention that negative numbers require that format by example is precisely handled.

The application is now running and appears as it did on the old machine. I am planning a change to a modern full-screen-interface.