« first day (387 days earlier)      last day (1148 days later) » 

12:58 AM
@StevanApter it was, but was called 'name' or 'string'
@StevanApter i don't fully understand why k9 can't have projections like this. k7 had 2/3/4 arg versions of @, for example, and it wasn't a problem there
2019-09-25 14:44:44 2core 3gb avx2 © shakti l test
 @[;1]"abc"
"b"
 @[;1;"d"]"abc"
"adc"
 
ksi
1:37 AM
@ktye i find the spacey verb idea quite like the builtin functions in k3, where they all have a leading underscore, like _sin, iirc. except that your idea expands it to non alphabet characters.
 
 
3 hours later…
4:30 AM
i had never thought deeply about the relative speeds of unique vs grade vs sort
although k9's speed is still in the works (SIMD-related?), it's interesting that the relative difference between the ops is similar to k7:
2020.03.27 (c) shakti
 a:10000?10
 \t:100000 ?a
2482
 \t:100000 <a
3392
 \t:100000 ^a
4578

2019-09-25 14:44:44 2core 3gb avx2 © shakti l test
 a:10000?10
 \t:100000 ?a
527
 \t:100000 <a
2265
 \t:100000 ^a
2999
 
 
3 hours later…
7:15 AM
@ngn:
2020.03.27 (c) shakti
 ~/(<;>)@\0 0
1b
stable sort, yeah?
 
7:33 AM
also - so this is sort of like a step function find:
 (,x),,2 4 7': x:!9
 0  1 2 3 4 5 6 7 8
-1 -1 0 0 1 1 1 2 2
yet its 'too small' case is assigned -1 instead of the 'too large' case getting #x ie 9
i guess i'm trying to understand why it's useful to have #x for 'no match' for ? but -1 for 'too small' for L':
 
 
1 hour later…
ngn
8:40 AM
@chrispsn don't you think it should be that way?
 
@ngn yeah! it's a recent update. just bringing it to your attention
 
ngn
@chrispsn that output format though..
 
do you also see this (or is it a terminal issue on my side)?
(1;(2;3f);4)
1
(..)
4
 
ngn
@chrispsn for comparison, dyalog's dyadic ⍸ works the same way: ⎕io←0⋄⍉x,⍪2 4 7⍸x←⍳9
 
is dyadic-iota-underbar k's bin?
 
ngn
8:59 AM
@ktye yes. j has it too but the "too small" case is 0
 
@ngn how fluent are you in j, can you read it?
 
ngn
@ktye less fluent than in k and apl. with the help of the vocabulary page i can read it, slowly.
 
@ngn is that simply based on your background, or do you think j is somewhat harder to learn?
 
ngn
@ktye i think both. my eyes are not accustomed to j's excessive use of dots and colons and unbalanced brackets
also, j's array model is a bit different from apl and k
 
@ngn in what regard? is is always "boxed"?
 
ngn
9:08 AM
working with nested arrays is hard, you have to do something like "under disclose" a lot
also: "f each" is "f rank 0"
but it's a lot of fun to golf in j
@chrispsn #x for no match in "find" is just easier to implement, i guess. if nothing's been found after the search loop you just return the iterator variable as-is.
@chrispsn -1 for no match in "bin" makes more sense mathematically
this reminds me of the old "cut" and the slices - inclusive on the left, exclusive on the right
"bin" slices the integers like that, and there's an implicit leftmost slice that spans from -infinity to *x
 
9:24 AM
@ngn until some point k7 also returned 0. i considered it a bug and reported. arthur fixed it. i used bin for finding the index (after adding 1) in a sorted array. in the apl/k version it does not need a special case.
 
ngn
@ktye probably not so much of a "bug" as different design. i guess in j they wanted the result from I. to be usable as indices in another array without the need for 1+.
but i prefer the design with -1
 
but i always need to 1+ to find the index.
or maybe i talk about insertion-index.
i updated ngn. it's cool
$ ./a.exe
⍳:{!1+x}
⍳ 8
0 1 2 3 4 5 6 7 8
 
9:41 AM
@ktye usefulness is important! Even if implementation is slightly more complicated
 
@ngn you should allow infix, without apl.k will be hard:
⍳:!:
⍴:#
2 3⍴⍳6
'typ
2 3⍴⍳6
   ^
 
ngn
@ktye apl.k is probably too ambitious and pointless as an idea :) but it might be useful to reserve a certain range in unicode for future k verbs
 
@ngn it's certainly pointless to implement all of apl. but for giving current k an apl skin, it would be nice. however, sth like arthurs monad/dyad overloading would be needed. otherwise it's impossible to give two different implementations for a single apl character.
 
ngn
@ktye yeah, right
so this is yet another alternative for introducing user-defined verbs in k, in addition to the ones mentioned yesterday
 
