« first day (1447 days earlier)      last day (1504 days later) » 

02:20
APL Video Solution Walkthrough of AdventOfCode Day 1 Problem A: youtu.be/0RQFW6P1Tt0
Feel free to leave comments of code-golfed solutions
I like the logo!
huh, I never actually noticed the input box in tryapl, I just always typed into the main bit
do you have a link to the paper you mentioned? @code_report did not know about that!
btw the dfn you used can be tacitified like this ⊃∘⍸2020=∘.+⍨
so the whole thing could be ×/⊢⌷⍨⊃∘⍸2020=∘.+⍨
I prefer ×/⊢∩2020-⊢ though ;)
thanks!
This is the section that mentions it:
> Discussion of Hook and Fork

Hook. In combinatory logic one of the most useful primitive combinators is designated by S [Sch24]. Curry defines Sfgx in prefix notation to be fx(gx) [CuFeCr74]. In common mathematical infix notation this would be given by (x)f(g(x)) , which one can write in APL as xfgx , and this is the hook form (fg)x . The combinatory logician appreciates this form because of its great expressiveness: it can be shown that S , along with K , the constancy combinator, suffice to define all other combinators of interest [Ro50]. (The const
interesting that he uses (fg) not (⊢fg)
I can't get that continued fraction thingy to work
Ah it works with +∘÷
 
1 hour later…
04:02
@rak1507 Hook (2-train) is differently defined in that paper (and therefore J).
(f g)y there is equivalent to f∘g⍨y in Dyalog and x(f g)y there is x f∘g y.
@code_report cool video
I suggest having a separate tutorial video so that you can focus more on how each solution is implemented rather than what the functions and operators do
04:20
Eh, most of his audience probably don't know APL so it's probably a decent idea to explain stuff as he goes along
@Bubbler Right, got it
 
3 hours later…
07:02
I've seen some discussion about implementing Dual (g^-1 f g). Is there any interest within Dyalog for implementing it? I need it lots.
07:14
<moon-child> it's in dzaima/apl and apl extended as 'under'
07:44
@RomillyCocking Absolutely. We just need a C developer who has the skills. Meanwhile, you can use my APL model.
@RomillyCocking Alternative simpler versions each supporting one of the two modes, but not both.
08:00
@rak1507 Nope, since needs an enclosed list of indices :-( you need 1↑∘⍸ or ⊣/⍤⍸ or similar.
@Adám The first one doesn't look right. Shouldn't it be ⍵⍵⍣¯1⊢?
@Bubbler Oh wow, good catch. Pushed fix, this time with example to prove it.
08:57
@rak1507 The most beautiful thing about that solution is that you can then break out the 2020 as a left argument: ×/⊢∩-
That is nice
09:58
@MortenKromberg Even for us on MacOS?
Didn't think that could work, given how the interpreter is hidden away in a non-standard location.
@Adám Perfect! Thanks.
@xpqz It can, if you can find the interpreter :-) Didn't you report that particular issue?
ngn
ngn
@code_report something doesn't add up here. the guy in the video says that a 3-train (fork) is an S combinator. the paper mentions a 2-train (hook) but a different kind of 2-train from dyalog's (atop).
@ngn See Bubbler's comment.
If I understand right, Dyalog's ⊣ f g and f∘g⍨ are S combinators.
Sounds right to me
10:12
I don't know this combinator stuff, but I'd love to add such search terms to APLcart. Anyone willing to help?
ngn
ngn
@Adám yes, when applied monadically. easy to see when you write it down. but afaict a fork in general has nothing to do with S
@Adám I did (and even if you can find the interpreter, it still doesn't work, due to how it is launched, as I recall).
@xpqz Ah, then your reply to Morten is appropriate. He's in a meeting right now, though.
@Adám However, I was encouraged to see the demos of v19 at Dyalog -20, which seemed to suggest that the upcoming 'dyalogscript' will also take MacOS into account.
@ngn Not in general, no. Just this specific fork.
ngn
ngn
10:21
@Adám the fork in the video wasn't of this form
@ngn True, so I think @code_report confused S→specific fork→general fork→his specific AoC solution.
@xpqz Yeah, and in principle it should all be platform agnostic. Unfortunately, I doubt anyone at Dyalog actually uses a Mac often or thoroughly enough to notice when something ends up awkward there. We "dumbed" down installation on Mac, with bad consequences, it seems. Maybe we should have both dumb and full install packages for Mac?
@rak1507 that's pretty tasty
It is kinda, his solution is (dfn ⌷ ⊢) which is like the S combinator
I know I'm a small minority -- but loud :). My wish (as I've said many times before of course) is that dyalog sees itself as any other (non-Apple) dev tool chain on the mac (python, perl, node, ...) -- basically: treat the Mac as you already treat Linux. Separate the install of the interpreter itself, and RIDE. Allow Mac users to leverage the command-line in a natural way.
@xpqz Don't give up!
10:29
Oh, I'm having too much fun to give up.
10:46
@RGS you're a maths-geek -- is there a special name for a monotonic sequence of integers increasing by 1? E.g 3, 4, 5, 6, ..
arithmetic sequence?
Maybe yes. "Arithmetic progression with a common difference of 1" Doesn't quite roll off the toungue, does it.
No, not really
@xpqz Sequential integers?
RGS
RGS
11:04
@xpqz I know no names other than the things proposed already. I'd call them consecutive integers starting at X.
11:49
@code_report nice! intrigued about whether 'where-at-depth' would work in k (right now it only works on flat lists)
ngn
ngn
@code_report a comment about terminology: primitives are not algorithms. primitives can be implemented using particular algorithms, or they themselves can be used to express higher-level algorithms.
for instance: "⍋ uses counting sort for small-domain arguments and radix sort in the general case", or: "⍋⍋ is the algorithm for inverting a permutation"
(correction: ⍋⍋ is the algorithm for "ranking", i.e. inverting the sorting permutation of something)
12:05
How can I remove the Dyalog keyboard? I uninstalled the program but the keyboard still exists. It doesn't appear in the list of languages when I go to settings > languages
@TomCockram assuming Windows, it might be under some language as a layout
Yeah sorry, on windows.
haven't used windows in a while, but iirc from the language selector on the taskbar you might be able to go to some separate settings page for keyboard layouts
@dzaima There isn't a 2nd language to remove... i.imgur.com/zzP373a.png
ngn
ngn
@rak1507 hm, maybe. it's like S with swapped x and y. to be fair, is one of those primitives begging for an arg-swap :)
12:11
@TomCockram that seems to be about languages/translation. there should be a separate settings page for keyboard layouts somewhere
@dzaima keyboards is the same situation i.imgur.com/e4t1zUW.png
@TomCockram that's the same screenshot
ngn
ngn
do it the windows way - reinstall the os :P
@TomCockram there should be a full settings page instead of a popup somewhere
12:16
I ran the uninstaller again and ticked uninstall IME and that worked.
¯\_(ツ)_/¯
ngn
ngn
12:38
@chrispsn what is "where at depth"?
something like whereatdepth (0 0 1;0 1 0) -> (0 2;1 1)?
@ngn yeah
Feels a bit like odometer
ngn
ngn
12:54
@chrispsn ah, right, so the flipped form would be more efficient, (0 1;2 1)
@ngn what makes it more efficient?
ngn
ngn
@chrispsn less space wasted on headers, more opportunities for simd
just like odometer prefers (0 0 0 1 1 1;0 1 2 0 1 2) over (0 0;0 1;0 2;1 0;1 1;1 2)
Ahh I see - data will tend to have more points than depth levels
ngn
ngn
yeah, that's a better way of saying it :)
13:29
However it's arranged, it would ideally be fed directly to dot-indexing
ngn
ngn
14:20
@chrispsn x@/y should work too (@-fold with an initial value, where x is the n-dim array, y - the result from deep where)
ngn
ngn
14:31
@chrispsn i think dot-indexing is always rectangular (think of a[i;j;k] where i j k could be lists), so it would require an "each"
15:27
@Lyxal We had an email to you bounce. Can you check that your email account is working (e.g. inbox not full)?
15:51
@xpqz There is no question that we started off on the Mac trying to follow what we perceive to be Apples view that their products are "appliances" and not "computers". The only early internal user was John Scholes, and he was allergic to complexity youtube.com/watch?v=qSVR4Z3DA24. We just agreed to hold a meeting to review our mac strategy.
16:01
@MortenKromberg I can only speak for the places I work, but here at IBM, for example, all our software developers' machines are Macs (by default; you can opt out). The reason for this is that they are unix desktop machines that can be centrally managed and deployed. Whilst we deploy software we write as containers via kubernetes, we all write software locally in python, go, (or whatever), rarely leaving the command line.
Trying to make an interpreter in js right now
Really missing the APL privilege
@MortenKromberg It seems to me that Dyalog fits perfectly well into this pattern: the interpreter is analoguos to my /usr/local/bin/python. RIDE is analoguous to my ~/Applications/VSCode.
Which is what you do anyway on Linux, right?
@Razetime Like ngn/apl?
16:26
@Adám nah, it's a 2D esolang I'd been wanting to make for a while now
16:42
I could try it in dzaima/APL
@Adám The Perlis Idiom list is here cpsc.yale.edu/sites/default/files/files/tr87.pdf - I doubt there is much new in it, as I think the Finns will have been familiar with it.
 
4 hours later…
21:06
@Adám that's odd, I'm able to send and receive emails normally on that account, and the previous emails came through just fine.
@Lyxal I'll try one right now. Maybe it was a temp glitch. Sent. Let me know if you get it.
@Adám It seems Vivaldi mail is acting strangely: I can get emails from my outlook account but not from my gmail account
Perhaps I should just provide an alternate email
@Lyxal Sure, you can respond directly back to Fiona with that.
@Adám do you mean from the vivaldi account or the new email?
Because Vivaldi mail is having difficulties sending things too
Just send from your alternate account, quoting the Vivaldi email address, for a tad of security.
21:27
@RomillyCocking Wow. I'm reminded of the history of the language once again. I find it fascinating that these little tidbits have been there for ~50 years and are still relevant today. Not what usually happens eg. in Python world, seems to me.
not much python was being written 50 years ago
@MartinJaniczek Sometimes I'm sad I didn't get to work or even live at the time eg. Oberon, Smalltalk, Plan9 and so on were at their top. (EDIT: also Common Lisp)
@rak1507 That's the surprising thing to me (and something to get used to). That APL predates so many other technologies but is still relevant. (I guess that's due to it being "extended mathematical notation"?)
Yeah, that surprises me too, and how ahead of other modern languages it is in some ways
If APL had only stayed ahead…
Tangent: googling for the wiki page about APL, I saw this image and have the strongest G.A.S. right now for some metallic trinket on my keychain
(G.A.S. = gear acquisition syndrome :D )
21:33
That's not a bad idea. We should start selling metal APL glyphs on the website.
I don't like ⍲⍴⍸ though, but I wouldn't mind using a high-gloss steel ⍋ for my keychain.
21:46
Hm not knowing better I found thestudio.com, and 100 of such trinkets would be $325.44. And probably not that high-gloss steel. Some kind of silver-like finish. I think I'll sleep on it :) But it's a neat idea, together with APL laptop stickers. (Yeah I'm one of those people)
IIRC, Aaron Hsu also has some T-Shirt designs with some APL idioms and snippets on them.
yeah he does, I was tempted to ask for one for Christmas but I didn't in the end
He has a ⎕IO←0 tshirt, I'm tempted to make a ⎕IO←1 one just to annoy him if I ever saw him in real life
We always (except 2020, of course) hand out Dyalog "goodies" at the user meetings, but maybe we should start making "Powered by APL" and "I'm an APLer" laptop stickers.
⎕IO←0 and ⎕IO←1 and "⎕IO delenda est" are good too.
I have a giant ⊃∨∧⌊○⊂ orange-on-clear sticker on my silver laptop. Looks pretty neat.
Maybe some of RikedyP's ⊢>+⌿÷≢
That's one of the T's bonfire.com/store/arcfide
Took me a second to understand the reference on your sticker :)
I prefer things that have actual meaning to just how the symbols look
I like ⊢>+⌿÷≢, that one is clever
APL old-timers used to have I❤️APL. At the office, there's an ⍺*⎕ umbrella, and my father had one too.
How about ⌷≡⌽⌽≡⌷
Or >⍝ my only hope
Morten uses ⍒⍋ as his avatar.
@MartinJaniczek I had a bunch of these ^ made at the local bakery.
21:57
@Adám Ah I love it
I don't get >⍝ my only hope
Star Wars: R2D2 projecting Leia
@MartinJaniczek It was in celebration of adding TAO (apl.wiki/TAO) which I was very involved in.
CMP: If Dyalog was to sell APL merch, what would you want to see the most?
@Adám Ah, I thought it would be something like that, but I couldn't quite picture it
@rak1507 Have you not seen the APL puns?
22:03
Oh, hey we should have RO⌊L or RO⌊LOL T-shirts.
Or maybe ?O⌊L / ?O⌊LOL
BTW before I forget it. News about the APL vs Go race at our company: I've prepared an end-to-end benchmark for the various implementations, measuring mem usage, CPU usage, the response times under load and not under load.

