« first day (1319 days earlier)      last day (758 days later) » 

12:45 AM
@ngn Oh wow, so you went from ~64ms to less than 880μs in ngn/k?
@voidhawk yes, by translating your algorithm and using it instead of mine
That's kind of cool that you saw improvements over Dyalog, I guess with the smaller k runtime you're at least a bit more efficient if the algorithm is just doing indexing/math
@voidhawk depends. the smaller runtime is one advantage. on the other hand dyalog can use narrower types - 8bit and 16bit ints, while in ngn/k they can only be 32bit and 64bit.
I looked at k a little bit, I was pleasantly surprised to see dictionaries as a first-class datatype. I think that's the one thing missing from APL such that I would deem it "general-purpose", some algorithms are really hard to implement without them (I know there are workarounds and ⍳ is fast enough most of the time, but still)
@voidhawk right, k dicts are beautiful :)
1:17 AM
@voidhawk 1500⌶ ?
Hrmmm, on update does "efficiently update the hash table" mean it doesn't recompute the whole thing? That's better than M∘⍳ , at least
1 hour later…
2:29 AM
@Adám is this still a thing? github.com/abrudz/kk
2 hours later…
4:42 AM
@Adám yes it does, just tells me I failed the first test case
@Adám Let's say I have a matrix A.
1 0 0
0 1 0
0 0 1
and B.
1 0
0 1
how do i find the number of occurrences of B in A?
5:05 AM
not sure if this is the best way, but if you stencil A with the shape of B then you get all 2x2 matrices in A
⋄ A←∘.=⍨⍳3 ⋄ B←∘.=⍨⍳2 ⋄ ({⊂⍵} ⌺(⍴B)) A
oh no bot
there, that's what I was thinking; then you can compare B against each of them, and count how many match
5:34 AM
that's cool
This stuff is advanced, but I want to see if each 2x2 block has rotational symmetry with the original
1 hour later…
literally B⍷A wow, much nicer
I was setting up an awkward power-rotate {(⌽⍉)⍣⍵⊢A}¨0 1 2 3 approach to rotational symmetry, that's probably easier another way too
Yep that works, or something like (⌽∘⍉⊢)\4⍴⊂
So count of rotational equivalents of in could be like {+/∊⍺⍷⊃⍪/(⌽∘⍉⊢)\4⍴⊂⍵}
Oh, that'll count invalid edge combinations, just {+/∊⍺∘⍷¨(⌽∘⍉⊢)\4⍴⊂⍵} then
7:12 AM
in this one, you need to find only matches of 2 2⍴' pP ' and 2 2⍴'p P'
2 hours later…
8:53 AM
@voidhawk ⊢∘⌽∘⍉\4⍴⊂ is a little shorter. one of the things from k that i miss most in apl is an iterative version of .
9:20 AM
@cannadayr this link takes you to the shakti group chain, once you get access: groups.google.com/g/shaktidb/c/7CI9RyTFBb8/m/LgUvjPePAwAJ
9:53 AM
@dzaima (obvious way of fixing that being to implement native )
10:07 AM
@Marshall (also you may want to now not use as the example of "constant" here)
10:20 AM
@Adám the ⎕TRAP←trap_spec APL snippet redirects to the wrong tio link
7 hours later…
4:57 PM
@dzaima Got it.
I also added this extension to Group, and Group Indices with 2==𝕩.
5:42 PM
I see kdb advertising their small runtime size, but I am skeptical that is a dominant factor in difference of performance until I see benchmark numbers that show significant icache misses because icache misses are not typically the first place you look for perf issues since hot loops often fit into the icache.

