|
|
|
|
|
by brudgers
4037 days ago
|
|
Ken Iverson's introductory text is Math for the Layman. It suggests that "learning J" is a bit like "learning math" and that proficiency should probably be measured more in terms of how one applies J to particular problems rather than general knowledge of syntax and recall of library functions as is common when talking about computer languages. http://www.cs.trinity.edu/About/The_Courses/cs301/math-for-t... Or to put it another way, a person can know J in the same sort of way a 7th grader knows math...or a 3rd grader or a Master's candidate. J is an exploratory language and will meet a person where they are. It is useful whether the person is only capable of basic arithmetic or convex hulls. |
|
A programmer may expect < to perform less-than. In J it does, when used as a dyad. Used monadically, it acts as a boxing operator (similar to Scheme's box). That's strange, but livable. The problem, though, is in J, <. means 'lesser of' (min), and <: means 'less than or equal'. Again, this is a potentially livable arrangement. Except that . means determinant (or dot product, depending on monadic or dyadic appearance) and : means either 'explicit' or 'monadic/dyadic', a sort of combinator that accepts a monadic and dyadic operator and yields a new one. That is, in Scheme, dyadic usage of : is akin to a case-lambda that checks if it uses one or two arguments.
If I present to you the program <., what does it do? Well, it certainly does something different from < ., which does something different from < :, which does something different from <:, which does something different from < . :, which again differs from <. :, and so on. This is exacerbated by operations such as 'table', written /, which bleed into other places. For example, </ inserts box, while <:/ inserts a decrement! And < :/ boxes up the result of an 'explicit' being 'inserted', whatever that means. And this syntactic problem plagues the entire vocabulary of the language:
http://www.jsoftware.com/help/dictionary/vocabul.htm
A clear optimization would be to just give these things their real names, use text, and write S-expressions. At least then the programs would be readable!
The largest problem, however, is that for being a functional language, J does little if anything to convey the important idea that have been developed in functional programming: recursion. It simply isn't how things 'are done' in J. So we have a language with bad syntax, good semantics, and a horrible problem from an educational perspective. It has some nice additions above and beyond other APLs, but after that it falls flat. I'd urge anyone who has read this far to learn APL instead of J; it will at least be readable by other APL programmers.
(I didn't mean to go on a rant, but I suffered through Howland's class on J at Trinity, and it wasn't until I had a professor show me Scheme in ~3 hours that I saw why functional programming was truly worthwhile.)