Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The next step for this would be to statically verify the annotations are being obeyed.


That sounds (close to) impossible. How would you tell if a given piece of code sorts a list properly? There are a million and one sorting algorithms and the static analyzer would have to be really smart to be able to check that reliably.


Yes, it is impossible. See: Halting problem.


The thing about program verification is that everyone knows that of course it is in general impossible. However, I am not writing a simulator. Most of the code I write does not actually take advantage of the power of a Turing machine.

The fact that the general problem is impossible does not mean that the entire area of study is useless.



I'm pretty sure that Pex [1] does the static analysis on these things. It's C#, but should be close enough for you to get the idea.

[1]: You can play with it here: http://www.pexforfun.com/




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: