« first day (1568 days earlier)      last day (1070 days later) » 

8:01 AM
tfw you want to suggest a golf but get ninja'd by Adám
 
8:19 AM
APL Tree Rings is obscure. I still need a good name for the meetup where people come to reminisce about APL. The name should not exclude new APLers (like APL Veterans Club would), nor should it make the old APLers sound obsolete (like APL Dinosaurs would). This is a call for ideas.
 
8:45 AM
APL On the Shoulders of Giants
 
9:22 AM
I still think an APL Tree metaphor would be a good idea
 
9:52 AM
APL Root & Branch
 
APL Roots is pretty good maybe
 
APL Roots & Fruits?
 
too long
 
10:23 AM
Legends of APL
APL Tales
Maybe I'll just go with APL Fireside Chat
 
wasn't that the name of a dyalog talk or something
it looks vaguely familiar
 
Andy's.
 
ah
 
that's the one
 
10:26 AM
Was there a fire?
 
Nope. TIL that "fireside chat" is a technical term.
 
an informal conversation doesn't seem very technical to me
 
No, the conversation isn't. The term is.
 
Ah
 
10:38 AM
Ah, a combo title… APL Legends Fireside Chat:
 
11:32 AM
Hmm, my colleagues are suggesting APL Moot
 
idk what on earth a Moot is so I'm not convinced
 
Right, my worry is that it is too obscure for someone who doesn't know about Vikings. Wikipedia doesn't even have a proper Moot article
 
12:19 PM
definitely too obscure
 
Maybe widen the scope with "Array Legends Fireside Chat".
 
12:48 PM
Array Reflections
 
1:13 PM
APL Reflections, maybe?
 
That was the original suggestion, actually, but someone wondered if I wouldn't want Arthur Whitney there, in which case I should probably expand the scope. On the other hand, Array Reflections could sound like ⌽⍉⊖ while APL Reflections doesn't…
*Naming is hard*
 
Reflections in Depth
 
@Adám good luck getting whitney there lol
 
@Razetime Reflections in Rank ― FTFY.
@rak1507 Of course. That was the example mentioned, but how about other Jers and Kers?
 
idk, that name smells
@Adám I read that as "jurrs and kurrs"
 
1:25 PM
@Adám do J-ers and K-ers do much reminiscing about the past?
 
@rak1507 Good point, I don't think so.
So interesting how my colleagues are all excited about the name "APL Moot".
 
Weird
 
CMC: Tacit solution to LeetCode 1470 in vanilla Dyalog APL.
 
damn it, just went back and saw the word tacit
 
Yeah, sorry. The dfn solution is obvious and of same length. Making it tacit require a whole rethink.
 
1:37 PM
,∘⍉⊢⍴⍨⊣,÷⍨∘≢ taking n as left arg and the list as right arg
@Adám how long is your dfn?
 
9
 
Ah, mine was 12
 
@rak1507 ÷⍨∘≢ indicates that you misunderstood the challenge.
 
((⍋≢⍴(⍳.5×≢))⊃¨⊂) is what I got
 
⊢⌷⍨∘⊂∘⍋∘⍋2|⍳∘≢
got it, ,↑,⍥⍪↓
@Adám was that the answer?
 
1:52 PM
That's amazing
No idea how it works.
 
@rak1507 what how
 
I was ignoring the fact you get n as an argument
 
hmm gives me a length error
 
4(,↑,⍥⍪↓) 1 2 3 4 4 3 2 1
1 4 2 3 3 2 4 1
 
n as left arg, array as right
oh it can be even shorter, ∊↑,¨↓
 
1:56 PM
How was your exam today?
 
didn't have any today luckily, it's my day off, next one's on friday
(btw, that solution also translates nicely to python, return sum(zip(nums[:n], nums[n:]), ()) )
 
leetcode should have a Dyalog option
 
@rak1507 No, but wow.
 
@xpqz I wish!
I also did a google code jam problem in APL that turned out quite nicely
 
@rak1507 ∊↑,¨↓ -- inspired.
 
1:59 PM
it's a more interesting problem if you just get the array
 
Although I feel that any apl expression should have either rank or over. Ideally both.
 
hah
,↑,⍤0↓ then
 
:)
What was yours, @Adám?
 
,∘⍉2@0⍴⊃
Taking nums n as right argument.
 
wow, that's really cool
I don't understand how that works
n@stuff seems to do some sort of strange reshaping
 
