« first day (623 days earlier)      last day (912 days later) » 

1:23 PM
@ngn you support _return_, e.g. {$[1~x;:x;2+x]+3}
does this leak memory? 3 may be on the stack but never evaluated. or do you clean up? Is _return_ the only primitive that may leave the stack unbalanced?
 
 
1 hour later…
ngn
2:33 PM
@ktye i hope it doesnt leak. there's clean-up at the end of a function call (probably suboptimal, but simple)
 
 
2 hours later…
5:03 PM
working on a new version. w is retired. instead of having two languages and two parsers, i reuse k. verbs are redefined to work on typed scalars. signed operators are derived by "each", float by "scan".
k will parse to byte code and convert this to the target (wasm, c, go, asm..)
github.com/ktye/i
 
ngn
@ktye i admire the amount of energy you put into this
 
i also get the error indicator back, sometimes it was a bit troublesome without.
@ngn would you miss not having a parse tree?
 
ngn
@ktye the parse tree - i think yes. sometimes they mention the ability to manipulate the parse tree as one of the top advantages over apl/j.
you could try to rebuild it from the bytecode if it's significantly faster without a tree (but i think that's hard)
 
i thouht about compile time macros: f:[x;y;z] which will call into a k function f (user defined) while parsing. f receives as arguments the byte code of subexpressions. that way control flow could be user defined, such as if:[x;y
cond[x;y;z] return:[x] ...
@ngn i don't think it's that hard. i evaluate byte code with a stack machine. instead of applying functions you can push subexpressions back on the stack. at the end your stack should be the parse tree.
the same should work for partial application/constant folding. if there are symbols involved, push the expression otherwise evaluate.
 
ngn
5:53 PM
@ktye doesn't that mean you'd have to instantiate the parse tree anyway? or is it "pseudo-eval" as you go through the source?
 
@ngn what do you refer to, building a tree from byte code?
 
ngn
@ktye ah. that answers it.. sorry for the dumb question.
 
say you have code for (1;2;+), you put 1 on the stack, then 2, and for + you do not apply it but push (+;1;2) back.
maybe there are better array-oriented methods..
 

« first day (623 days earlier)      last day (912 days later) »