How to bridge theory and implementation for while loops?
So I managed to solve this issue today. The code for my while loop:

while (condition: ~&gt;bool) (body: ~&gt;void) =&gt; void {
    if condition { 
        body; 
        while condition body; 
    };
}


When I go to build this into CIL (a stack based runtime, important for the psuedocode, not important for the answer) it looks like:

ldarg 0
&lt;build closure from { body; while condition body; }&gt;
call if


The important thing I was missing is that in the while code, the conditional was the thing in tail position. From the compiler's perspective, the block and the while function are two separate functions, with two separate "tails". Each of those are easily evaluated for tail position, making the optimization viable despite the lack of built-in conditionals.