9:58 AM
but things like phi pi epsilon are also good names for variables(nouns). not so simple. if you need to distinguish them, you may have to look for the unicode range. is it within apl range(verb) otherwise(noun). it's not exactly a simplification.
and you should't use an apl alpha/omega but a greek one.
 
ngn
depends on the choice of range. but in general i'm not terribly excited about non-ascii.
 
ngn
10:40 AM
@ktye the (..) looks intentional there. smaller example: (0;())
 
i assume it's temporary/nyi. also -v
 
ngn
@ktye no -v but:
$ ./k <<<'(0;())'
(0;())
 
 
8 hours later…
7:16 PM
@ngn did you change/simplify unq again? or improve fnd instead?
 
ngn
@ktye both :)
 
similar algorithm as we discussed, or did you revert it?
 
ngn
@ktye ?x is {x@&(!#x)=x?x} now
 
the shortcut for sorted input, is it in fnd?
 
ngn
@ktye er.. what shortcut?
 
7:26 PM
didn't we talk about optimising for already sorted x some weeks ago?
 
ngn
@ktye oh, i don't have attributes yet
 
Feb 14 at 8:14, by ktye
@ngn any comments on this? https://chat.stackexchange.com/transcript/message/53485307#53485307
your current UNQ has worst case complexity for sorted input, while it could be much faster than the general case.
 
ngn
@ktye uh, ok.. i forgot about that. i'd better revert.
i wanted to get rid of the special case for generic lists, but some tests are failing for the old version
with ~': instead of =': it works!
 
ngn
7:46 PM
with $[`X=@x;~;=]': it works for generic lists and has acceptable performance for others
@ktye thanks for catching my mistake
 
what is `X
 
ngn
the type of a generic list
 
ksi
8:01 PM
a stupid question: why do we assign some function to a precious ascii operator even if its fastest implementation is done with pure k? and in the meantime, ask for non-ascii verbs? i know it's very important for code-golfing, though. more generally, what is the right granularity of a programming language?
 
ngn
@ksi why do we assign some function.. - i need some level of syntactic compatibility with the original k because that's what people are familiar with. if i start making up too much syntax of my own, i fear nobody would be interested.
what is the right granularity - depends on the point of view
 
8:19 PM
@ksi the set of primitives is a pragmatic choice: the most useful for the estimated use case. it's not the bare minimum everything else can be build upon.
 
ksi
@ktye well, people may have different view on what's pragmatic. even all different k versions don't agree on that.
probably, we can have a skin layer for different pragmatic choices, or in apl style if you like.
^to clarify, it's not a suggestion. right now, i have no idea how it can be implemented neatly.
 
apl style being non-ascii variables/identifiers?
 
ksi
8:47 PM
@coltim i meant, like something @ktye tried, ⍳:{!1+x}. actually, z.k in k9 for more builtin functions feels like a skin to me.
 
we are mixing a few things here. k9 has the new .z.k mechanism that allows to define built-ins for both monadic and dyadic versions. ngn implemented a tokenizer that parses single unicode chars as symbols(varnames). i suggested a parser which handles 'x specially. my use-case was meant for embedding and extending k, which might be done with native code.
 
9:02 PM
@ngn struggling to build ngn/k, but do you use 'whole array' filter (as opposed to -per-element filter)? advantage being you could write as {(!#x)=x?x}# or maybe {(!#x)=?}#
 
ngn
@chrispsn i use per-element filter. otherwise it would be the same as x@&y
@chrispsn are you using linux? what error do you get?
 
@ngn the same, but possibly faster from brief experiments with early k7
@ngn yeah, ubuntu. probably just have old versions of build tools
makefile:8: recipe for target 'o/e.o' failed
make: *** [o/e.o] Error 127
 
ngn
@chrispsn clang-7 or gcc v6.3.0 should work
"make" should be gnu make, sometimes aliased as "gmake"
 
GNU Make 4.1 | gcc 7.4.0
it's ok, i'll try on a clean download later
may have messed up something in the directory accidentally
 
ngn
i'm using gcc 6.3.0 because 7 isn't available in debian yet
that causes trouble on freebsd, which has moved on to 7
 
9:18 PM
@ngn what are the fragile parts that need special compiler versions? asm, macros?
 
ngn
@ktye yes, it's usually those
 
 
1 hour later…
ksi
10:30 PM
@ngn i did port ngn/k on macos using function wrappers for syscall like what, once you pointed out, arthur did in b. i am not sure why the direct syscall doesn't work, though. i notice that you have one calling procedure for all syscalls, no matter their function signature. how does that work?
 
@StevanApter What are these frustrating limitations in k3?
 
ksi
10:49 PM
@ngn aha, the scapegoat is syscall close. once i define it using the function wrapper, everything works!
 

« first day (387 days earlier)      last day (1148 days later) »