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
4
u/ct075 Jan 04 '26
I suspect that, for any failing polymorphic value declaration
def x: P('a) = e(whereP('a)is some type expression featuring'a), the declaration ofxwill always fail for any instantiation of'a; in ML this would follow from parametricity but I don't know if Futhark is the same in this regard.With that in mind, an easy patch would be to have the interpreter instantiate the value
xonce at startup with value'a = unit(or even'a = void) and throw the error raised.EDIT: I did have the thought that this would force any effects occurring in the instantiation of
xto occur early, but if Futhark is pure then such a transformation should still be safe.