Ah, sorry to mischaracterize. Substitute "it would be madness" for "it's madness", please!
I do agree that using nesting for homogeneous shapes is inelegant. What they're doing in this case is like putting a marker in the shape, which could be written 2 3|3 4 in the boxed array A *&.> < B. It's weird that the way to do this is to switch over to an inhomogeneous representation. But it works. Maybe I've misunderstood, but your comments about nesting give me the impression you think BQN's further from J than it is. Most BQN primitives work on items ("major cells") and don't care whether the argument is nested. So dyadic , translates to ∾ and I believe the only difference is that BQN doesn't try to extend an argument with rank more than 1 smaller than the other. Similarly, J's { and BQN's ⊏ are identical when the left argument is an array of numbers. BQN doesn't even have a version of APL's Split, and uses < with rank like J. It seems Bracha's concern about a "shadow world" is that it's lacking capabilities relative to the "real thing"? I don't think this ends up being the case with nested arrays because they're still arrays, so that functions like Rotate or Grade can be the same. BQN has all the array manipulation of APL and nearly all of K with a fairly small amount of duplication: pair functions ≍ versus ⋈, mapping ˘ versus ¨, folds ´ versus ˝, and I guess you could argue reshape ⥊ versus splitting with ⊔ (and transpose ⍉ is missing its analogue, K's flip). Marshall On Wed, Jun 15, 2022 at 04:49:50PM -0700, Elijah Stone wrote: > On Wed, 15 Jun 2022, Marshall Lochbaum wrote: > > > my opposition to J's flat array model (I think it's almost always worse > > than BQN's based model) is different from my stance on flat arrays BQN > > can also represent and optimize these, although there's no name for the > > category; they'd be called arrays of numbers or arrays of characters > > I was speaking only of semantics, not implementation details. > > > > And of course there can be huge advantages to working with them, but I > > think it's madness to use this as grounds to dismiss a solution that's > > much shorter and easier to read > > I was not dismissing your solution, nor saying that the present one was > better. I was saying that I find the use of nested structures inelegant (as > well as unnecessary in this case, since the data are completely > rectangular), and that the deficiency in j is only a lack of a primitive for > managing these multi-dimensional data effectively. It is a general problem: > it is difficult to manipulate high-dimensional data. > > Regarding nests: > > 1. They provide inconsistent results: what relationship has the shape of x{y > to the shapes of x and y? How can dyad , possibly behave consistently? > > 2. They are a shadow world (cf > https://gbracha.blogspot.com/2014/09/a-domain-of-shadows.html) of > organisation. Monads 'split' and 'mix' in apl illustrate this; it is not > possible to compose contiguous organisation (adding dimensions to an array) > with noncontiguous organisation (adding nested structure to an array). K is > consistent because it only has nested organisation; bqn has both. J > explicitly places nested organisation in a box, segregated from the rest of > the languages, which composes and is coherent. > > > > more in keeping with other array principles: that blind reshape ($,) on > > the transposed array is something I try hard to avoid. > > Yes; see again the baker paper. > > -E > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm