APL is an under-appreciated language, pioneering many concepts that have re-appeared in almost every language since. Iverson Ghosts! Boo.
A huge hurdle for new users is those funny symbols. How does one enter them on a modern keyboard?
Wonder no longer! It's not so tough, just not documented that well on the web today. APL has its own Unicode point so all the symbols are already inside your box waiting to be used. One can even use GNU APL on an Android phone or tablet with the Hacker's Keyboard (fork for APL layout, see bottom)
One would think APL enthusiasts would have keymaps with an easy setup script to run, to encourage newcomers, but I guess not since I didn't run across any... so here's my attempt to help out any other APL-curious people out there.
BONUS: Hard-to-find APL book links. These books are out of print and insanely expensive on the used market. I manually scanned in APL2 At A Glance to save it for posterity. It really is the best introductory text for APL2.
APL2 Ein erster Einblick (APL2 At A Glance, German)
Adding an APL Keymap to X terminals
From X (any windowed terminal, eg. Konsole, xfce4-terminal etc.)
--
My preferred setup uses CAPS LOCK as the APL key:
setxkbmap us,apl -option grp:caps_switch
APL Keys For 'dfns' (lambdas)
APL Linux Console Key Map
Download my console keymap file here:
https://www.blitter.com/nextcloud/index.php/s/9oY7pEbDZeiZNfq
As root,
# loadkeys APL.kmap
Almost the same as the X mapping -- CAPS LOCK and shift+CAPS LOCK are combo keys with any other key in the GNU APL mapping for APL symbols; right-ALT is APL-mode lock.
APL fonts require running within an 'fbterm' on virtual consoles, so install that first, and if you want to use APL from the console often, start 'fbterm' and 'loadkeys' from startup.
GNU APL on Android with TermUX
* open TermUX.
* Make sure you have lots of free space on your phone, as you're going to be building GNU APL from source using g++
$ apt-get install subversion
$ apt-get install g++
## might need autotools and other things as well (automake, autoconf, etc.)
$ svn checkout svn://savannah.gnu.org/apl $ cd apl/trunk
You may have issues with network timeouts checking out the repo. If so, retry after running an svn cleanup. if you keep having trouble, fetch it on a PC Linux machine, tar+gzip the whole svn/trunk dir and then use 'scp' to just copy it to your TermUX home dir (either by installing openssh in TermUX or using an Android ssh program... but you'll have to hunt around in your phone's filesystem to find your TermUX home dir in that case...)
[Again, within TermUX]:
$ apt-get install ncurses pcre pcre2
$ cd trunk/ # wherever gnu apl source from svn was fetched
$ ./configure
$ make
$ mkdir $HOME/bin
$ cp src/apl $HOME/bin
$ export PATH=$HOME/bin:$PATH ## or set up a .bashrc or .profile with this to make it permanent
.. I might have missed a few apt-get calls required for some libraries but otherwise it did build just fine right on the phone!
Oh, and remove the svn/trunk afterwards because you'll probably be low on space :)
Finally, install the fork of Hacker's Keyboard with APL layout/language available here!
No comments:
Post a Comment