27 ms·
In one line of J (both APL and J were created by Kenneth E. Iverson) life=: (3 3 (+/ e. 3+0,4&{)@,;._3 ])@(0,0,~0,.0,.~]) Given a life instance, the next gene
by emersonrsantos 11y ago
In one line of J (both APL and J were created by Kenneth E. Iverson)
life=: (3 3 (+/ e. 3+0,4&{)@,;._3 ])@(0,0,~0,.0,.~])
Given a life instance, the next generation can be found by:
1. adding extra empty cells, surrounding the life instance,
2. tessellating the result, finding every overlapping 3 by 3 subinstance,
3. totaling the number of live cells in each subinstance,
4. treating a subinstance as a live cell iff that total is a member of the sequence 3,x where x is 3 if the center cell was previously dead, and 4 if the center cell was previously alive (that said, note that 4 is also the index of the center cell, with the sub instance arranged as a flat list).
- rebootthesystem 11y ago<rant on> Please, people, stop using, promoting or even placing J on the same footing as APL. It is an absolute abomination of a language. It's ONLY motivation was that doing non-ASCII characters was really difficult way-back-when. That's it. And in creating J they absolutely butchered the very principles Iverson and others were vocal and passionate about promoting and teaching. I learned APL about thirty years ago. Yes, we had computers thirty years ago. I learned it from what I'll call "first generation APL'ers". It's like saying "the first inner circle who started to dabble in Linux as soon as Linus made is public". The first disciples of Iverson, if you will. So, I am two levels away from Iverson. I met him multiple times at conferences, seminars and APL university meets. Him and other APL pioneers like Ray Polivka, Sandra Pakin, James Brown, Adrian Smith and Paul Berry. All of these people wrote books about APL and taught it. Big deal, right? Well, yeah. Because I was in the room, a very small room, with maybe 200 people, if not 100, when this paper was presented by Iverson himself (in fact, I have a picture with him at the event): http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pdf http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pd... Notation as a Tool of Thought was an incredible eye opening paradigm for me back then. I sat there listening to this presentation that pulled together all had learned about APL during the prior year or two of using it. And it was revelation. Notation made the power of the APL concept that much more than the ideas of easy array manipulation. It brought computational problem solving to a level of expression matching mathematical notation. This was way ahead of it's time and I felt privileged to be among the first generation of people using it. Yet, there was a problem. Machines of the time made it difficult to work with non-ASCII character sets. We had to use specialized terminals (IBM and Tektronix made some). When the IBM PC came out we had to literally burn a custom character set ROM for the graphics card and replace the line drawing characters with APL characters. That was great, but it sure didn't make for easily opening up APL to the masses. You had to be very, very interested in APL to not only buy an expensive APL interpreter but also engage in swapping chips out of your computer. The language was definitely ahead of it's time. In some cases you had to buy very specific hardware or it would not work. As PC's exploded and portables like the early Compaq's came out it became more and more difficult to deal with the character set. And so, I remember going to APL conferences where the concept of transliterating the language started to surface. The idea being to use a set of ASCII characters to represent APL characters and, therefore, enable this franken-APL to be accessible without hardware mods to your computer. This was incredibly short-sighted. Many of us knew it was a matter of time before graphical display of symbols (like math and music notation) would be easy. Eventually this evolved into J. A notation that completely abandoned the paper that earned Iverson the ACM Turing Award. It's APL without perhaps the most powerful thing about APL. It looks like a terminal shitting characters because it is operating at the wrong baud rate. Iverson made a huge mistake with J and he abandoned EVERYTHING he was so right to champion years earlier. If we are ever going to go in that direction again (I think we have to, in some form) we need to understand that notation, more than almost anything else, was the key. Computational problem solving needs to evolve beyond a state where the best we can do is type English words into a text editor and into something that is far more expressive. For that you need a notation, not an abomination like J. <rant off>
- jk4930 11y agoBeautiful. And you're on to something. So what should be our next steps?
- rebootthesystem 11y agoI wish I had the time to devote to thinking and doing research on this front. Running three businesses makes that pretty hard. At the same time, I realize it might take someone who has the historical frame of reference to fully grok what could be possible. Having used APL professionally for about ten years on solutions ranging from business to DNA sequencing software does give me that perspective. Having said that, there are plenty of people out there who've had the same or even a deeper experience path in APL. The question is whether or not they have the interest in using some (not all, APL isn't perfect, by far) of the concepts to try and understand how we might tell computers what we want them to do in 100 years from now and beyond. Again, if I could focus my efforts and devote all my time to it I'd do it. I just can't.
- jboggan 11y agoThis is interesting to hear since I came to J without having worked on previous APL flavors and am still a big fan of my brush with it. I will go read that paper in depth though so I can at least grasp what I am missing. What is the most tractable example of what you feel J lost from APL?
- rebootthesystem 11y agoNotation.
- eggy 11y agoI use both J and Dyalog APL. It is my understanding that Arthur Whitney, Roger Hui and Ken Iverson himself worked on J. The goal was not just to address the difficulty of using non-ASCII character, but to add funtional programming, hook and fork, easier tacit programming and fix certain other issues that even Ken Iverson himself acknowledged [1][2]. PS: I use Dyalog APL because I do personally like the once-alien-to-me characters! [1] http://www.jsoftware.com/papers/APLPersonalView.htm http://www.jsoftware.com/papers/APLPersonalView.htm [2] http://www.jsoftware.com/papers/autobio.htm http://www.jsoftware.com/papers/autobio.htm