(no title)
johan_felisaz | 4 years ago
I was wondering if it's doable without the while. and other constructs (which honestly feel like plugged artificially in J, even syntax wise)
johan_felisaz | 4 years ago
I was wondering if it's doable without the while. and other constructs (which honestly feel like plugged artificially in J, even syntax wise)
mlochbaum|4 years ago
When designing BQN I embraced the limited nature of array primitives, so that most primitives can only implement efficiently parallelizable programs and none of them can perform infinite loops. Flip this around and you get guarantees: if you create a function by composing primitives you know it will halt, and if you avoid using modifiers in complicated ways it's easy to prove good sequential and parallel bounds on the runtime.[0] Although BQN has no tail recursion (J also doesn't; Dyalog does), it's possible to implement loop functionality that uses only logarithmic stack space in the number of iterations, with low overhead (I just measured 30ns/iteration in CBQN for a simple incrementing loop).[1]
[0] https://mlochbaum.github.io/BQN/doc/primitive.html
[1] https://mlochbaum.github.io/BQN/doc/control.html#low-stack-v...
RodgerTheGreat|4 years ago
It's basically an "escape hatch" when an algorithm cannot be cast into any more specific pattern, like iteration, a fixed-point, a reduction, etc. In practice it is needed very rarely.
There's a complete list of adverb forms for k6 here: https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual....
the_optimist|4 years ago
https://wiki.jsoftware.com/wiki/Vocabulary/hatco#DoWhile