7:14 AM
@ngn i mean the depth. for an arbitrary expression, you can calculate the needed depth in advance (maybe with some restrictions to the allowed operations, which should hold for k). then you always know the stack size you will need. no limits and no need to adjust.

13 hours later…
7:56 PM
@ktye obviously not when recursion is involved. otherwise, what would be the benefit?

1 hour later…
9:03 PM
@ngn that may depend, how the vm works. e.g. when you call a lambda, does that make a new stack+execution environment, or does everything run within one function..

@ktye there is only one k stack (separate from the c stack) and the locals are on it (their number known in advance)

one stack for everything (not per call)?

@ktye of course. do you allocate a new "stack" on every function call?

i don't know. i have too many implementations in parallel.
yes, currently i do that.

9:22 PM
@ktye are the stacks allocated on the stack? :)
if yes, they can be seen as stack frames

@ngn they are normal k objects and recycled when done.
the only special thing is that i use ints instead of list type for the stack, so that freeing does need to recurse.

9:43 PM
@coltim thanks. fixed

10:01 PM
@ngn digging into it, it looks like this is handled inconsistently among the k's =| would it make "more" sense to return `11` for `10+\1` rather than `,11`?

@coltim an atom would make more sense for 10+/1 but i'm not sure about 10+\1
hm.. +\1 is an atom currently

10:17 PM
@ngn yeh the theory of it eludes me a bit (especially given `f/x` just returning `x` if it's a scalar)

generally / reduces rank, and \ preserves rank

the part where it's seeded just further obfuscates what should happen :S

+/atom must be a special case as the rank is already 0

maybe it should boil down to whatever approach has the simplest implementation =P

`return 0` and everything is an error :)
@coltim following the logic of "\ preserves rank", you're right
and i think x+\y should behave like +\x (in terms of rank)

10:23 PM
it would be fun if it somehow saved a byte when you wanted to both enlist an atom AND apply some dyadic operation to it, but sadly I think `,x+10` is the same length as `10+\x` lol

@coltim 10+\1 is 11 now. and i must sleep.