dly <[EMAIL PROTECTED]> wrote:
> The beauty of APL is not just in the eye of the beholder - there is
> intrinsic beauty in an APL expression. Of course clever people can do
> math with roman numerals but not as simply, efficiently and elegantly
> as with numbers expressed in a consistent base. J not only abandoned
> the symbol set of APL, it abandoned the simplicity, consistency and
> elegance of APL. However, I have seen few APL programs that were
> designed with the consistency and elegance of the APL language
> because few APL programmers appreciated and used the grammar and
> syntax of APL when they wrote code.
I am curious just how you define 'intrinsic beauty'
(I presume that you are referring to grammatical and mathematical
elegance, as opposed to visual appearnace, since you are separating that out).
J has abandoned a lot of the ugly and irregular archaism of APL,
making its syntax more elegant. To wit:
- bracket indexing y[x] being unlike other functions; replaced by regular x}y
- bracket syntax u[n] being unlike other operators; replaced by u"n
- irregular axis-operator semantics replaced by regular rank-operator semantics
- many APL primitives (such as rotate/reverse, compress/reduce, expand/scan)
have two versions with different default axes. J eliminate this redundancy
by the more general and consistent rank mechanism.
- ; having different precedence from all other verbs
- unique syntax of outer product.
- while APL has some adverb (/ \) and conjunctions (.),
these are special-cased to only work on certain subset of primitives,
while J allows them to be used generally.
- APL's scan operator \ is replaced by the much more useful J prefix operator,
which can emulate scan (via /\) but the converse is not possible.
- J's tacit verb mechanism allows an entire level of elegance and
succinct expression of functional concepts totally unheard of in APL.
Most things you can write in APL you can write very similiary in J.
However, because of J's greater flexibility, many APL expressions can
be written much MORE elegantly and succinctly in J.
> To be readable you need to be able to recognize the morphemes, words,
> and sentences which is easy in APL and not so in J.
This is merely a matter of learning the syntax.
Every language has its own rules of letter formation and word formation.
Until one is fluent in these, languages naturally seem unnatural and clunky.
For example, consider accented letters in Latin-based alphabets.
In some languages, such letters are considered distinct unique letters
that are sorted seprately from their base letters. In others, they are
unique but sorted with their base letters. In others, the letters are
not considered unique, but merely provide pronunciation clues.
(In German, the umlaut is sorted like a following letter 'e' and has
the same semantics; in English, diaeresis is a clue to forbid dipthong
formation, although it has fallen into disuse; in Spanish, it stops
u from becoming silent, while acute accents merely indicate stress).
Someone who is just familiar with the base Latin alphabet might find this
variety of accented forms bewildering and confusing. However, someone
who is fluent in the various languages that use them has no problem
with them, any more than an English speaker has any problem in
discerning different semantics of the letter 'c' in 'cake' vs. 'circle'.
Someone who is fluent in language learns to recognize morphemes and
morpheme clusters as atomic units. J programmers automatically see
{. as 'take' in the same way that APL programmers see an up-arrow.
As one becomes more fluent, one can recognize longer and longer
sequences as trivial and atomic (such as +/ .* as matrix multiply)
When I first started using J (after having been familiar with earlier
dialects of APL), I found some things elegant (such as rank and tacit code),
while other things struck me as klunky (the ASCII character set) or downright
WRONG (lack of intuitive bracket indexing). However, after having used J
for a fair while I have come to appreciate its subtlety and beauty.
-- Mark D. Niemiec <[EMAIL PROTECTED]>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm