I think programs that are proofs (as in COQ) is a cool idea. It seems economical, in that you get two things (a program and a proof) for the price of one.
However, my experience is that adding extra constraints to a problem makes it harder and more complex to solve, whereas separating out different aspects (divide&conquer) makes it easier. Jack of all trades/serving two masters etc. That is, you'll write better code if that's all you're doing; and you'll write a better proof if that's your sole purpose. "To hit a bird on the wing your whole mind must be on that bird..." etc.
Ironically, the power I personally find in a mathematical approach is that you can freely separate out constraints in any way you like, regardless of usability or performance, in order to show some quality clearly. Combining the proof with code pushes in the opposite direction - and for me, when it's at the max complexity, this pushes it over the threshold.
I still think it's cool though, perhaps mostly because it provides an automatic test of theorems.
However, my experience is that adding extra constraints to a problem makes it harder and more complex to solve, whereas separating out different aspects (divide&conquer) makes it easier. Jack of all trades/serving two masters etc. That is, you'll write better code if that's all you're doing; and you'll write a better proof if that's your sole purpose. "To hit a bird on the wing your whole mind must be on that bird..." etc.
Ironically, the power I personally find in a mathematical approach is that you can freely separate out constraints in any way you like, regardless of usability or performance, in order to show some quality clearly. Combining the proof with code pushes in the opposite direction - and for me, when it's at the max complexity, this pushes it over the threshold.
I still think it's cool though, perhaps mostly because it provides an automatic test of theorems.