ktye

Results 34 comments of ktye

> k7/k9 syntax that's a recent change in k9 but no version has been made public. arthur also mentioned to use f'x as each prior if f is monadic or...

i thought about it for a while and wrote down how i would rewrite it: steps.md maybe i implement it one day as an experiment but i cannot promise right...

the question is how important vm speed is for a language like k. some time ago i wrote a compiler that translates the byte code to native code: https://github.com/ktye/i/tree/e0d043cc7db0c97e9f842afcec5dd44f4bcde9c6/kom in...

i abandoned the stepping interpreter described in steps.md and found a simpler way for tail calls: https://github.com/ktye/i/commit/bfb9a6e50 we can keep the current exec function mostly, including keeping the stack top...

it should work now for both monadic and n-ary application of lambda functions. ``` odd:{$[~x;0;:even x-1]} even:{$[~x;1;:odd x-1]} odd 1001 /1 ``` also in the general sense not just tail-recursion...

it uses ReadIn to read a line. the c backend is generated here and uses this implementation: https://github.com/ktye/wg/blob/master/c.go#L816 it is called by the read() function, generated from this: https://github.com/ktye/i/blob/master/wasi.go#L116 and...

``` (2+;5*)[0;1] (2+;5*).0 1 ``` could both be 3 (index with 0 apply 1) currently traps.

you could calculate integer powers like that: ``` pN:{angle[(abs x)^y;y*angle x]} ``` `float^int` is power. `angle` has a monadic and a dyadic form (get, construct). but improves some numbers but...

because `angle[r;a]` regenerates a complex number with sin/cos on the rounded `a`. complex is stored internally as real,image. printing converts back to polar form.

you can get the real/imag part with _z, imag z or you can convert the underlying memory to floats (of twice the size), e.g. ``` `f 1a45 2a30 0.707106 0.707106...