Here's my thoughts... You are, of course, correct. You can't know what a j sentence means if you do not know what the words in the sentence mean.
Honestly, though, I don't see that as in any way unique to J. The real problem, I think, for a beginner, is wrapping your head around what the primitives mean. It's easy to sidetrack onto familiar territory when learning something new. I think this is an example of http://en.wikipedia.org/wiki/Streetlight_effect That said, please also keep in mind that I personally do not deal with large bodies of J code - for me it's an exploratory language and not one where I have a large user base. I should leave it to others to speak about that kind of experience. Anyways, http://rosettacode.org/wiki/Talk:Topological_sort might interest you -- here, we have two implementations of a "topological sort", one using bit tables to represent structure, the other using numeric indices to represent a logically equivalent structure. I'm not sure exactly what all someone would have to go through, in another language, to make that kind of transformation in the underlying architecture, but you can see how it plays out in J. Thanks, -- Raul On Sat, Jul 20, 2013 at 9:29 PM, Tobia Conforto <[email protected]> wrote: > Hello > > I'm a J newbie, still going through the introductory material. It's a great > language and I'm having a lot of fun learning it! But I cannot help comparing > it to other languages I know. > > I find its features very interesting, especially its handling of rank, but at > the same time I find its syntax very hard to read, compared to "ordinary" > languages. > > After thinking about it a bit, I'm quite sure the reason is because you > cannot make out the structure of a J sentence unless you know exactly which > tokens are verbs, adverbs, and conjunctions, and even then it takes some > mental work to put it all together. Otherwise it remains a flat list of > symbols. In this regard it's not dissimilar from Assembly, where the entire > code is a flat list of opcodes, unless you know how to see the structure in > jumps and calls, and then apply yourself to the task. Maybe I'm wrong, but > this does not strike me as a good thing. > > This, coupled with J's terse syntax (seriously… at least APL had some pretty > symbols) made me wonder how much of its flexibility is dependent on its > syntax; or conversely, how much of it could be ported to a different language > with more static syntax rules, in the form of a library. I'm not thinking > especially of Lisp, where you can build your own syntax, thus incurring in > the same readability issues as J (as I see it.) > > Has anybody tried to port J's features to other languages? How did it go? > > Here is a tiny proof of concept, porting a couple of things (fork, adverb) > over to CoffeeScript, in a very basic manner: > > > div = (x, y) -> x/y > add = (x, y) -> x+y > tally = (y) -> y.length > insert = (v) -> (y) -> y.reduce v > fork = (a, f, b) -> (y) -> f (a y), (b y) > integers = (y) -> [0..y-1] > > console.log (fork (insert add), div, tally) integers 10 # prints 4.5 > > > As I said, this is very basic. It lacks everything, including rank and > arrays. It's just a few lines I put together to reason about syntax. Out of > the few languages I know, I chose CoffeeScript for this exercise mainly for > its un-parenthesized function application. > > What are your thoughts? > > > PS. I know much of J's power comes from its engine and its optimized array > operations. This post is strictly about syntax, or rather *opinions* about > syntax :-) > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