I think that the aplcart is really cool, but I was wondering if there was a place which is more curated or guided for learning? There are a lot of small variations on different themes and there's no natural ordering, so I haven't had success using it in that role. I guess the closest
@eyepatch I'm pretty confident instruction caching isn't relevant to array language performance.
That would be pretty typical. A small runtime might help with branch prediction, but I can't think of any other ways in which a small runtime would be important for performance.
My experience has been that performance oriented code more typically has a larger runtime because it has more variations, each of which is specialized to the particular situation. e.g. different algorithms for index-of for small left and large left.
Oh. You did BQN! Makes more sense now. @Marshall as far as I could tell, BQN is self-hosting but did not compile down to C, is that correct?
I see you did more discussion on HN. I only saw it through the apljk reddit.
@eyepatch Yes, it currently targets bytecode. I did some early experiments with compiling to Wasm, and I'd like to get it running on Wasm (plus some little Javascript escapes for dynamic compilation and other features Wasm doesn't have yet) eventually.
Sorry. Which bytecode?
5:59 PM
@eyepatch A BQN-specific one, with instructions to call functions and modifiers, assign to variable slots, and so on. Pretty typical for a bytecode interpreter (although dzaima/BQN can transpile it to JVM bytecode, and the Javascript implementation transpiles to Javascript).
Little fanboy moment. Just wanted to say how much I've enjoyed the talks you've given at the Dyalog conferences. Especially about thunks and binary searches. They're an inspiration even if you don't use APL in production.

Oh. So you have some kind of BQN interpreter. That's written in js?
Oh. I see. I didn't read the running page. nvm. mlochbaum.github.io/BQN/running.html
@eyepatch Yeah, that's the place to go. The page on BQN relative to Co-dfns has a little more information as well.
In addition the the Javascript implementation I have most of a NumPy runtime, which I'll push once it can self-host.
@eyepatch Thanks for that! It never seemed like the things I published at Dyalog circulated that much, but I'm always glad when I hear people liked them.
I feel like it would resonate pretty well with parts of the C++ community if it can get across the language barrier.

