r/ProgrammingLanguages • u/Athas Futhark • 2d ago
Hoisting explosive code out of loops
https://futhark-lang.org/blog/2026-11-18-hoisting-unsafe-code.html
19
Upvotes
r/ProgrammingLanguages • u/Athas Futhark • 2d ago
3
u/zizox99hd 2d ago
Nice post. One typo (I think?) In the very first example of the post. You mention that if m==0, we perform division by zero. But inv is a divided by n not by m.
1
u/foonathan 1d ago
Why don't you just hoist:
as
?
1
u/Embarrassed-Crow9283 1d ago
Why not something like...
maybe let maybe_inv = foo();
and then let the inside be like:
let inv = maybe_inv.unwrap();
You can then do whatever safely and simply and maybe optimize the unwrap process separately.