5 ms·
Now try to type both and see how much time it takes. Or even better, choose a math problem that makes you experiment and try to express it in both. If you try i
by rscho 7y ago
Now try to type both and see how much time it takes. Or even better, choose a math problem that makes you experiment and try to express it in both. If you try it long enough, you'll see why it's not stupid.
APL is often described as a calculator, and at least to me it's exactly that. If you are programming math and even more so arrays, you can't beat array languages.
I say that as a scheme fanboy, and I'm currently implementing J in Racket. Incidentally, Aaron Hsu is not only an APL expert but also a seasoned schemer, and it's not for nothing he came up with the "disposable code" idea.
So very much not stupid. But as with LISP, you have put up a good try to see the value.
Also,
fib=:(-&2+&$:-&1)^:(1&<)M.
Removing memoization and defining 'plusp', 'pred' and 'ppred' as you do, we can get it down to 10 tokens without any golfing, which is less than half your example for the same trivial program.
And furthermore,
fib"0 >: i. 4 5
1 1 2 3 5
8 13 21 34 55
89 144 233 377 610
987 1597 2584 4181 6765
- theamk 7y agoRe typing, I bet both Python and Lisp will be faster to type. I am typing English-like text all day already - in form of emails, papers, comments and so on, so I am proficient. Switching to exotic APL syntax will make me type much slower.
- rscho 7y agoWell, you should try it and see if you are right, then. APL really excels at quick experimentation for mathematically-oriented programs. Tacit J even more so (which is what I used above).
- jakeogh 7y agoI got fast at CTRL-m /frac /partial bla bla in LyX, how are APLers entering that unicode?... digging into the vids...
- jodrellblank 7y agoIt varies; they tend to follow to the keys on the early IBM dedicated keyboards with APL keys, styled like this: https://www.dyalog.com/uploads/images/Business/products/us_rc.jpg https://www.dyalog.com/uploads/images/Business/products/us_r... Nars2000 on Windows has its own application-specific key combos, with Alt+Key for the "lowercase" one and Alt+Shift+Key for the "uppercase" one. Dyalog APL, one of the popular commercial ones on Windows, installs a Windows system-wide input method which uses Ctrl+Key and Ctrl+shift+key; you can switch to it in any program. TryAPL.org uses a preceeding backtick so `w becomes omega, and there's a JavaScript bookmarklet which can add that to any text input on any browser page, here: https://abrudz.github.io/lb/apl https://abrudz.github.io/lb/apl (No idea what people are doing on *nix keyboard entry).
- jodrellblank 7y agoYou can see Aaron Hsu typing out his APL compiler during a talk here: https://youtu.be/ABG5eSCZPrE?t=686 https://youtu.be/ABG5eSCZPrE?t=686 (readable if you increase the video quality setting) And you can see both that he is fluent at typing it, and that typing is not the bottleneck when few-character blocks of code are doing large chunks of tree manipulation; thinking or talking is.