Question on terseness. I understand the appeal of having the code be maximally dense, fit on one screen, etc., but what's the advantage of having such short file names? I generally keep my code pretty dense, but I don't skimp on file names, and I usually have pretty extensive comments in my file footers.
Oh. I see, you plan on adding comments, but as a TODO. My one suggestion on the documentation is that it would be handy to have links from sub-pages in the documents back to the index.
@eyepatch Short filenames here are not really a deliberate choice: filenames don't matter much to me so I'm more or less just following other implementers.
@eyepatch Okay, I'll add those when I have time. I think every subfolder but implementation (which only has the one page now) has an index page, so you can also navigate by truncating the URL.
6:16 PM
Understood. I realize that the culture is to prioritize the benefit of experts and the author over newcomers, but more descriptive file names seem to have a large benefit to newcomers at no cost to experts. If the typing, etc. is painful, I setup symlinks locally. So, I might have a directory ~/src/leveldb-actors, and a symlink ~/ldb to ease typing.
Yeah. I've been truncating the url, but hyperlinks are more convenient in Firefox. It's not that inconvenient to truncate, or to start from the index.
@eyepatch I just try to keep the first letters unique so tab always completes fully. So you'd say the documentation filenames like "leading.html" are too short?
No. Source code.
BQN/c.bqn vs BQN/src/c.bqn means that if I want to browse, etc., then I can't really guess at the contents.
Take it with a grain of salt. I see single letter names across a lot of projects like Codfn, but I haven't seen the light as to the advantage of it.
@eyepatch Got it. I was just wondering if that applied to docs as well.
Nah. Those are perfect imo.
@eyepatch I think it is probably aesthetic as much as practical, but the people who do it aren't likely to describe it that way. Single-letter variables in APL or K code do make sense because otherwise they are much longer than the primitives which makes reading a little difficult, but I can't imagine an environment where strict one- or two-letter filenames are much better than four- or five-letter ones.
6:24 PM
100% on board with single-letter variables and representing hierarchy and locality with two and three letter variables. Filenames seem essentially different to me because my text editor isn't affected by the file name for how much is can present.
I guess you could say it's overextension of a pattern that's often useful. At a step removed, when you have the experience to prefer one-letter variables when they make sense you start questioning whether every character is needed and get sort of offended if there are too many.
On the other hand, I have acquired a fair amount of experience wondering whether a word or disclaimer is necessary, leaving it out, and then running into the exact confusion I was worried about when I wanted to include it. I wonder how the writers of K documentation have avoided that.
:55457408 I've somehow gotten into this weird spot where I mix vim and kakoune. Mainly because opening extra windows in vim is much easier.
6:41 PM
OT, so feel free to tell me to take it elsewhere. I use i3, so opening windows in kakoune is rarely a problem for me. vim works more reliably over ssh + tmux, so I have to use it sometimes, and I don't think kak has word-wrapping builtin, so I switched to vim for your docs. In short, same here.
@eyepatch There is a script to wrap when typing (which doesn't work all that well) but no wrapped display. That's why I'm using vim on the docs too, I guess. I have xmonad so I can manage a lot of kakoune terminals with no problem, but I still have to navigate to the file again. Is there an easy way around that?
I run kakoune in server mode and attach new clients. The clients start from the same directory (:cd) as the server.
kak -d -s bqn ; kak -c bqn or something.
There are also the x11 commands built into kakoune
7:07 PM
@eyepatch Thanks, that works pretty well!
7:44 PM
is there a way to change the RNG seed in dzaima bqn?
@Marshall your nanosecond search talk is one of my favourite tech videos of recent years; explained clearly enough to follow how you can do it, and enough wizardry to be amazed that you can do it. I've tried to share it a few times, without much traction.
(separately, anyone) Is it possible to put a string with control characters in TIO.run? It's complaining about unbalanced quotes for my golf tio.run/##SyzI0U2pTMzJT///…
@cannadayr •rl←seed
8:23 PM
@Razetime Never really was, other than reserving the name.
@Razetime Thanks. Fixed.
@eyepatch Check out APL Wiki's learning resources.
@TessellatingHeckler Use Input instead.
9:20 PM
@Adám Thanks! Now I can have a TIO link in my golf answer codegolf.stackexchange.com/a/210619/571
It can probably be done better - there are Python and C answers which beat it, but it's fairly competitive.
9:54 PM
@TessellatingHeckler how did you come up with that 78|7⊥?
10:50 PM
@TessellatingHeckler 31 bytes: (⎕a,'LORSUXYY')[34|72|528|6⊥⍋⍞]
11:19 PM
I did a lot of things like this:

:For j :In 1+⍳99
:For i :In 1+⍳9
:If 26≡⊃⍴∪{j|i⊥⎕UCS ⍵}¨singers
@ngn How did you come up with that, that quickly??
@TessellatingHeckler i wanted to bring the singers to a smaller ranger, so i did something similar to you with multiple mods, which took a lot of time actually (~half an hour, i think). in the meantime i was thinking about how to make use of it and came up with the general structure of the solution.
as for ⍋ early on i found it through trial and error (i also tried: ⍒ ⍳⍨ ⎕a⍳ and a couple of others), and it turned out to be a nice surprise that something as short as ⍋ gives unique results for the singers
for the (⎕a,..) part, i computed all remaindes 34| can produce for the singers, and laid them out in a table like this:
⍝A B C D E F G H I J K  L M  N  O P  Q  R S T  U V  W  X Y Z
⍝0 1 2 3 4 5 6 7 8 9 10 . 12 13 . 15 16 . . 19 . 21 22 . . 25 26 27 28 29 30 31 . 33
as 11,14,17.. can never occur, i used their corresponding letters to fill in for 26,27,28..
the second to last letter in 'LORSUXYY' doesn't matter actually, i should have put a . or _ there for clarity
Grade is clever; base-force shows that 99|2⊥⍋⍵ is pretty clean and shorter than mine was, but not as short as yours is
How did you come up with 528, 72 and 34 specifically?
@TessellatingHeckler similar to your method
this is my ugly bruteforcer: {m←⍵⋄26=≢∪{m[0]|m[1]|m[2]|m[3]⊥⍋⍵}¨a:⎕←'m'm}¨,(26+⍳10)∘.,(26+⍳99)∘.,(26+⍳999)∘.,(¯10+⍳20)
(a is the list of singers)
11:43 PM
@ngn big enough to be a WS FULL
@TessellatingHeckler export MAXWS=4G
11:57 PM
a neat combination generator

« first day (1319 days earlier)      last day (758 days later) »