Post #1864451
2026-04-21 20:20 UTC
I added also that having all the exits go through the end of the subroutine meant that, if you turn off the optimizer, then the debugger is much easier to use.
This is no small matter. Early exits mean the subroutine may exit at any of several points.
And the smart alec pointed out that I would have had to turn the Rust code’s immutable value into a mutable variable, to which my reaction was, ‘So?’ And, anyway, a really, really safe language would have LINEAR vars that made this no problem.
Replies (1)
-
@chemoelectric@masto.ai 2026-04-21 20:23
But the smart alec completely missed what I ACTUALLY would have done. That is, I would have broken the subroutine in natural, smaller pieces. I did this with the Pratt parser in my compiler, yesterday. I said to myself, ‘This is getting to be a mess of checks for errors. And there is no exception mechanism in C, it has no proper tail call, and I WILL NOT use goto.’ So I looked carefully and broke the Pratt parser into a natural set of subfunctions. It takes practice, but it is worth it.