3 ms·
How 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
by Roboprog 10y ago
How 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.
- yummyfajitas 10y agoI've played with J a bit. I have yet to see any J code that can't be translated in a pretty straightforward way to idiomatic Python + Numpy. Of course, it's pretty important to note that idiomatic Numpy is very different from idiomatic Python. For example, here's some idiomatic numpy: gamma = arange(0,1, 1/1024.0) x = np.outer(r(T-event_times[M+1:N]), gamma) log_likelihood += M*log(gamma) + sum(log(1-x), axis=0) return exp(log_likelihood) Idiomatic python might be: for i in range(0,1024): log_likelihood[i] = M*log(gamma[i]) for j in range(M+1,N): tmp = r(T-event_times[j])*gamma[i] log_likelihood[i] += log(1-tmp) likelihood[i] = exp(log_likelihood[i]) return likelihood
- snaky 10y agohttp://prog21.dadgum.com/121.html http://prog21.dadgum.com/121.html
- yummyfajitas 10y agoPython has the idiom he describes as a builtin. with open(filename) as f: ...your func goes here If you want to create your own custom one: @contextlib.contextmanager def with_a_foo(...): foo = ... yield foo ...cleanup the foo... It's less terse (and in my opinion more readable [1]) than J, but same idea. [1] I very rarely find point free programming to be comprehensible. This may be my mental limitation.