2:05 PM
No, it does a substitution.
So 2@0 replaces nums with 2 giving 2 n which is then used to reshape.
 
ah, got it, was reading it the wrong way
 
 
2 hours later…
RGS
3:37 PM
Adám's just trying to collect clever answers to shame me :P youtube.com/watch?v=xyAQsSPfYZE
Go ahead and comment your nice solutions
Btw I've been running this weekly APL meetup and one of the participants essentially came up with ⊃↑,.,↓ – except it had a bit of extra fluff because she is still fairly inexperienced.
 
Wait, wasn't the extra fluff only to compute n instead of taking it as argument?
 
RGS
@Adám And the extra ⊣⊢
 
Really?
 
RGS
I think so; was it not?
I mean, it could've had 24352345 bytes of extra fluff; the ↑,.,↓ was there and it was impressive.
 
@Adám that 2@0 thing, I am both clapping my hands and holding my nose.
 
RGS
3:47 PM
@xpqz Yeah it really is nasty :P
 
Golfer's trick shot. I'll try to remember that for future reference.
 
@xpqz If we had Under, it could have been written as ,∘⍉2⍢⊃⍴⊃ ― better?
 
,., is cool, I was thinking of that originally
imo the nums n input format is cheating anyway :P
 
How so? That's how other languages would take them.
 
@Adám Don't tempt me with fancy glyphs I can't have :)
 
3:55 PM
Hm, does ⍉⍢(2⍬⍴) work in dzaima/APL?
 
@Adám no, other languages would take them as multiple arguments
 
I wish Dyalog had a glyph for "last element", analoguous to monadic ⊃
 
not as a list of the two
 
@rak1507 That's APL's way of taking multiple arguments.
@xpqz For simple vectors, you can use ⊢⌿
 
@Adám I disagree, APL's standard way of doing two arguments is ⍺ and ⍵
 
3:57 PM
@rak1507 OK, what's APL's standard way of taking 5 arguments?
 
then you'd use an array, but there aren't 5 arguments here, there are 2, and the only reason to take it in the format nums n is to make it marginally more convenient
 
@rak1507 For a class constructor, the only way to take 2 arguments is as an array.
 
I didn't know the solution had to be a valid class constructor :P
 
@xpqz So strange that there's no mirrored version of
@xpqz to pick from the rear would be nice.
 
unnecessary
anything you can define in a couple of primitives shouldn't be a primitive itself imo
 
4:03 PM
Well, yes, if we had Under.
 
@rak1507 sure, but it would be both convenient and consistent.
 
@rak1507 That is an enticing criteria, but unfortunately it fails.
⊃⍢⊖
 
@Adám why?
 
@rak1507 Plus is -∘-
 
:D
 
4:04 PM
plus is necessary, ⊅ is not
 
So is pick on reverse efficient?
 
How is plus necessary? -∘- always works.
@xpqz ⊃⌽Y is efficient. X⊃⌽Y is not ― well, O(n) rather than O(1) I guess.
 
lets put it another way, what is gained by adding +? well, a lot of things, because adding is something you do quite a lot. What is gained by adding ⊅? Not a lot, because it is both rare, and only saves a single character.
I'd say the added complexity of adding a new primitive outweighs the potential gain in some niche situations (although personally I think there is none)
 
Roger and Marshall think set functions are superfluous.
 
I've as a rule done ⊃¯1↑Y but it grates on my retinas for some reason
 
4:06 PM
@xpqz ⊃⌽Y is much nicer
 
And it isn't always the same.
@xpqz You mean dyadically?
 
@Adám some of them may well be, that's a personal opinion
 
@Adám No, monadic
 
@xpqz Don't do that. Use ⊃⌽ or ⊢/
 
But ⊢/ isn't as a rule what I want, right? That's enclosed.
(for non-simples)
 
4:09 PM
Right, then ⊃⌽
Or ⊃⊢/
 
Is ⊃⊢/ better than ⊃¯1↑?
Bar saving a keystroke
 
Certainly more readable.
 
@xpqz Well, I got a backdrop of an open fire for my v3.0 chat .. and a comfy chair to sit on. Even though we were in Scotland my request for a large tumbler of really good Scotch was turned down, so water it was :-(
 
I was thinking of using an open fire animated background for Zoom.
 
@AndyS it's a tough life :)
 
4:20 PM
@xpqz :-) Come to think of it, a tumbler of whisky was not necessary .. the previous evening we had a chocolate and whisky tasting session, and only 2 of the 8 of us on our table tried the whisky ...
 
