« first day (848 days earlier)      last day (687 days later) » 

12:05 AM
@rak1507 I had this
probably only usable as a utility function like you said
 
12:38 AM
@ngn fwiw now that k9 has (f)^ i think it's around the right way
@rak1507 I wish @[;0,-1+#;f] worked
Or similar 'apply to x' logic - boolean arg might be better
 
ngn
@chrispsn that would be yet another conflict between convenience/brevity in some cases and functions as first-class objects
 
@ngn just enlist the function if you really want to amend a dict keyed by functions
 
1:12 AM
btw what is the intended behaviour for 'update first and last' for a list of length 1? ngn.bitbucket.io/k/…
 
2:09 AM
@chrispsn yeah, same
@chrispsn good question, didn't consider that
 
 
2 hours later…
4:38 AM
it's unfortunate we can't get an each-left into (f)# here
 
 
1 hour later…
5:54 AM
aha. if we had a (f)! overload then k9 style could get one char shorter (in ngn/k it's same char count)
depends if processed items are the keys or the values - i think values is better? works better with 'group' etc
 
6:06 AM
I'll send a request for a K wiki today
does the subdomain k-wiki.miraheze.org sound fine?
 
@ngn why isn't group executing here?
@Razetime can you get k.miraheze.org? if not, it sounds fine
 
sure i can request that
 
@chrispsn ah nvm - got the colon wrong. fixed
 
6:27 AM
found a good emacs extension for k/q: github.com/psaris/q-mode
 
 
2 hours later…
8:28 AM
wouldn't it be better for cut to behave more like split, e.g. having an implicit leading 0? What's more common, needing to write (0,x)_y or otherwise 1_x_y?
Also k9 cuts on sets: "ab"^x cuts on "a" or "b". but you cannot use it as split because the head is missing.
there are also converters from wasm to asm.js. e.g. binaryen/wasm2js. @ngn hasn't been your k.wasm much smaller? it's 728k now, converted to js it's 3M.
you could also try to load wasm and if that fails fall back to js.
 
8:59 AM
@ktye apparently it's so that the result matches the length of the x argument (or in the Boolean case, the sum) - ngn can elaborate
 
 
1 hour later…
ngn
10:03 AM
@chrispsn that was my theory until i realized arthur never actually reuses left args :)
 
also the cutlist is ints and the result e.g. pointers which may not have the same size. i don't think cut to be a natural extension to drop. it's more of a forced one, combining two things: cut, then drop the first element. it does not drop multiple things.
 
ngn
@ktye well, (,i)_ is ,i_
 
10:55 AM
@ngn the size increase happens at these commits (in your bitbucket repo):
d8e7b5e1abf3d35bdfe0e6ea64760aac7d828e19 728 k/k.wasm
4ae5029cf4d0b880c001b16f625a67bade24170b 140 k/k.wasm
ea0f8ee97add9cdd20c38dcfebb477a986463dd4 116 k/k.wasm
apr22
@ngn due to change to llvm-10? release notes say "the wasm-opt tool will now be run if it is found in the PATH". if i run it manually (e.g. with -O3) the size decreases to 117k.
 
ngn
i have a much bigger problem now - thanks to my recent experiments with emscripten i can't even compile to wasm
@ngn whew, turned out i just had to reinstall the right version llvm
 
@ngn or switch compilers to github.com/ktye/wg. much simpler.
 
ngn
@ktye and languages (c -> go)? :)
 
11:10 AM
that's just a syntax layer.
maybe sth similar is possible for the c pre-processor, which you use so excessively. just generate wasm text format instead of c from it.
 
ngn
@ktye the jump in size happened when i switched from "clang10" to just "clang" (which is clang11 on my machine)
 
11:59 AM
btw here's our old discussion about cut from mar 2020
 
12:21 PM
@ktye I agree cut isn't a logical extension of drop. One outputs a list, the other a list of lists
@ktye and agree with this - (f)^ is the least useful (f)dyad
Though workarounds like 'prepend a splitting character to the input' or 'run a (possibly seeded) eachprior' still make it useful
 
ngn
@chrispsn rank(result) = 1+rank(leftarg)
 
1:00 PM
@ngn can you do a cut with a >1 dimensional left arg?
Maybe a dict?
 
