r/ProgrammingLanguages • u/Athas Futhark • Jan 04 '26
Another termination issue
https://futhark-lang.org/blog/2026-01-04-another-termination-issue.html
18
Upvotes
r/ProgrammingLanguages • u/Athas Futhark • Jan 04 '26
View all comments
Show parent comment
1
u/matthieum Jan 05 '26
Similar train of thought: the top-level definitions are evaluated at compile-time, but in case of error, compilation continues, and the error is "injected" wherever the expression is used. (that is, if the error is the value
e, athrow eis substituted for any appearance of the top-level value in the code)If the expression is evaluated successfully, then code generation is exactly the same as it is today. No overhead. Users won't even notice.
If the expression is not evaluated successfully, then the program may still compile, but should the value be attempted to be used at runtime, then it will error out instead.
Think of it as Haskell's
-fdefer-type-error, but for constants instead.