Seems like that was the table to be at.
 
 
2 hours later…
5:59 PM
@Adám I wouldn't phrase it that strongly. I think on balance it's better not to include set functions as primitives, but if I were to make a language with a hundred primitives they'd definitely be on the list.
Note that BQN includes a fairly large number of convenience functions such as Rank (=, or ≠∘≢), Mark Firsts (, or 0=⊒), and shifts (i.e. dyadic » is ≠∘⊢↑∾). Often this is because I think the idea is fundamental, and so better expressed as a single primitive than a combination. Set functions fit that criterion somewhat, but not completely.
 
Fair enough. Another simple I might want is ⍳≢ (↕≠)
 
I've considered that, although it's a distant second behind Pair (≍○<). For golfing purposes ⊒˜ is usually better.
 
I still think there should be a minimal subset of primitives within reason
bqn doesn't even have ⊥ or ⊤ iirc, which I would take over ∊ any day
 
I think "reason" does all the work there. Should just be a reasonable set of primitives. Within reason.
 
yeah, true
 
6:10 PM
BQN doesn't have ⊥⊤, because I think these are utilities and not really primitives. They make a lot of assumptions about endianness and layout. APL programs that use them often need a fair amount of code to adapt to these assumptions, sometimes even more than it takes to implement them from scratch.
 
not convinced
converting to and from various bases is useful and frequent
 
But so is converting to and from JSON encoding. I think (and no, I don't expect you to be convinced) it's better to make a good library system for these sorts of tasks than to add primitives.
Base encoding/decoding is something that comes up naturally while JSON doesn't, but it doesn't always appear in the same way. It's more of a pattern than a single concept.
 
json encoding, sure, but mathematical operations seem to fit well in something that is basically derived from 'executable mathematical notation'
it's not that big an issue, I see your point
 
Mathematics has a lot of these patterns that can't be easily captured (this is why category theory or similar ideas will never just solve everything, even if they're better). The OO approach would be to make a wide abstraction and take the variation as a parameter. The APL way is to narrow it to one thing and fudge around the imprecision. BQN does this some, say with structural Under, but it has a vastly lower tolerance for it.
 
6:26 PM
idk how much variation there really is in ⊥⊤, but in general I see what you mean, APL does have ⍠ for some things though
not that I particularly like it
 
@rak1507 Only for utilities.
(J has it for core things too.)
 
yeah
 
I guess my problem with it is that you start to see this one choice, which is really an engineered thing, as the true solution, which warps the way you see things. In implementation there's pressure to optimize that specific concept, which will help specific programs but long-term is much less efficient than making smaller and more general building blocks go fast.
 
Sounds like K
 
⊥⊤ are big-endian by convention, which is usually the wrong choice because the array indices and exponents don't line up.
 
6:29 PM
Heh, K has them, though.
 
@Marshall for simple things like 2⊥⍣¯1⊢ (ew), it definitely is the right way, because it's the convention
mixed base and stuff is less useful but I think it still seems to work most of the time how I want
 
@rak1507 2⊥⍣¯1 is only necessary because of the mistake of treating a scalar left arg as a 1-element vec.
Something which I btw believe it is safe enough to fix. I don't think anyone in their right mind would write scalar⊤ instead of ⎕CT←0 ⋄ scalar|
 
6:59 PM
I have a question about a difference between J and Dyalog APL. J has a sort of bignum rational number system. APL has something in dfns that implements bignums (stores as strings, if I recall correctly), and something in dfns that implements rational numbers, but never the twain hath met thus far
Is this something that would be hard to do in Dyalog APL? Has there never been much of a push for it?
I'd like to work on that old Bernoulli numbers challenge on here where you have to calculate the Bernoulli numbers to 60 decimal places or get the exact numerator and denominator, and I'm not sure I can swing it very easily in Dyalog APL as is.
 
@Adám :O yay
that being fixed would be great
 
Not that this is a huge issue, mind. I'd just like to put it in the suggestion box
 
@Sherlock9 do you have a link to the challenge?
 
I got the numbers mixed up. 6 decimal places of precision up to and including the 60th Bernoulli number
 
@Sherlock9 I don't understand what you mean by them not having met. What hasn't met what?
@Sherlock9 Would what be hard to do?
 
7:06 PM
I tried putting bignums into the rational number dfn and it gave me an error, if I remember correctly
Sorry it's 2 am and my instinct at this hour is to be poetic more than specific and that's a terrible idea in a programming chat XD
 