ngn
@chrispsn i knew you'd try to explore that :) "deep cut"?
 
@ngn you could do repeated cuts like a k9-style reshape, but I have no idea what a single application would look like
Actually maybe it'd be like deep indexing... start by looking at say (;0 2)_3 3#!9
 
ngn
(0 3 6;0 3 6)_sudokuboard9x9 could mean "cut into 3x3 submatrices"
 
Gives ((0 1;,2);(3 4;,5);(6 7;,8))
@ngn yeah interesting
Can even apply to a shallow list if rank sensiti- ok enough
 
ngn
1:16 PM
:D
 
 
1 hour later…
2:19 PM
Announcement: k.miraheze.org is now live!
4
 
 
3 hours later…
ngn
5:14 PM
@Razetime nice
should i take down ngn.bitbucket.io/k.html now?
 
5:46 PM
i'm thinking about flags for general lists, if all members are unitype, e.g. list of chars and if they have the same size (e.g. a matrix). @ngn do you have anything like that?
 
ngn
@ktye no, i don't
 
 
1 hour later…
ngn
6:56 PM
@ktye did you adopt rank-sensitive find for your languages?
 
7:07 PM
@ngn no. what can you do with it?
 
ngn
@ktye just wondering how it can be implemented in a meaningful way
 
@ngn is it easy to understand what it does?
 
ngn
@ktye well, intuitively i understand why one would want rank-sensitivity but the devil's in the details
 
ngn
7:40 PM
@ktye i think the case where both x and y are unirank is easy to understand and implement
 
does k9 do that?
 
ngn
@ktye k9 is even more restrictive
last time i experimented, it allowed the ranks to differ by at most 1
i don't think there's a good reason to restrict it that much
goodness.. why??
 
7:56 PM
currently i do x?\:y if both are lists. maybe that's not right.
i mean x?/:y
 
ngn
@ktye what do you return for ("car0";"car1")?"car1" ?
 
ngn
@ktye what about (("car0";"driver0");("car1";"driver1"))?("car1";"driver1") ?
@ktye so you don't treat "car1" as a list?
 
2 2. this does x?/:y.
if x is a general list and y is not, it's matching y against each element of x
 
ngn
that looks strange
i assume the main motivation for the rank-sensitive interpretation of "find" is to make it closer to an inverse of @
so, if y:x@z it should follow that z~x?y in as many cases as possible
when rank(x)=rank(y)+1, i think it's clear what x?y should do - find y among the major cells of x and return a single integer
in k "major cell" is the same as "element", so it's simple enough
 
8:18 PM
or if both x and y are general lists, return an index list (for each on the right), because you can always force a single index with x?,y
 
ngn
now, if rank(x)=rank(y), i think x?y should return an int list - the positions of the elements of y among the elements of x
@ktye i think we should reason in terms of ranks, not general list vs typed list
 
not sure. what is the rank of ,"abc" ?
 
ngn
atoms are rank0, typed lists are rank1, general lists can be rank2+
@ktye 2
 
k is not apl. i don't know if it should consider ranks.
 
ngn
it's like apl but unifying the concepts of rank and depth :)
so, instead of rank, you could think of depth, and it would be exactly the same
 
8:25 PM
but then you need to calculate the depth everywhere.
 
ngn
not all k arrays are unirank, of course, but we could ignore those for the sake of argument. maybe reject them with a domain error or something.
@ktye yes. that's easy to do if we can assume unirank, but in reality unirankness would probably have to verified
 
my implementation is wrong in that it should not recurse.
 
ngn
i think recursion makes sense when rank(x)<rank(y)
that would comply with the principle of ? being @'s inverse
 
 
1 hour later…
9:51 PM
@ngn probably not
definitely not until something equivalent is on the new wiki
 
ngn
@rak1507 there is this
 
ah, cool, in that case you probably could, but it's still a useful thing imo
what's 'ThePlatform'? looks like an attempt at doing open source (?) q
apparently the language is called 'O'
 
ngn
@rak1507 something like that, it was going to be something fast and practically oriented, but idk what happened to it
it was going to be released "soon"
 
yeah the webpage still says copyright 2020 more than half of the way into 2021
wow, this is quite cool
 

« first day (848 days earlier)      last day (687 days later) »