« first day (812 days earlier)      last day (723 days later) » 

05:03
@ngn Notified tech@ about the "!length" error with k /tmp/in.
 
12 hours later…
17:29
hmm, what's the difference between something statically parseable versus having rules to resolve ambiguities?
ngn
ngn
@coltim static parsability is usually contrasted not with "rules to resolve ambiguities" but with the need to look up runtime information to determine the structure of the code
@coltim why are you asking? something to do with apl/j?
@ngn I guess something like {z x\y}, where when it's called like f[+;1 2 3;4] versus f["_";"a_b_c";#:]
ngn
ngn
17:44
@coltim i don't understand what you mean
well in one z is the seed for the scan and in the other it could/would be normal function application on a list of strings
ngn
ngn
@coltim no, in the second case z is still the left arg for x\
but if x is "_" there is no left arg? I guess that's the "rules to resolve ambiguities part", like `x` is treated as a scan even if x is not a function (because you can't tell without knowing what x is)
ngn
ngn
z x\y parses as x\[z;y] regardless of what x y z are
(or, more precisely: regardless of what values the variables x, y, and z have at runtime)
@ngn but if x is a char/string or an integer literal then it's parsed as z@x\y
ngn
ngn
17:53
@coltim is it really?
@coltim right, that's what static parsing (as it statically determines the syntactical type of each expression) means
ngn
ngn
ngn/k, (c) 2019-2021 ngn, GNU AGPLv3. type \ for more info
 f:{z x\y}
 f["_";"a_b_c";#:]
'rnk
{z x\y}
   ^
@ngn hmm, I guess only if y is parsed as a verb (which variables aren't)
ngn
ngn
^^rank error because split (x\) can take only one arg
same thing when f is {z "_"\y}
@dzaima I guess the part I don't understand is what if you just define a b c to be b[a;c]
17:57
@coltim then what is f g x?
ngn
ngn
@dzaima i was about to ask the same :)
@dzaima if they're all variables then g[f;x]?
@coltim but, see, you have to know whether they're functions or not. Which you don't until runtime
ngn
ngn
@coltim "variables" in the sense of name-value mappings? or "not functions"?
static parsing just says "eh, all variables are nouns" and solves the whole problem, at the cost of making you unable to easily define custom infix functions
18:00
couldn't it just throw a run time error? 0_o (I can't tell if I'm just being dense here. I guess that would break chains of UDFs being called but maybe "forcing" it to parse as a[b[c]] would be better?)
@ngn name-value mappings
@coltim what should throw a runtime error?
and k already parses var1 var2 var3 as var1[var2[var3]]] always
@dzaima in the f g x example are f and g functions and x some data?
@coltim You don't know. That's the whole problem.
hmm, I guess f and x are less relevant. if g is a function then you could try calling g[f;x] and throw an error if that doesn't make sense. if g is data then call g[f;x] and error if that doesn't make sense?
but then you'll never evaluate it as f[g[x]], which is what you want most of the time.
also then -!3 would be interpreted as ![-;3]
18:21
hmm. it may just be semantics then. resolving ambiguities by parsing x y z as x[y[z]] (or noun-noun-noun I guess), or z x\y as x\[z;y] "allows" the language to be statically parseable
I've always just gotten tripped up by using \ as a function, and haven't quite puzzled out all the nuances there. at least I think I'm pretty close to understanding . =P
the ambiguity resolution isn't done while parsing x y z, but when parsing x (or y, or z) - x/y/z alone parse to a noun
if you replace a variable name with "abc" (or (!3), or 2, or anything else that's a noun), the program will always stay parsed exactly the same way
18:42
yeh, I'm probably just missing something. I understand that there is a grammar that defines the high-level stuff but I'm more interested in the gnarly bits like 0.1/.1/.a/a.b/a.1/,.x/(,).x/2000.01.01 and how those are handled
or rather, where the limits are with that sort of stuff, lol
that's tokenization then
hmm, yeh, that's probably what I get tripped on. like the result feels similar (i.e. the role something takes on varies depending on what it's surrounded by) even if the process is different

« first day (812 days earlier)      last day (723 days later) »