r/ProgrammingLanguages • • Jul 01 '26

The Expensive Fictions of Low-Level Programming Languages

https://stng.substack.com/p/the-expensive-fictions-of-low-level
19 Upvotes

90 comments sorted by

View all comments

Show parent comment

1

u/matthieum Jul 01 '26

People will create incorrect specifications that appear to have properties they actually don't, or just fail to include some essential properties.

I remember an article about how for ages the specification of Ada SPARK sort was insufficient: it merely required that the output be sorted, which means a conforming implementation could just always return an empty array, or an array of N times one of the original elements, etc...

I do think, though, that specs themselves can be tested. In particular, for any deterministic function, a specification which allows for two or more outputs for a single input is clearly insufficient.

I wonder if other properties, such as progress or algorithmic complexity for example, could similarly be checked by verifying the specification itself.