My colleague made his Go impl compliant with that spec (exposed a HTTP endpoint), so we finally were able to compare meaningful numbers (not his "3ms!" on his shiny Ryzen vs my "3ms!" on my laptop i7). Turns out his 3ms is 10-25ms on mine, and he has some contention in the goroutines so under load he has hundreds to thousands of ms (median 400ms) while 8x APL + nginx loa
Any metric Go wins in (besides being respectable)?
price
Fair, though I guess you pay for advantage on all the other metrics.
Measurable metrics: not that I know of. I believe most of these can be fixed (startup time and memory usage by preprocessing similarly to how I do it; response time by fixing the goroutine contention), so I'm glad it at least forces the team to strive for better results now that they know they're possible
But I'm hoping they start thinking about sticking with the APL solution.
22:08
You could ask the people in charge how much they think such performance improvements are worth.
@MartinJaniczek Another interesting question is developer hours to get there (and how many spent already).
Another would be if Martin's colleagues could pick up APL, I'm assuming it would be easier for him to work on the Go code than vice versa
Or maybe they'll just all get fired, you seem to be doing the job single handedly
Wouldn't be the first such story.
@rak1507 I knew^H^H^H^Hstarted learning APL two days before I started writing the prototype and had it mostly ready two weeks worth of evenings later. They would just have to give it a chance and be a bit playful about it
^H^H^H^H? what
^H removes a character in terminal
22:11
<moon-child> ^H is backspace
Ah right
<moon-child> (also: ^W remove word ^U remove line)
Convenient!
@MartinJaniczek Also I have a branch where I refactor the prototype into something manageable (namespaces and so on), but it's hard to strike balance
22:13
lol
@MartinJaniczek I don't know what "audience" to cater for, I surely can't explain and extract and name every little idiom. The code would IMHO become harder to use with all the indirection to named functions. (I can't believe I'm saying that.)
My father always said that two reasons (not necessarily the only ones) APL never became widespread was that 1) you'd only ever need a tenth as many programmers, and 2) IT department managers don't like having only a tenths as many people working under them.
2
@MartinJaniczek Wow, you've become a real APLer. Yes, the APL code is often easier to understand/read than needless abstraction into English names.
(My father's handwritten logo.)
How about a T-shirt saying "+/ or \sum_{i=1}^N"?
@Adám The sentence I wrote above would be utter falsehood in any other language. "We need abstraction!" "Structured programming!" Well, maybe not, or just a sprinkle. APL certainly rewards more "inline" style, yeah.
22:28
@MartinJaniczek "We need abstraction!" is one of the those things Aaron Hsu loves to shoot down.
@Adám I saw the Obesity talk, seemed to touch on that :)
But I'm guessing Aaron's style is not the usual APL style either? I mean, it's even more dense than usual
His style changes a lot.
A lot of people feel tempted to define _Filter←{⍵/⍨⍺⍺¨⍵}
what about something like this where B is × and C is ⌈
(my amazing latex based graphics design)
22:30
Re other languages, not to dunk on it but I even thought about learning a bit of Futhark, but after seeing the definition of matrix multiplication I had to close the tab :(
Knowing it's 3 characters in APL, that is.
It's 1 character in numpy ;)
@rak1507 Sure, but what is ∨.∧ then?
And ∧.=
someone cleverer than me would probably know
Or ⌈.⌊
I don't even know what that does
22:34
Same as +.× but with and ;-)
Huh, I'm getting university flashbacks with minmax :)
On two vectors, it'd be the maximum pair-wise minimum.
Right, I'm not sure when that would ever be useful
But I guess it could be
Game theory
Chess engines and so on
I'll take your word for it
22:40
23:02
That's good
Now try writing +∘÷/ in TMN!
23:19
Wow, is that continued fraction? Very cool
Yes, and also -/ is alternating sum and ÷/ is alternating product.
⋄ +∘÷/25⍴1
@Adám 1.618033989
23:35
<moon-child> shouldn't exists be ∨/, and ∧/ would be for all?
moon-child: Of course. Typo.
⋄ +/÷2*⍳100
@MartinJaniczek 1
@MartinJaniczek Maybe more interesting: ⋄ +\÷2*⍳10
@Adám
┌→───────────────────────────────────────────────────────────────────────────────────┐
│0.5 0.75 0.875 0.9375 0.96875 0.984375 0.9921875 0.99609375 0.998046875 0.9990234375│
└~───────────────────────────────────────────────────────────────────────────────────┘
23:39
⋄ (⍟2)--/÷⍳10000
@MartinJaniczek 0.0000499975
I'm enjoying this TMN alternative :)
⋄ 1∧+∘÷\15⍴1
@Adám
┌→───────────────────────────────────────────┐
│1 2 3 5 8 13 21 34 55 89 144 233 377 610 987│
└~───────────────────────────────────────────┘
wait what?
23:41
<moon-child> ⋄(-∘1,'÷',⊢)¨2*⍳10 ⍝rational numbers!
⋄ (,÷∨)∘1○1
@Adám
┌→──────────────┐
│5419351 1725033│
└~──────────────┘
⋄ 5419351÷1725033
@Adám 3.141592654
@Adám Curiously putting that into @dzaima's Android app gives me just iota. Is there some difference in behavior of and?
23:45
@MartinJaniczek I think dzaima/apl's \ is left-to-right.
@MartinJaniczek ^ yep. dzaima/APLs slashes are all different from Dyalog
also there's no comparison tolerance, so floating point doesn't make sense (and probably should just be disallowed). Besides that, +∘÷/¨,\15⍴1
I still can't get over how GCD and LCM can be used to get numerator and denominator of a float
⋄ (1∧2.5) (÷1∨2.5)
@Martin Janiczek
┌→──┐
│5 2│
└~──┘
although yes I'm seeing the issues with eg. 3.3
What's the problem?
23:55
The numbers get very big
instead of 33 10
⋄ (,÷∨)∘1⊢3.3
@Adám
┌→────┐
│33 10│
└~────┘
A different algorithm would be needed :)
Hmm
@MartinJaniczek If you like all this, you may also like ⍣¯1
I read about that!
Blew my mind just a little :)
23:59
Did you try the numeric solver?
@MartinJaniczek your ⎕ct may be 0 (or otherwise a number too small)
@Adám No no, can you elaborate?
@dzaima Works for me with ⎕CT←0

« first day (1447 days earlier)      last day (1504 days later) »