On Tue, 26 Oct 2021, Raul Miller wrote:
Note that dot product (for example) is designed such that its v should
have a minimal rank (mostly rank 0, but rank 1 can sometimes be useful,
and rank 2 is plausible).
We mostly notice when we want exceptions and it's easy to gloss over
stuff that's working well.
That is a good point, and it generalises.
A compiler from language A to language B will be easy to write if A is
inexpressive and B is expressive; and if many assumptions can be made
about A and few about B. Because J is very expressive, it is easy
(easier?) to compile thoughts to it.
But modifiers, as a form of metaprogramming, are compilers which take as
their source J code, and so would like to make assumptions about it (such
as, for example, that a particular verb has low rank). So there is a
fundamental tension.
-E
Take care,
--
Raul
On Tue, Oct 26, 2021 at 11:32 PM Elijah Stone <[email protected]> wrote:
I think that primitives should try to handle as highly-ranked an array
they can. I find it much more simple and regular to explicitly lower the
rank of a verb than to recreate the high-rank version of the algorithm
myself.
I had a similar issue recently with #.: it is effectively a trailing-axis
reduction, and I wanted to reduce the leading axis, so I had to write
#.&.|:. I would much rather have written #., and used #."1 if I
explicitly wanted to reduce the last axis.
I do not know if this argument is strong or objective, but: in general, if
primitives have natively high rank, then lower-ranked versions can be
produced in a uniform manner; whereas if primitives are low-ranked, then
distinct high-ranked versions must be produced for each relevant
primitive.
-E
On Tue, 26 Oct 2021, Henry Rich wrote:
> First: rank "_1 is shorthand for "_1"_ . Every verb must have
> nonnegative rank.
>
> Second: it seems to me that the current definition of I. is more
> convenient for some things (where f@I. is used) and less for others
> (where I.@, is used). Is there any strong objective argument one way or
> the other?
>
> Henry Rich
>
> On 10/26/2021 1:56 AM, Elijah Stone wrote:
>> On Mon, 25 Oct 2021, Marshall Lochbaum wrote:
>>
>>> If I. combined the two, functions written with the high-rank version
>>> would usually fail in this case. Better to make the programmer
>>> remember an idiom than to provide an incomplete version of it.
>>
>> No definition could be less amenable to high-rank computation than the
>> current one. And for code which does want to go that mile, "_1 is
>> much nicer (IMHO).
>>
>> -E
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
>
> --
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm