Comment

Comment by doug1001

read through the OP and scanned a few examples on the J Project Wiki

i suspect that, to capture the full value of J, one needs to already know the array-oriented paradigm (or at least have a strong motivation to learn the two in parallel)

knowing the AOP paradigm also helps understand the programming patterns as well as the syntax

still, the dense syntax has extraordinary power

for instance, n-queens in J (from Rosetta Code) is just 4 short lines:

    perm   =: ! A.&i. ]             
    comb2  =: (, #: I.@,@(</)&i.)~    
    mask   =: [ */@:~:&(|@-/) {
    queenst=: comb2 (] #"1~ mask)&.|: perm
a fundamental AOP patterns is evidenced here:

line 1: create the 2D array (n x n chessboard)

line 2: populate the array with candidate solutions

line 3: eliminate invalid solutions ('mask' them)

parent doug1001 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton