Commonly, the keywords
continue are used to influence the
control flow of a program.
Designing my own language rebo, I’m at a point
where I want to implement a form of control-flow-changing operations.
This post is primarily a braindump of ideas I had thinking about the implementation.
Let’s embark on journey through those ideas in the form of thought experiments.
With the minimal subset of
const fn becoming stable soon (in the second next Rust version), I wanted to give const fns a try and test what is possible with them.
We implemented a compile-time SUBLEQ interpreter which only uses const-fns, which you can find on the playground.
I had some fun with associated constants and implemented compile time Scalar, Matrix-Vector and Matrix-Matrix Multiplication. Then I decided to go ahead and implement a compile-time Gauß algorithm on 3×4 matrixes, which prints the intermediate right-upper matrix and the final solution of the linear equation.