Re:Why Functional Programming Matters (1984) [pdf]
by nickpsecurity on Thursday December 08, 2016 @02:09PM
(#13133114)
Thanks for the insightful reply. I agree that code does look very imperative. Likely due to goal of C synthesis as you said.
It's not that they wrote the logic in a fundamentally different paradigm from C, it's that they take care to give their system the information it needs to both generate C code and most of the desired proofs simultaneously. The functional language is fufilling the role of metalanguage excellently, but little of that ends up in the generated code. The one functional thing that does is pattern matching, since the C equivalent (if statements and unions) are much harder to verify (and use).
[1]: https://github.com/NICTA/cogent/blob/master/impl/ext2/cogent...