3 ms·
I like the idea that notation is a tool of thought, but I think that J (and APL) are actually rather crappy notations. I FAR prefer matlab for matrix work, as
by forkandwait 15y ago
I like the idea that notation is a tool of thought, but I think that J (and APL) are actually rather crappy notations.
I FAR prefer matlab for matrix work, as it is closer to actual math than any other language I know. For logic ish programming, Prolog or AMPL or SQL (I like SQL, even though people hate on it all the time).
But, in my humble, J and APL are interesting historically, but rather crappy in comparison to more recent languages
- mturmon 15y agoI was surprised to learn, given the inelegance of much of Matlab, that it was explicitly influenced by APL. See the blue callout box at http://www.mathworks.com/company/newsletters/news_notes/clevescorner/jan06.pdf http://www.mathworks.com/company/newsletters/news_notes/clev... which shows part of a 1983 plan for Matlab: "Combining the technology of 1) mice and windows, 2) matrix and APL environments, and 3) direct manipulation, will do for engineers what Lotus 1-2-3 has done for the business world." Ulf Grenander, the Brown University mathematician who invented statistical pattern theory, once used APL, but moved to Matlab for his expository book on pattern theory: http://books.google.com/books?id=lxBDcFvFFvsC&pg=PA146&lpg=PA146&dq=grenander+apl+matlab&source=bl&ots=xKNsRtuh7W&sig=SeiNk3jjJa3QR3ZGgyNwrPaulaM&hl=en&ei=KbSbToX9HtHRiAL59_zlDQ&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBoQ6AEwAA#v=onepage&q=grenander%20apl%20matlab&f=false http://books.google.com/books?id=lxBDcFvFFvsC&pg=PA146&#... I agree that the vectorized operations in Matlab are good at lifting computational ideas out of the fog of nested for loops. It is more compact to represent some matrix algebra in Matlab notation than in ordinary matrix notation, as anyone who has read Golub and van Loan knows. It's weird to proclaim, but this concise notation can be as freeing for certain problems as Prolog's declarative transformations, and functional composition in Lisp.
- forkandwait 15y agoI think "the inelegance of Matlab" is MUCH overstated. It has some weirdnesses, some of which are fixed in Octave (it's gnu cousin). But some apparent bad choices (anything to do with cell arrays, especially) are really quite powerful when you get to know them. (If you ask me, R/SPLUS is the inelegant language, especially when doing serious matrix -- yuck! But it's trendy....) Matlab is a lot like SQL -- people love to hate on it because it isn't perfect and they know it really well (because it is ubiquitous and pragmatic).
- mturmon 15y agoIt has improved a lot. In the late 1990s it was decidedly behind the scripting languages of the time, and that's partly what I was referring to. And, the weird lack-of-speed issues. It used to be that you could implement a matrix multiply, in an m-file, that would be faster than the builtin *. I benchmarked this myself.
- klettow 15y agoHave you ever used J or APL seriously? If yes, what do you find so "crappy" about the notations? If no, please keep your uninformed opinion to yourself, you have no idea what you are talking about.
- forkandwait 15y agoI have been charged with maintaining 5000 LOC of J at work, so I use it weekly or so (5-10 hours ... as little as possible...), and I have spent at least a hundred hours or so with it before that. And my somewhat informed opinion is that J sucks ass. To start with, input/ output suck and it's hard to read and maintain -- it is the least pragmatic language I know. But what I really hate about it is the community -- full of true believers who think it's a cosmic language and "mathematical", even though you can't prove theorems in J (that's what would make it mathematical, duh), who babble about how they can calculate pi to 1000 digits in only 4 characters, as if that is remotely useful or profound (neither)
- klettow 15y agoYou're maintaining 5000 lines of J code huh? Sounds like a decent sized project. If you are spending 5-10 hours every week or two maintaining it, why not have a go at replacing it with something you do know? I would love to know how it went. As for your other throwaway comments, any code, in any language is hard to read and maintain when you don't know what you are looking at. Or, as better stated by Whitehead (whose quote led off this thread), "Of course, nothing is more incomprehensible than a symbolism which we do not understand.". Concerning the community you "hate" for some small-minded reason, my experience has been quite the opposite, I have not found a more informed, helpful or friendly group anywhere, and this also includes the APL/k/q/A+/NARS/SAC communities (all languages designed or influenced by Iverson). As for pragmatism, Iverson was probably one of the most pragmatic language designers in history. Don't take my word for it though, here is what Dr. Fred Brooks has to say: I once asked Kenneth Iverson, Turing Award winner and inventor of the APL programming language, "Why is APL so easy to use?" His answer spoke volumes: "It does what you expect it to do." APL epitomizes consistency, illustrating in detail orthogonality, propriety, and generality. It also epitomizes parsimony, providing many functions with few concepts. - Fred Brooks, "The Design of Design" page 72