« first day (952 days earlier)      last day (583 days later) » 

11:25 AM
@ngn your rnd for normal distribution is very slow (on wasm):[this](https://ngn.bitbucket.io/k/#eJxTttc1NAADLgAMOQHr-) basically hangs.
this is a [histogram](https://ktye.github.io/#plot%20%60x%60y!hist%5B100%20-4%204%3B%3F-1000000%5D) with the same input size
 
 
3 hours later…
ngn
1:57 PM
@ktye that's not normal distribution though. i don't support it. ?-n just happens to be doing the same as ?n - generate n floats between 0 and 1.
 
@ngn but why does it take so long if it's the same as ?n. ?n is much faster.
 
ngn
@ktye ah.. actually, it was trying to generate unique items..
i implemented ?n like this: n?0 to generate longs, then set the first 12 bits to 011..1, reinterpret as doubles, and subtract 1
 
ngn
2:49 PM
important change in ngn/k: types `B`H`I`L now appear to the user only as `I. serialization can be used to discern between them.
 
ngn
3:25 PM
@xpqz shorter p136:{x[0]-*|x@:>,/x} (also works for !0)
 
ngn
3:39 PM
p134:{~(*|0,m)|/0>m:+\-/"()"=\:x}
 
 
1 hour later…
4:39 PM
@ngn is there room to have f':atom "work"?
 
ngn
@coltim idk. what should it do? do you mean f as a monad or dyad?
 
f as a dyad
 
ngn
unrelated: any idea why E is not a valid grade in countries with alphabetic grading systems? (p163)
 
as for what it would do, I assume something similar to dyad/x (use the hardcoded identity element if available, otherwise leave unchanged?)
 
ngn
if we consider atoms to be infinite lists of themselves, f':atom could be like apl's f⍨a :)
 
4:48 PM
does monad':x make any sense in the each-previous sense?
or is it a "missing" overload?
 
ngn
it might depend on dialect, but iirc n monad': is stencil and monad': is peach
i don't have either of them
i'll add stencil soon..
 
@ngn I thought that was i'x?
(with I'x as bin-search)
 
ngn
that's "sliding window" or whatever it's called
 
oh right
 
5:03 PM
what's the use case of stencil? isn't it just f applied to a sliding window?
 
ngn
5:15 PM
@Traws i would guess that n f':x create a temporary slice of x and deals with it before creating the next one, so it consumes less memory overall and in some cases this can be faster
but i could be wrong. i used to assume something similar about filter too, but then k9 surprised us with the non-eaching version.
 
 
2 hours later…
ngn
6:53 PM
@xpqz shorter p133:+/1<':^:
p151:~/{x@<x^:x^abc}'_:
shorter knight moves: {5=+/'x*x}#+2-!5 5
 
7:16 PM
@ngn 1-indexing your variable names? tsk tsk
 
ngn
@coltim that's how dyalog numbered their problems
@ngn oops, the knight moves aren't in the same order
 
ngn
7:31 PM
@coltim after "p" the first two digits are the year and the third digit is the problem
but i didn't like p158,p159,p1510 (!) so i changed 10 to roman "X" - p15X :)
 
@ngn just feels more K-ish to start counting from 0. bypassing the "1510" or "15X" is just a nice benefit =P
 
ngn
well, if we had the desire and resources to organize our own competitions..
but in xpqz's solutions to dyalog's a different numbering would only cause confusion
 
7:46 PM
@ngn just thought it was an opportunity for a dumb/unnecessary in-joke =)
 
ngn
great opportunity to advertise my new website :)
@coltim more jokes: ngn.codeberg.page
@coltim try setting []io here :)
 
@ngn what's wrong with static typing?
 
ngn
@ktye nothing, it's just not necessary in an array language, as arrays already carry their type information
also, it would be too verbose and annoying to declare types in an apl-like language, so they'd have to be inferred, and that's complicated..
 
@ngn i thought about having some tooling that catches errors in k. type annotation could be one thing. i would infer them, e.g. i:3 is an integer. Now a function could be declared like f:{[xi;yIF]x+y} and for x only int atoms are allowed, y would allow int ant float arrays.
Maybe that could be used to compile k code with specific code. maybe @dzaima or @JohnE expressed similar things.
 
ngn
@ktye i wrote this when someone mentioned in the apl room that aaron wrote an academic paper about static typing in apl, and they seemed to be taking such papers seriously, so i decided to write an academic paper too :) (translation to LaTeX - pending)
 
8:03 PM
@ngn about your new page. one thing i never liked about the editor|output is that the output is not a terminal, where you can inspect things trying to understand what's going on. i would merge them in one page, and maybe hide the editor if you don't want it.
 
ngn
@ktye huh! i like the editor|output view much more than the repl, to be honest
 
@ngn that's ok, just make the repl interactive.
 
ngn
i was even planning to remove the repl..
 
@ktye you mean, make the output interactive?
 
@dzaima yes,
 
8:06 PM
@dzaima I feel like that'd be a pretty nice interface. An editor for writing actual code, and a REPL for testing it/playing around. Executing the editor code resets the REPL to a fresh one, with the code executed
 
btw. i reworked my page as well. it's black on white now. no more buttons. you get the editor with \e and back to repl with \
only the last line get's executed (with a bold prompt).
 
ngn
@dzaima that's @nathanrogers's workflow
 
On apl: has there been any apl with leading axis agreement besides j and now bqn?
 
ngn
@ktye k?
 
@ktye maybe A+?
 
8:13 PM
@coltim a+ i don't think so. i check it out this morning.
 
APL wiki - don't see anything other than J, A+ and BQN mentioned
 
    A+
     Copyright (c) 1990-2008 Morgan Stanley.  All rights reserved.
     This version is Release 4.22
     $mode ascii
     (2 3 rho 5)
 5 5 5
 5 5 5
     (2 3 rho 5) + 2 3 4 rho 6
//[error]  +: rank
 
maybe that's the "Scalar Dyadics" exception
 
by the APL wiki table, A+ indeed doesn't have leading axis agreement for scalar dyadic fns
 
ngn
@ktye and does (3 4 rho 5) + 2 3 4 rho 6 work?
 
8:17 PM
@ngn no. rank error.
 
ngn
so a+ has neither leading- nor trailing-axis agreeement
on the other hand, k: (2 3#5)+2 3 4#6
 
@ngn you are right. k does it. maybe that's why i was astonished that it's not available in apl.
 
ngn
you know, apl has +/ and +⌿
+/ which looks simpler than +⌿ is last-axis
 
what about the bracket rank thing? =)
 
@coltim +/[i] has been there since 1966. +⌿ not.
 
ngn
8:22 PM
+⌿ is just +/[0]
leading axis agreement in dyalog, using [ ] - tio.run/##SyzI0U2pTMzJT///…
ooh, even mixed-axis (leading and trailing) agreement works :D tio.run/##SyzI0U2pTMzJT///…
 
ngn
8:42 PM
@xpqz p202:{(&~2=-64!x)_x} /much shorter
 
ngn
9:13 PM
p209:{x~*\x=:|\x}
argh.. p209 is wrong
p209:&/{x~*\x=:|\x}'|:\ /there - fixed it :)
 
ngn
9:31 PM
@ktye regarding outputs and repls - my answer has always been: if you want to test something, just add an expression at the bottom of the editor and run it again. unless you somehow manage to make things really slow, there's hardly any difference with a repl.
trace (space-backslash) is a good tool too
 
9:56 PM
@ngn nice
 
ngn
@rak1507 thanks :)
now let's see how my art will be received in matrix
 

« first day (952 days earlier)      last day (583 days later) »