[ art / civ / cult / cyb / diy / drg / feels / layer / lit / λ / q / r / sci / sec / tech / w / zzz ] archive provided by lainchan.jp

lainchan archive - /λ/ - 18314

File: 1472595429900.png (276.38 KB, 224x300, jigsaw.jpg)


This is the APL thread. The intent is that APL programs, literature, techniques, and general musings may be shared here.
Here is a link to the APL standard document; it is actually a gzipped PDF: https://www.math.uwaterloo.ca/~ljdickey/apl-rep/docs/is13751.pdf

Here are questions to encourage discussion:
Which implementation do you prefer?
Do you prefer standard APL or a different dialect?
What first drew you to APL?
What do you consider to be the strengths and weaknesses of APL?
What is your APL environment?
What programs written in APL do you use?
Is APL your main language?


GNU APL limps along. I want to help, but it's written in C++. I use APL to avoid languages such as C++.

Here's one fun way to crash GNU APL: ↑⍳1000000000

First is a reasonably easy function to optimize, considering it returns the first thingy of an array. The idiom ↑⍳ is very easy to optimize. If iota is not passed zero, it will not return an empty array and so the result is ⎕IO, otherwise the result is zero. Regardless, the result is always one or zero, without fail, as ⎕IO may only be one or zero.

That's what makes it so interesting that GNU APL seems to go through the trouble of generating the entire array for this operation. Most anyone should be able to look at APL and realize optimization relies on the recognition and replacing of idioms with equivalent but less intensive computations.


Finally, an APL thread
I just started learning it, I'm starting to read Kenneth Iverson's book.
Not every OS ports APL, and the keyboard is also daunting, so here are two tips:
> Get your keyboard into APL mode in X
setxkbmap us,apl -option grp:caps_toggle
Change us for your regional keyboard if needed, that's your main layout. Change caps_toggle for your preferred toggle key, info here:
>My OS doesn't port an APL interpreter
the BSDs are an example, luckily some guy did this

>What first drew you to APL?

The notation, it's pretty cool. I eventually liked how it manipulates bodies of data at once, and how it can stretch them and put them back together.
Another thing I liked was how simple it really is: operators take either 1 or 2 arguments, some of them take other operators. I particularly liked the cross product operator


I've never used APL, what's an example of a problem it's a good fit for?


As someone who works full time in APL, fuck APL. Or at least APL2000's implementation of it.

I kind of think APL is just a broken idea though. It seems like the better APL implementations are better by virtue of their adoption of non-APL features, like object systems and closures. However, I am negatively biased by the codebase I'm forced to work in, and the implementation I'm forced to use. I'm open to be persuaded, but after 4 years at my currently employer, I doubt my opinion will be swayed by an anonymous imageboard.


What's wrong with it, Lainon?


Anyone here use J?


I'm not familiar with APL2000.

Regardless, what does this project actually do? APL is very suited to certain types of programs, but may very well be a worse fit with what you're doing.


How to look cool on the internet.


APL is still used for many operations databases are now commonly used for.

It's good for easily and succinctly performing operations on large amounts of data.


I want to try out GNU APL, but I cant find any instructions on how to switch into the APL keyboard layout. Im using Mint, shouldnt I be able to just use the keyboard layout GUI utility that comes with my desktop environment?

>Anyone here use J?
Why use J when you can use K, its is similar to J but adds some Lisp features.

>As someone who works full time in APL, fuarrrk APL. Or at least APL2000's implementation of it.
Pretty much every implementation of APL are old and proprietary and are no longer maintained and obsolete. I think the only one worth using is GNU APL


What a shame that this thread doesn't have much activity, yet.

>I want to try out GNU APL, but I cant find any instructions on how to switch into the APL keyboard layout. Im using Mint, shouldnt I be able to just use the keyboard layout GUI utility that comes with my desktop environment?

I use GNU APL Mode with Emacs: https://github.com/lokedhs/gnu-apl-mode/
Then use set-input-method to change to APL-Z.
To view the layout, use gnu-apl-show-keyboard.

I've never bothered using the plain utility. Changing keyboard layouts in GNU/Linux is a horrible pain.

If you don't normally use Emacs, it should be simple enough to only use it for this APL.


thanks for this info!

unfortunately after installing gnu-apl-mode Im getting a 'with-eval-after-load' function error when I try to run M-x gnu-apl, so I cant play with this until I find a fix

but thanks!


setxkbmap us,apl grp:win_switch
The "Win" key here is used to toggle between layouts, look alternatives up with
$ grep "grp:.*toggle" /usr/share/X11/xkb/rules/base.lst

Then you just toggle back and forth from between us/apl keyboards with that key


So since GNU APL aparently is like kicking dead whales down the beach, what's a good implementation?

Is there a good free one? NARS2000? J (not technically APL, but Iverson wrote it, so close enough)? Something else?


Outside of finance, does anyone actually find work with APL?


>>Why use J when you can use K
Because J has a single complete open-source implementation. Installing 3rd-party libraries is easy.

K is a moving target, and there are many different, incompatible implementations. The official implementation of K4 costs $$$. The official implementation of K5 is available only if you have a login at kparc.com

To me, K's biggest advanage is that its syntax/grammar is MUCH simpler than J's.


you can obtain an unregistered version of Dyalog with a popup ad though you can register a non-commercial (or student) license with them easily enough too.

also worth checking out Mastering Dyalog APL available for free from their website.