8 ms·
APL Tutorial
- gtani 10y agoI learned C and IBM APL2 around the same time for financial apps. For APL, i read the Polivka and Pakin book about 30 times, not this edition, but the red paperback I used is apparently impossible to buy. Excellent book, it got me to where i could be competitive in obfuscated APL contests: https://www.amazon.com/P-L-Prentice-Hall-automatic-computation/dp/0130388858 https://www.amazon.com/P-L-Prentice-Hall-automatic-computati...
- ktRolster 10y agoI agree, it is one of the best tutorial/technical books I have ever read. Very clean writing style, and the authors clearly enjoy their topic.
- rebootthesystem 10y agoI have pictures of my younger self at an APL conference in 1983 with Polivka, Pakin, Ken Iverson and other APL luminaries of the day. Small community.
- spthorn60 10y agoAPL was hot in Poughkeepsie, where I grew up. My first APL program was a Mastermind simulator (on our high school's Telex connected to a timeshare system). My dad worked for IBM, and Ray and Ken were household names.
- xxxxxxxxxxxxxxx 10y agoDid you go to PDS (Poughkeepsie Day School)?
- rbanffy 10y ago"Obfuscated APL"? Isn't that a pleonasm?
- kbenson 10y ago> i read the Polivka and Pakin book about 30 times I hope that's because the book was more accessible than the computer platforms at the time, otherwise that is a steep learning curve.
- ktRolster 10y agoNah, just think that he was able to go from relative beginner to a complete expert with a single book. Rare to find such a multi-layered book that has in-depth knowledge, but is still useful to beginners.
- qwertyuiop924 10y agoYou may want to learn J instead. It uses ascii, and it's from Iverson, so it's the true continuation of APL.
- beagle3 10y agoOr K (a JS interpreter called oK with an interactive coding env called iKe can be found in John earnest github account). It is a distillation of APL/J concepts. Much smaller core, clicks better than J for some people.
- scottlocklin 10y agoOr Nial, which is APL in plain English. http://www.nial.com/OpenSource.html http://www.nial.com/OpenSource.html They're working on a distributed and GPU versions.
- eggy 10y agoI didn't know about any new effort with Nial. I'll have to check it out. The distributed and GPU parts are especially enticing to me. CUDA is wearing me out! I have really become comfortable with J now, and I don't know if it would help me to step into a text-based APLish language. More typing for me to do the same I do in J, and I don't code for or with others, so no collaboration arguments here. And, I can read my old J programs just fine, even years later. Most code fits in a glance, and if you are not very practiced, very little time to refresh as opposed to looking through pages of 'easy to read' Python for example. How is Kerf [1] coming along? How similar to J? [1] https://github.com/kevinlawler/kerf https://github.com/kevinlawler/kerf
- scottlocklin 10y agoKerf's doing well: we're adding a sort of NoSQL functionality which is pretty unique (unstructured data you can index and join on). Closer to K than J, but really pretty different from both, beyond the Array language heritage. I had considered building a distributed processing system using J and zeroMQ, but now considering doing something like this with Kerf. Main thing is ... do the customers want it. I can't pay rent with technological innovation. FWIIW, Pascal has something you might be interested in for GPUing in J, if you are not aware of it; jarrayfire. https://github.com/Pascal-J/Jfire https://github.com/Pascal-J/Jfire I haven't screwed around with it, but I keep meaning to get around to it. Looks solid. I made an abortive attempt to do something cheaper (cuda hooks basically), but got distracted.
- Homunculiheaded 10y agoFor anyone interested, I noticed that Dyalog made their proprietary implementation of APL free for non-commercial use just recently [0]. I suspect this change might have been in reaction to an uptick in traffic to their site from this other APL HN post[1] a bit more than a month ago (there's some good discussion their as well). [0] http://www.dyalog.com/ http://www.dyalog.com/ [1] https://news.ycombinator.com/item?id=11963548 https://news.ycombinator.com/item?id=11963548
- kaiwetzel 10y agoThey also have Mastering Dyalog APL by Bernard Legrand as a free PDF download. I've just starting reading it, seems to be a very gentle introduction to APL: http://www.dyalog.com/mastering-dyalog-apl.htm http://www.dyalog.com/mastering-dyalog-apl.htm
- davorb 10y agoI used it to learn APL, and it really is a great resource.
- Roboprog 10y agoHow does something like "R" compare to APL? If you replaced the greek letters and other symbols in APL with function names, keeping the right to left order of operations, is there something missing? (I only did a tiny bit of APL for a class 30 years ago)
- rebootthesystem 10y agoI think you mean J. Easy: J is an abomination. Notation is a very powerful thing and J destroyed it. It was a misguided attempt to deal with hardware limitations of the time. I used APL professionally for about ten years. Don't take it from me, ironically Iverson himself made the case many years ealier in this paper: http://www.jsoftware.com/papers/tot.htm http://www.jsoftware.com/papers/tot.htm
- BMarkmann 10y agoMade the case for what? In another paper, he wrote: Since J is now free, and uses only ASCII characters, the requirements set forth in my A Personal View of APL have been fully met. http://www.jsoftware.com/papers/autobio.htm http://www.jsoftware.com/papers/autobio.htm
- rebootthesystem 10y agoNotation as a tool for thought, of course! In quoting the article you conveniently leave out that Personal View dates back to 1991 and, technically, had it's foundation in the years prior to that because of just how frustrating it was to use APL during that awkward time in computing. I am not sure if you know APL, ever used it and for how long. I go way back. I was in the thick of it as the IBM PC came out and various APL packages tried to make the transition. I started using APL on time shared mainframes over Honeywell and DEC teletypes and Tektronix storage CRT terminals, that's how far I go. It was down-right frustrating. On the PC, APL interpreters had to ship with a character ROM for the monitor card just so you could see the characters on the screen. In the process you'd lose about half of the ASCII table to APL. If you wanted to print APL characters you had to buy specific printers, like the IBM Selectric and install a special APL ball with APL characters. A few got clever and installed a physical toggle switch on the computer to switch between APL and ASCII character sets. Yeah, you had to crack open your computer and change a chip just to be able to see APL chracters! I wrote and presented a paper at an APL conference in the early 80's. Back then you had to submit the paper in print for reproduction. I had to write my own APL paper printer program to drive an IBM Selectric such that it would pause and allow me to change the printer's character ball to print code sections in the paper. You really truly had to want to do APL in order to be willing to endure this kind of pain. The lucky ones had Tektronix storage CRT terminals or IBM terminals with built-in APL characters. Eventually dot matrix technology made things easier. Yet, we were still crippled by the limitations of ASCII and having to live this dual life of needing APL characters to program and regular characters for the "user space" application. That being the context, Ken Iverson buckled to the pressure and transliterated APL to ASCII characters, something that would result in J. This, of course, was extremely short-sighted and went exactly counter to the power he found on notation as a tool for thought. A man who devoted no less than twenty years to developing the beautiful and powerful concept of a notation for describing digital systems and programming, simply made the wrong call just as technology was about to make the use of such notation simple and universally accessible to all. J is not APL. Far from it. The power is in the notation. J throws that away. It's a shame.
- rebootthesystem 10y agoNo, it's not. It is a horrible abomination. See my other post. It's like changing all math symbols to words because the computers of the time can't display the integral sign or greek letters. A total destruction and negation of the power of notation. Iverson made a very bad decision with J. It's crap.
- ktRolster 10y agoimo using the symbols is part of the fun of APL! Apart from the utility.
- pierrec 10y agoAPL symbols are slighly more suggestive than J symbols, sometimes they vaguely resemble mathematical counterparts with similar meanings, but they remain entirely separate programming symbols with their own meanings. The idea of using other, more common characters instead remains an excellent idea. Afflicting J with lovecraftian adjectives and scat doesn't help.
- qwertyuiop924 10y agoSigh, I guess you're right. It's not like their aren't massive disadvantages to the APL way of doing things, like not being able to edit your code in standard editors, and having to learn confusing new keybindings, or even get a new keyboard. OH WAIT.
- ktRolster 10y agoNot anymore......now that utf-8 is spreading everywhere, APL is ready for a comeback! Most editors (Eclipse, Emacs, VI, etc) can handle the characters, and most OSes can handle different keymappings, so no need to buy a new keyboard. Of course, you'll still have to learn confusing new characters.
- Crito 10y ago> "It's like changing all math symbols to words because the computers of the time can't display the integral sign or greek letters." You mean like TeX? Seems pretty fucking sensible to me.
- ontouchstart 10y agoAPL\B5500: The Language and its Implementation Gary Kildall https://news.ycombinator.com/item?id=12223304 https://news.ycombinator.com/item?id=12223304
- gregors 10y agoCheck this out - you miss out on the ambience until you actually see it in action - https://www.youtube.com/watch?v=_DTpQ4Kk2wA https://www.youtube.com/watch?v=_DTpQ4Kk2wA
- curiousgal 10y agoLivecoding sessions d'époque, I love old programming videos!
- Sir_Cmpwn 10y agoAnyone know of a good place to buy teletypes like this?
- 3princip 10y agoGreat video, thanks for sharing! A bit embarrassing that Professor Bob Spence teaches at my/our alma mater and I didn't realize it was him until checking out the description at the end. Wish I had used my time at University more productively, so many interesting people and subjects concentrated in one place. It went by very quickly and most the time was spent worrying about passing exams. Seems I'm much more interested in some of the subjects nowadays, I certainly would have appreciated the experience more now than at that age.
- clifanatic 10y ago> For most of us, getting access to a computer and being able to use it as long as we wish is merely a dream. Ah, so he has kids, too.
- abraae 10y agoAs a young IBM engineer, seeing APL keyboards put me off programming for a decade. The incomprehensible hieroglyphics were daunting.
- 35bge57dtjku 10y agoThe real question is where do I get a magic typewriter that works like that???
- ndr 10y agoYou can try J instead, http://www.jsoftware.com/ http://www.jsoftware.com/ As Wikipedia puts it [0]: it is a synthesis of APL (also by Iverson) and the FP and FL function-level languages created by John Backus. To avoid repeating the APL special-character problem, J uses only the basic ASCII character set, resorting to the use of the dot and colon as inflectionsto form short words similar to digraphs. [0] https://en.wikipedia.org/wiki/J_(programming_language) https://en.wikipedia.org/wiki/J_(programming_language)
- 35bge57dtjku 10y agoSorry, I meant the typewriter from here: https://www.youtube.com/watch?v=_DTpQ4Kk2wA https://www.youtube.com/watch?v=_DTpQ4Kk2wA
- jxy 10y agoLike all the non-English speakers do.
- deleted 10y ago[deleted]
- lokedhs 10y agoYou can also use the Emacs mode (disclaimer: I'm the autor), which not only gives you reasonable input methods for APL characters, but also a lot of other features such a source code navigation and the ability to edit matrices in SES (the Emacs spreadsheet). https://github.com/lokedhs/gnu-apl-mode https://github.com/lokedhs/gnu-apl-mode And a video I made to demonstrate some of its features: https://www.youtube.com/watch?v=yP4A5CKITnM https://www.youtube.com/watch?v=yP4A5CKITnM
- gregfjohnson 10y agoIt is a pleasure to see APL crop up on HN from time to time. APL was the first language I learned, back in the 1970's. "First love," and all that. I remain a devoted user of the language, though only as a thought-amplifier and prototyping tool. The big key to the language IMHO is the idea of computation liberated from time. This is what I think Dijkstra was getting at when he railed against "operational thinking". Instead of thinking of programming in terms of mentally replaying the execution sequence of the code you are writing, you can step outside of time, as it were. Computation becomes a way of thinking about mathematical transformations at an abstract, extra-temporal level. Dijkstra described this as programming via "predicate transformers". But he was still constrained in a scalar world. Iverson, on the other hand, encouraged people to dream in abstract aggregates of data. His mathematics of arrays was at once simple and rich, ripe with expressive possibility. In my view, the functional programming people are doing beautiful work creating new realities and ways of thinking within this cognitive universe. So, (pun alert) APL remains unsurpassed in its beauty and timelessness.
- 0xdeadbeefbabe 10y agoMakes me wonder if Knuth agrees with Dijkstra about the preidcate transformer?
- davedx 10y agoThe earliest programming languages were the most creative. APL and Lisp are inspirational.
- rebootthesystem 10y agoI got started with Machine language, APL, LISP, C, FORTH, roughly in that order. Used them all professionally for at least ten years (still using C, of course). Truly an excellent way to venture into computing.
- ktRolster 10y agoYour comment is poetic.