rats is mostly a superset of big
Also, have you seen Roger Hui's Q et al?
 
No, but I'm happy to read up
 
@Adám what? rats does not at all handle big numbers
 
Wait, really? My bad, I thought so. Hence my bewilderment.
 
Oh huh
 
7:10 PM
@Sherlock9 Entry point.
 
it seems like floats would do, 6 dp is more than enough
 
rats store a number as its prime factors and their powers as regular numbers, so a large prime number will kill it
 
Also I have forgotten many things and one of them is how to load dfns
 
@Sherlock9 Are you aware of APLcart?
 
@rak1507 Most of the methods to calculate Bernoulli numbers involve a large number of sums and you lose precision very quickly
 
7:11 PM
Ah
 
Apparently not, but give me a week, I'm still getting my sea legs back
 
7:23 PM
dfns.rats vs dzaima/APL bigints because why not
https://dzaima.github.io/paste/#0fVO9jltFFO7vU4y2iU2k7PmdMycFEkR0LtJQprheL4nF2kR2QkFElSiKghzRRKmoSUWDEBIl@yb3SfjGOBJJgCt57@zcM@d8fzMdfiqrr7b7oRyf6fB6Nz7al@nl05t9cc6lv/58Ox1@VRpSyWqTpsQWO1FJaulVGtGpwb3d4@2j9eaynP3L@bNh@KR8frm9eLAZd1@vt/f/o6r885lt9vMylDt3vyyz8dv789vYU1JsfXE1Ptxfrm4fy5S8nA5@1NNoWI6rsn28WV7u/qfopMGLn4dh6rp8N6434/lndxfDp@Xh9PzHJ2NZ4jUd/ph@eHZRVsf1bwX/lNlsvH6zmt@cXVy/Wc7nZTYdfrn@fXrxFstl//J96S2X43590Weuv9mOV2VcrdZ92fuf8wJnThos3pd6Ud7TuuNhwjO9ev2gq33jg9M3BrrFrVauGWFls766Wu8/GNIbLAZXrZKs0kTSojmZezL@VjEyyUZGWV0sBKO1mVSiDCZWS7HWC2trLe24
 
@Sherlock9 coded up a quick solution, despite the fact it times out for n=60 (not sure if that's a problem), it is accurate enough (with memoisation)
 
(lol 3L*18000 in dzaima/APL is as fast as (3 rats 1) *rats 18000 rats 1 (the first has to actually calculate the whole number (though doesn't actually do any rational stuff), whereas the latter is O(1) (but will error if you add or subtract anything from it)))
 
@rak1507 Ooh, I'd love to see it
 
you were the one who wanted to do the challenge ;) it's just an implementation of the definition, nothing fancy
 
7:47 PM
Eh, I'll give it another go when it's not nearing 3 am. Thanks for the help and encouragement
 
alright gn
 
8:46 PM
Insomnia will be the death of me
 bernoulli←{
     memo←1⍴1
     b←{
         (⍵+1)≤≢memo:memo[⍵+1]
         memo,←1-+/⍵{(b⍤0⊢⍵)×(⍵!⍺)÷1+⍺-⍵}¯1+⍳⍵
         memo[⍵+1]
     }
     b ⍵
 }
      bernoulli¨57 58 59 60
┌→───────────────────────────────────────────────────────────┐
│3.963167672E17 2.38654275E32 ¯2.882303762E19 ¯2.139994926E34│
└~───────────────────────────────────────────────────────────┘
It almost works except for the odd-indexed Bernoulli numbers, which are supposed to be 0 starting from the 3rd Bernoulli number. Starting from the 29th Bernoulli number, the outputs rise up in revolt and are now spectacularly large
The even-indexed Bernoulli numbers work perfectly
 
 
1 hour later…
10:00 PM
@Adám I did not know about APLCart. That looks fantastic.
 
:-)
 
@Marshall What are your thoughts on K? As I understand it, Arthur created it (at least in part) because he was dissatisfied with aspects of J/APL. It seems like BQN has a similar origin, but I'm assuming you don't think K got everything right either (otherwise, why write something new?).
 
 
2 hours later…
11:58 PM
@Jonah I haven't actually used K so my thoughts on it are really only valuable for comparing with BQN. I definitely think it's in a tier above APL or J. It intentionally omits some features that BQN has like true multidimensional arrays, closures, and combinators, which I think is reason enough to make another language.
 

« first day (1568 days earlier)      last day (1070 days later) »