all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: "B. Wilson" <elaexuotee@wilsonb.com>
Cc: 65935@debbugs.gnu.org
Subject: [bug#65935] [PATCH] gnu: Add ngn-k.
Date: Mon, 20 Nov 2023 12:28:56 +0100	[thread overview]
Message-ID: <877cmcr7d3.fsf@gnu.org> (raw)
In-Reply-To: <2IJP3PDMP581H.2003KELWBJOER@wilsonb.com> (B. Wilson's message of "Fri, 20 Oct 2023 17:06:15 +0200")

Hi!

"B. Wilson" <elaexuotee@wilsonb.com> skribis:

>> This package cannot be included in Guix because what we have above is
>> not source code: it’s deliberately obfuscated code, it’s not “the
>> preferred form of the work for making modifications to it” (as the GPL
>> puts it) in any way.
>> 
>> I hope that makes sense.
>
> I agree that it's super weird, but it's not obfuscated code. Rather, it's the
> famously terse Arthur Whitney style. The APL/J/K family of array-oriented
> languages all famously have implementations strongly influenced by Whitney, and
> ngn-k is just following in that tradition. Those with the relevant domain
> knowledge tend to agree that the code is pretty readable.

Not being familiar with APL & co., I lack domain knowledge.  However I
do know C, and things like this (from <https://codeberg.org/ngn/k.git>):

--8<---------------cut here---------------start------------->8---
#include"a.h" // ngn/k, (c) 2019-2023 ngn, GNU AGPLv3 - https://codeberg.org/ngn/k/raw/branch/master/LICENSE
I rnk(Ax/*0*/){X(RA(Iv=rnk(xx);P(v<0,v)i(xn,P(v-rnk(xa),-1))v+1)RmM(rnk(xy))RT_A(1)R_(0))}//-1 for mixed rank
I urnk(Ax/*0*/){X(RA(urnk(xx)+1)RmM(urnk(xy))RT_A(1)R_(0))}//assuming unirank
S L fG(OV*p,Nn,Lv)_(O G*a=p,q=v;P(v-q,NL)Ii=0,g=HD/SZ(*a),f=0;W(i<n&&!f,j(g,f|=a[i++]==q))i-=g;j(g,B(a[i]==q)i++)i<n?i:NL)
S L fH(OV*p,Nn,Lv)_(O H*a=p,q=v;P(v-q,NL)Ii=0,g=HD/SZ(*a),f=0;W(i<n&&!f,j(g,f|=a[i++]==q))i-=g;j(g,B(a[i]==q)i++)i<n?i:NL)
  L fI(OV*p,Nn,Lv)_(O I*a=p,q=v;P(v-q,NL)Ii=0,g=HD/SZ(*a),f=0;W(i<n&&!f,j(g,f|=a[i++]==q))i-=g;j(g,B(a[i]==q)i++)i<n?i:NL)
  L fL(OV*p,Nn,Lv)_(O L*a=p,q=v;P(v-q,NL)Ii=0,g=HD/SZ(*a),f=0;W(i<n&&!f,j(g,f|=a[i++]==q))i-=g;j(g,B(a[i]==q)i++)i<n?i:NL)
S A1(fN,Ay=_R(cn[tl]);x(xtt?y:rsz(xN,y)))
//S A1(fBN,Q(xtG)Gv=0;i(xn,v|=xg)P(!(v>> 7&1),x)Ay=aL(xn);Mx(i(xn,yl=xg<0?NL:xg))y)
//S A1(fHN,Q(xtH)Hv=0;i(xn,v|=xg)P(!(v>>15&1),x)Ay=aL(xn);Mx(i(xn,yl=xh<0?NL:xh))y)
//S A1(fIN,Q(xtI)Iv=0;i(xn,v|=xg)P(!(v>>31&1),x)Ay=aL(xn);Mx(i(xn,yl=xi<0?NL:xi))y)
S L t[256];
S X1(fndGx,RmMA(e1f(fndGx,x))Rzc(Lv=gl(x);az(v==(C)v?t[(UC)v]:NL))RE(fndGx(gZ(x)))R_(fN(x))
 RZC_E(Nm=xn;Ay=aL(m);Mx(S4(xw,i(m,yl=t[(UC)xc]),i(m,Hv=xh;yl=v==(C)v?t[(UC)v]:NL),i(m,Iv=xi;yl=v==(C)v?t[(UC)v]:NL),i(m,Lv=xl;yl=v==(C)v?t[(UC)v]:NL)))sqzZ(y)))
[...]
--8<---------------cut here---------------end--------------->8---

… I find it hard to believe they’re “readable” to anyone in the sense of
being the “preferred form” for modifications or even just studying it.
(Heck, even the Makefile has optional whitespace removed, as if trying
hard to make it unreadable!)

I don’t think we have a precedent here; I wouldn’t want to make a
decision based on a personal judgment, and I understand I know nothing
about the APL language family, but someone will have to clarify how
those 1.2K lines of C were written/generated.

I’d love to hear what others think!

Thanks,
Ludo’.




  reply	other threads:[~2023-11-20 11:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14  5:39 [bug#65935] [PATCH] gnu: Add ngn-k B. Wilson via Guix-patches via
2023-10-18 20:49 ` Ludovic Courtès
2023-10-20 15:06   ` B. Wilson via Guix-patches via
2023-11-20 11:28     ` Ludovic Courtès [this message]
2023-11-20 11:52       ` B. Wilson via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cmcr7d3.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=65935@debbugs.gnu.org \
    --cc=elaexuotee@wilsonb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.