Hacker News new | ask | show | jobs
by shoeffner 2053 days ago
If I got it correctly, they do not have do-while, it was only shown as an example operation. Instead, they only use "for each", i.e., bounded loops directly on the data structures list/array.
1 comments

That's mostly correct. :) We used `do-while` to demonstrate that we could replicate the behaviors of a normal assembly language within the dependency graph representation.

However, we do have a restricted version of `do-while` implemented as described in the Sequential Algorithms RFC[1]. We want to push people into writing parallelizable code by having the default constructs and data types encouraging that, but we know certain algorithms are only possible in a sequential form, and some of them (like the Newton-Raphson method) are not predictable in the number of sequences to run so we have an escape hatch in the language that lets you do the classic iterative programming, but all of them wrapped in a maximum iteration counter so we'll still be able to assign a maximum expected runtime to them (and be sure they halt, perhaps with an error).

[1]: https://github.com/alantech/alan/blob/main/rfcs/007%20-%20Se...