r/ProgrammingLanguages • Futhark • Mar 25 '26

How should property-based tests be defined in Futhark?

https://futhark-lang.org/blog/2026-03-25-property-based-testing.html
18 Upvotes

9 comments sorted by

View all comments

Show parent comment

2

u/fridofrido Mar 25 '26

I don't think there is any reason to have a file with mixed test and non-test entry points anyway

I guess at least in some situations it could be easier for the user to read / maintain the tests if the things tested and the tests are next to each other.

While adding an attribute to a module is possible, modules are not part of the external interface of a compiled Futhark program (and it is not at all clear what form it would take if it were).

i don't think i understand the problem - to me this seems to be a completely surface-level thing. The compiler could insert the individual "attributes" (or whatever signaling mechanism) at a very early stage?

2

u/Athas Futhark Mar 25 '26

The property testing tool is not part of the compiler itself, and the compiler must not be modified in order to support it, except to add generally useful (and simple) facilities. This approach to dogfooding is important to ensure that the language presents a sufficiently flexible interface to cater to most needs.

1

u/fridofrido Mar 29 '26

well, i would say annotating modules is a generally useful feature, but whatever