7 ms·
Will Wall Street require Python?
- hakan 16y ago"... with Release 33-9117, the SEC is considering substitution of Python or another programming language for legal English as a basis for some of its regulations." If this was actually implemented, it'd be incredible. No more ambiguity when you have to define all the parameters and outcomes explicitly!
- die_sekte 16y agoKnowing governments' actions, this is going to be a proprietary mix made out of APL and PHP—the worst of both worlds.
- stan_rogers 16y agoDon't be bad-mouthing APHeLP -- we don't need to be getting into a language holy war here. (Actually something as straightforward as a de-crufted PHP with APL's matrix handling would be a pretty wonderful language, when you think about it.)
- stcredzero 16y agoAre you sure it's not apHELLp?
- blasdel 16y agoRule 34: http://www.impredicative.com/ur/ http://www.impredicative.com/ur/
- sp332 16y agoI'm sure someone will apply Gödel's incompleteness theorem to the Python syntax, and complain that they want to do something that isn't expressible in python (or any other language you choose).
- ippisl 16y agoIf this works well, this might cause more legal fields to work with computer languages, enable more legal automation , and could be really disruptive to the legal profession.
- ay 16y agoThe regulation will be very state-dependent, though. EDIT: oh, and that annoying halting problem...
- stcredzero 16y agoIs a monkey-patching friendly language really the best thing for this? (Asks the Smalltalk guy, whose language is just as monkey-patching friendly and is used in a lot of Financial apps.) Functional languages would be much better for this purpose.
- csytan 16y agoMonkey patching (from what I've seen) is almost always the result of a poor programming, something which no language can be shielded from.
- stcredzero 16y agoNo, but in the right language, you can at least be shielded from the monkey-patching.
- DrSprout 16y agoBut you need trained programmers to use the right language. Also, Python is clearly a step up from English on a variety of metrics, including the reduction of the ability to monkey-patch.
- stcredzero 16y agoFunctional languages can do even better, however.
- lallysingh 16y agoGood languages actively fight off poor programming. Take ML or Haskell: if you didn't think about the problem well enough beforehand, it won't compile.
- btilly 16y agoNo ambiguity? Suppose the deal goes out there, bonds are sold, but then real world inputs result in an endless loop. What happens to the money then?
- ay 16y agoOne can still collect the functions that loop into lambdas and start passing those around ?
- wtn 16y agoSame thing could happen with human language legal copy.
- btilly 16y agoAbsolutely agreed. In fact all sorts of conflicts and ambiguities can easily get missed, as well as ambiguous terms such as the bond issuer at its discretion can rearrange payments. (Yes, this has happened. And money was diverted from top tranches to lower rated ones.) Furthermore the entire reverse engineering process is a lot of work for a very imperfect result. So this is definitely a big improvement. But my point remains that it is not perfect. There still are ambiguities.
- omouse 16y agoIt'd be incredibly stupid. The language and some other programming languages don't even have proper standards written out or they change on the whims on their creators or community. Which version of Python will you use? 2.x or 3? Oh hey and will you use the map and filter functions or use generators instead or maybe you'll use a for-loop? What are the rules for that? Don't kid yourself, there's still a lot of room for ambiguity.
- ZachPruckowski 16y agoYou may be able to obfuscate the code, but so long as the investor can easily test your model with values of their choice, it doesn't matter if you use a map or a for-loop.
- markkoberlein 16y agoThis could open up a very lucrative market for Python experts.
- thorax 16y agoThe cynic in me thinks it will actually push the state of the art of obfuscating Python (which isn't widely experimented with as far as I know).
- arebop 16y agoI was under the impression that Wall Street typically develops and hosts in-house, regarding both algorithms and operations as competitive advantages. Is that incorrect, or is there some other reason to obfuscate?
- thorax 16y agoThe SEC proposal in question is talking about making these available (publicly if I read this correctly) when defining new securities: > We also are proposing to require that, with some exceptions, prospectuses for public offerings of asset-backed securities and ongoing Exchange Act reports contain specified asset-level information about each of the assets in the pool. The asset-level information would be provided according to proposed standards and in a tagged data format using eXtensible Markup Language (XML). In addition, we are proposing to require, along with the prospectus filing, the filing of a computer program of the contractual cash flow provisions expressed as downloadable source code in Python... http://www.sec.gov/rules/proposed/2010/33-9117.pdf http://www.sec.gov/rules/proposed/2010/33-9117.pdf
- omouse 16y agoDecorators, generators and all the other syntactic sugar that's been added over the years is already too much experimentation with obfuscation for my liking.
- mkramlich 16y agoHeck, just pushing up the demand for Python devs is a good thing. Rising tide lifts all boats. Probably indirectly raise the boats of non-Python devs as well.
- kurtosis 16y agoWell 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 http://www.lexifi.com/downloads/MLFiPaper.pdf See also: http://homepages.inf.ed.ac.uk/wadler/realworld/lexifi.html http://homepages.inf.ed.ac.uk/wadler/realworld/lexifi.html
- dons 16y ago"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?
- malkia 16y agoI would only consider a language with built-in big rational numbers.
- ableal 16y agohttp://docs.python.org/library/decimal.html http://docs.python.org/library/decimal.html
- JeremyBanks 16y agoThat's not rational, this is: http://docs.python.org/library/fractions.html http://docs.python.org/library/fractions.html
- ableal 16y agoYou're right (and thanks, hadn't seen that 'novelty' yet). My reply was more in the vein "what you probably need, not exactly what you asked" - these not strictly 'built-in' either. (That could be a bad idea, cf. second and last items of the Zen [python -c "import this"]).
- eru 16y agoWhy built-in? Good library support (and bearable syntax) should be sufficient.
- ig1 16y agoTo some extent financial transactions are done on the basis of code anyway. It's not unusual for transactions to specify a price based upon an agreed software-as-a-service calculation, for example an agreement might say "we will purchase 10,000 shares, on the 12th of May at the price defined by Bloomberg VWAP (volume weighted average price)". So rather than the parties having to draft a five page document defining exactly the criteria used to calculate VWAP (i.e. which trades to include and exclude) they just say "we'll use the criteria defined by this code".
- cma 16y agoprevious discussion: http://news.ycombinator.com/item?id=1272541 http://news.ycombinator.com/item?id=1272541
- ctkrohn 16y agoQuick explanation of what exactly this is: It's a rule change regarding asset-backed securities. ABS are a type of bond where the interest and principal payments come from the cashflows of some pool of underlying assets. The simplest example is the now-infamous mortgage-backed security: a bunch of mortgages are put into a pool, and each month the homeowner's payments are passed through to the mortgage-backed securities holder (with some amount taken off the top to cover the cost of collecting, processing, and insuring payments). There are many generalizations of this concept. There's no reason the underlying asset has to be mortgages. It could be auto loans, credit card receivables, student loans, whatever. And there's no reason that the cashflows have to be passed straight through to the bondholders. This is where Python comes in. There are a number of complicated rules you can define. For example, let's suppose I have $100mm of assets. Rather than just having $100mm in bonds on the other side, I can define two pieces, or tranches. Tranche A is $80mm and gets paid first; the $20mm Tranche B gets paid next. So if some assets don't perform and the $100mm face value only turns out to yield $90mm, the investors in A are completely unaffected. This method is helpful because it can create a safe asset out of a pool of generally unsafe assets. Another possible rule would be again to define two tranches, A and B. Each month, A and B receive the full interest payments on the $100mm assets. But A gets the first $50mm in principal, and B only starts getting paid principal when A is completely paid off. That way, tranche A has a shorter average life than the underlying pool of assets, and tranche B has a longer average life. This is helpful because some investors might want to buy short-term assets, but others might want to buy long-term assets. You can define a hugely complex range of rules, depending on the purpose of the investment and the type of underlying asset. From what I can tell (I obviously haven't read the whole document), the SEC is proposing to require ABS issuers to specify these rules in Python, and to specify the underlying asset pool in an XML format. This will make it easier for independent investors to analyze the securities on their own, without having to let the now-discredited rating agencies do their work for them. In general, sounds like a great rule to me.
- ChuckN 16y agoI just wish they would use json instead of xml for the asset pool data :-)
- 16y ago
- ctkrohn 16y agoIt's also worth noting that this is a minor part of a much larger proposal that came out more than a week ago. A bunch of media outlets ran stories... the NYT article is here: http://www.nytimes.com/2010/04/08/business/08sec.html http://www.nytimes.com/2010/04/08/business/08sec.html
- ShardPhoenix 16y agoI would think a DSL would be more appropriate than straight Python for the proposed purpose.
- rit 16y agoBut then you need a standard DSL interpreter platform. For any platform that investors use. I suspect this is a solid reason to take and use an existing language. Saying "You need a standard install of Python 2.6 to execute this", versus "You need a SECLang 2.6 compatible interpreter with support for Spec version 9.1". Remember - it's not just about providing a common platform for developers to build their code. The purpose is to have investors able to run the program, punch in their assumptions and get numbers out.
- ShardPhoenix 16y agoI'd think a DSL would be better for this purpose (defining rules for a specific type of financial assest) than Python in general.
- branden 16y agoYou're probably right, but compared to the DSL that hasn't been specified and that no one has agreed on, Python wins. The more I think about it, there should be a DSL for all laws. (Something better than the legalese dialect of English, at least.)
- mkramlich 16y agoarguably "legal English" is already a DSL. A DSL whose programmers are lawyers and whose interpreters are courts.
- stcredzero 16y agoWe may have problems with the quality of those interpreters. Are they developed with an Open process?
- mseebach 16y agoThe problem with the law isn't the language of the laws themselves, it's the input. I mean, please show me the typedefs for attempted rape and reckless driving. Most of the time, the interesting cases are about figuring out who's lying, if there was intent, determining what's reasonably expected, how a certain condition might count as an aggravating circumstance etc. etc.
- ippisl 16y agoAren't a lot of the work, effort and expertise in legal fields(including learning) , is about legalese and knowing a lot of laws and cases ? If at least some of the hard work around being a lawyer and being a judge could be codified in a computer and automated , lawyers and judges could be better in the other , harder parts of the legal profession ?
- pmb 16y agoThis is definitely a strongly-typed-language situation.
- rbanffy 16y agoWhat if the rules are self-mutating bytecode?
- rbanffy 16y agoBetter yet: what if the contracts become self-aware?
- kuahyeow 16y agoWhy not a framework which uses plain English like Cucumber? http://cukes.info http://cukes.info
- mkramlich 16y agoI don't know if I fully understand or agree with their proposal but I like the fact that they are trying to innovate.
- mkramlich 16y agoarticle title is wrong, this isn't Ruby. should be: "Will Wall Street import Python?"