Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a file type for APL programs?

Tags:

apl

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?

like image 765
Gandalf the White Avatar asked Jan 31 '14 19:01

Gandalf the White


2 Answers

@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.

like image 78
Elias Mårtenson Avatar answered Sep 19 '22 15:09

Elias Mårtenson


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.≫

like image 20
Tobia Avatar answered Sep 21 '22 15:09

Tobia