[This message should be read in APL385 Unicode font]

Ian Clark's last sentence brings to mind some problems I have with J.  
He said:

> This of course may be a problem which will lessen when I gain as much
> facility in reading J as I have with APL. If I ever do.

I too have trouble with J, not just reading it, but also remembering it.

I've used APLs of various flavours since 1976, mostly to earn a  
living. That would include APLUM, Sharp APL, STSC APL and Dyalog APL.  
I've gone back and forth between them quite a bit. Differences in  
language definitions have rarely ever been a hindrance to writing  
code. Of course, converting code from one to the other has definitely  
required a bit more attention. But, on the whole, it's been a  
rewarding experience. The core concepts were so well designed that  
language variances were mere trifles.

Part of the joy of using APL has been the way it has infused my  
thinking. Somewhere early on APL became my choice for talking about  
other things. So, when I dabbled with general relativity, the tensor  
notation was not difficult to understand; it was easily mapped into  
APL terms. That definitely made the subject more approachable.

I recall the pleasure I got in learning (from KEI in person, I  
believe) about the selection of the special characters. I liked that  
you did not have to rely on English keywords. Rather, there was a  
single character for the important functions. So, we had ⌈ and ⌉  
for the floor and ceiling, ⊖ and ⌽ for rotations, ⊤ and ⊥ for  
encode and decode, ∧ and ∨ for two of the logicals. Then there were  
sensible, familiar choices for ×, ÷, ≠, ≥, ≤ and ≡. Such good  
thinking. The results were often even in suggestive pairs.

It is interesting to note that the APL scheme almost entirely left the  
brackets and punctuation marks to a supporting role. The single quote  
was used around text, the [, ] and ; in indexing and the colon in  
labels. Of course, the comma and period were used for functions, but  
even then that I found to be excusable: mathematician's use the comma  
in a similar way to APL; The period was always in the midst of  
something else, either as a decimal point or as the operator in the  
inner product.

Mind you there were the Greek characters, ⍺, ∊, ⍳, ⍴ and ⍵,  
which caused some grief. It would have been nice to have other  
alternatives, but at least they were mnemonic (first, mathematician's  
member, ⍳ndex, ⍴eshape, last).

Overall, a wonderful scheme that is both evocative and memorable.

However, this sort of design does not seem to have found it's way into  
J. For me that has meant that J is difficult to read and almost  
impossible to remember. I have a hard enough time reading J code that  
I have written, even a week later. Reading others' code is not  
something to be undertaken lightly. And, I don't think that it is  
because the concepts are radically different. It's just very difficult  
to parse an expression. Here are some of my problems:

(1) The use of punctuation and brackets
I'm used to not expecting punctuation or brackets to be "the important  
stuff". When I see a left brace {, I expect to find a matching right  
brace } nearby; the material of value is in between. I don't expect "  
to be involved as an adverb; it's for quotations. @ should be reserved  
for web addresses. Is it reasonable to expect me to resolve ` and '?

(2) Confusing use of characters well-known in other contexts
I expect $ to be a currency symbol. (¢, ¥ and £ are.) The number  
sign # is just excusable, but not %. (Percent really has very little  
to do with divide.) ∧ is logical and for me, not power. < is tied to  
making comparisons, not to boxing.

(3) Some tokens are one character, some are two (or even three)!
This just makes it real hard to break up a line into its constituent  
parts. I die a little every time I see .. or ::.

(4) Spaces are significant

(5) Missed opportunities
Wouldn't it be nice to use ← for global assignment; ⍇ for local  
assignment; ∞ for infinity; √ for square root. I even recall that  
some of these were used in the very early versions of APL.

(6) ASCII names
Current rules only allow names to use English letters. Why can't we  
write:

   André ← √10
or
   extensión ⍇ 5 12
or even
   ⍴ ← $

(7) a., b. etc
I think I'd prefer ⎕av, ⎕ace, ⎕anagram,

Imagine what would have happened back in the early days if the  
designers of APL had had a Unicode font? I think we'd now be working  
with a well thought out, nicely structured set of primitives, each  
with its own graphic character. Here we are with the perfect answer to  
the typeball and for reasons (that appear not to be written down)  
which I fail to understand, we are forcing J to fit in the 7-bit ASCII  
box.

Is it too late to debate this? Or has the concrete truly set?

Respectfully,
Mike Powell
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to