Well I love python, but this reminds me of a set of an old paper by Peyton-Jones of GHC fame, which developed a Haskell combinator lib that did something like this. I'm sure the state of the art has left this system long behind, but it's a pretty interesting concept.
"Composing Contracts" launched much of the use of FP in the finance industry. It was specifically cited in Credit Suisse's use for modelling contracts, for example.
That said, any required language should be fully formally specified -- what's the semantics of a Python contract? Implementation defined? A testsuite?
Comments
Well I love python, but this reminds me of a set of an old paper by Peyton-Jones of GHC fame, which developed a Haskell combinator lib that did something like this. I'm sure the state of the art has left this system long behind, but it's a pretty interesting concept.
Composing contracts: an adventure in financial engineering, Simon Peyton Jones, Jean-Marc Eber, Julian Seward. ICFP, 2000 http://www.lexifi.com/downloads/MLFiPaper.pdf
See also: http://homepages.inf.ed.ac.uk/wadler/realworld/lexifi.html
"Composing Contracts" launched much of the use of FP in the finance industry. It was specifically cited in Credit Suisse's use for modelling contracts, for example.
That said, any required language should be fully formally specified -- what's the semantics of a Python contract? Implementation defined? A testsuite?