Question

Is there a way to open up a text editor, type up some APL code, save it as a file, and then open it in Dyalog or MicroAPLX to execute the code? Or is that what workspaces are?

Was it helpful?

Solution 2

APL was invented well before the widespread availability of file systems and text editors. Therefore it provided its own facilities to store and edit code (functions) and data, namely Workspaces and Component files. Most commercial APL systems of today still provide them, for continuity with existing installations and with developer expertise.

But those facilities date back to half a century ago and were designed for the hardware and interfaces of the time (mainframes and teletypes) which are to modern hardware as hand crank telephones are to smartphones.

Nowadays most developers would argue that code is best kept in (UTF-8 encoded) text files, edited with one's text editor of choice, and managed with a distributed version control system. I certainly subscribe to this view.

Some of the classical APL vendors have kept their offers "up to date" in this regard and provide facilities to deal with source code files, in a manner hopefully not too disjoint from workspaces. Dyalog APL has such a library called SALT - Simple APL Library Toolkit.

But the truth is, most APL systems don't have an easy command or function to load a source file because it's simply not used in practice. APL developers regard their APL system as an IDE, almost an OS. They keep everything inside workspaces and just use the editing windows provided by the system.

IMHO newer APL implementations (such as GNU APL and others) will eventually reject the concept of workspaces and align themselves with "modern" practices. But this is just my view, which is certainly not shared by the majority of APL programmers. Ask any of them about it and you will hear something along the lines of: ≪You can have my workspaces and component files when you pry them from my cold, dead fingers.≫

OTHER TIPS

@Tobia already gave a good answer regarding APL in general, but I would like to add some details concering what you can do with GNU APL and Emacs. With the GNU APL mode for Emacs (I am the author of this mode) you can keep APL code in source files (with the .apl extension) and execute code directly from the files. There is also some basic code navigation features (M-. moves to the location where a function was defined).

There is still work to be done to improve things but I would love to get comments as to what features people would want to see added.

Dyalog 14.0 has a command line option for scripts. On a Unix-like platform the first line of an executable script file could be

#!/path/to/dyalog -script

No, there was never a single file type for APL workspaces. APL was always and still is very vendor-dependent - each vendor had its own internal format and file extensions for workspaces. Some extensions were .DWS, .W3, .WS, just to name a few. APL language features aside, the proprietary internal formats used by the various vendors were profoundly different and wildly incompatible. Further, a newer APL interpreter might be unable to open an older workspace past a certain vintage, for example, a newer Dyalog 16.0 interpreter would be unable to open a workspaces saved with Dyalog Version 8.0. The same was true with APL+2000.

Offhand, the only system-level compatibility I can think of for workspaces from the same vendor was the )MCOPY command in Mainframe IBM APL2, where APL2 could directly read the older VSAPL workspaces. Otherwise, there was plenty of good APL migration software to handle this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top