« first day (408 days earlier)      last day (1127 days later) » 

3:09 AM
on filling arrays very quickly news.ycombinator.com/item?id=22104576
(re: fast 'where', and figuring out what k lacks here in its primitives to make this fast - perhaps 'where' is meant to be the way k does fast fills)
 
 
4 hours later…
6:49 AM
@JohnEarnest reticulum in special k is so cool. the code output reminds me of ispc ispc.github.io
 
 
2 hours later…
8:47 AM
i assume with seeded over/scan taking the form seed dyad/:list form, the monadic form (for situations like {~10=#x} (1,)/:1) will also arrive, but is currently broken
(aside: should the condition be flipped? ie keep going until?)
i guess this way the condition can use the same truthiness as triadic $ ie empty list is false
what stops the monadic converge/do/predicate forms living on the no-colon version?
the fn will need to be explicitly monadic so that it's disambiguated from dyads so that it can share with seeded each/over, anyway
 
Can functions have more than 3 arguments in K?
Ok, apparently they can. I just accidentally separated them with commas instead of semicolons
 
 
1 hour later…
ngn
10:08 AM
@ksi nice improvement
so, you're building an index matrix like (0 1 1 1;1 0 2 2;2 2 0 3;3 3 3 0) instead of (0 1 2 3;1 2 3 0;2 3 0 1;3 0 1 2) and that improves locality when joining with ,/?
 
 
2 hours later…
11:56 AM
I don't understand why in k, you can compose function from left to right like this:
f: *400> which take first argument, then test with 400>.
 
ngn
@HaoDeng are you sure it doesn't evaluate 400> before * ?
 
@ngn You are right :)
They are actually exchangeable ( commute).
 
 
1 hour later…
1:28 PM
{x}f/y is an each-right: (10+)@/!10 -> 10 11 12 13 14 15 16 17 18 19
you'd lose that case if it were interpreted as 'until'. but once again, the deeper objection is that we'd have unconditional converge on /: and conditional converge on \, a needless source of confusion for newbies.
 
@StevanApter aha - got it
 
 
2 hours later…
ksi
3:22 PM
@ngn probably, but the speed difference is much smaller in ngn/k, maybe it's more useful when joining in parallel? i am not sure whether k9 does it in parallel.
 
ngn
3:45 PM
@ksi it doesn't do it in parallel (yet?) - i can see that in the cpu usage widget on my taskbar
@ksi i suspect k9's ,/ is optimized. there's a big difference when i replace ,/' with ,'/+
,/ could compute the length of the result before it starts filling it in. in ngn/k i don't do that yet.
 
ksi
@ngn i see, otherwise you need keep copying the intermediate result as it grows
 
ngn
@ksi yep
btw, i was thinking of introducing some kind of buffer-like structure for the general case, when the length is not known in advance
and the items of the result are appended one by one
 
@ngn reinventing vector/ArrayList? (in dzaima/APL i got a 2x speedup in permutations from switching from doubling size on full to precalculating size)
 
ngn
to avoid unnecessary copying, the buffer could be realized as a list of lists - each being twice as large as the previous. append() appends to the last one if there's enough room, otherwise allocates a new one. this way, once the operation is done, it's easier to combine the chunks because the precise length is known.
@dzaima actually trying to avoid what they do
 
4:00 PM
@ngn hm, that could be pretty good for an append-only array. i did a similar thing once for the layers of a binary heap
 
ngn
@dzaima yeah, i mean it for append-only, used internally for things like each with a user-defined function
bad example, sorry
things like converge-iterate
 
ngn
4:14 PM
@ksi permutations and combinations are much faster in ngn/k at the moment because it can use chars as ints :)
 
@ngn What's the algorithm of the P function in e.k? especially the magic binary number
 
ngn
@HaoDeng it's the standard sieve of erathostenes with tweaks - no even numbers, and initially it's populated with a pattern that already has punched holes for small primes
oh, and it's recursive - it generates primes up to sqrt(n) and then uses them to sieve the rest
 
Thanks. like the wheel factor but for first 15 numbers.
 
ngn
@HaoDeng the evens are missing, so 30 numbers - that's 2*3*5
i could have done 2*3*5*7 but it was getting rather long
@ngn oops, i should learn how to spell "eratosthenes"
 
 
2 hours later…
6:20 PM
How do we write to stdout? Is there anything like Q's 0N! which print any x on stdout, and return x?
 
ngn
@HaoDeng in k9? " \" (space backslash)
 
Thank you. Yes.
Do you have a document somewhere?
 
 
3 hours later…
ngn
9:07 PM
@HaoDeng in the repl "\" (backslash without a leading space) prints a one-page summary
@HaoDeng there's also "k9 simples" - unofficial documentation
 

« first day (408 days earlier)      last day (1127 days later) »