Posted
by
Soulskill
on Monday April 19, 2010 @06:25PM
from the instead-of-eating-its-own-tail dept.

An anonymous reader writes "A US federal agency is considering the use of computing languages to specify legal requirements. 'We are proposing that the computer program be filed on EDGAR in the form of downloadable source code in Python. ... Under the proposed requirement, the filed source code, when downloaded and run by an investor, must provide the user with the ability to programmatically input the user's own assumptions regarding the future performance and cash flows from the pool assets, including but not limited to assumptions about future interest rates, default rates, prepayment speeds, loss-given-default rates, and any other necessary assumptions.' Does this move make sense? If the proposed rule is enacted, it certainly will bring attention to Python or other permitted languages. Will that be a good thing?"
The above quotes were pulled from pages 205 and 210 of the dense, 667-page proposal document (PDF). Market expert and professor of finance Jayanth R. Varma says it's a good idea.

You say that jokingly, however, your point is rather poignant. If Wall Street types were presented with a way to transmit their methods and assumptions in a non-human readable way like a programming language, it becomes less transparent, not more. Sure investors can say "if a, b and c, then something happens in this black box and outputs x, y and z". They have no idea how their assumptions lead to the given result.

My view is that there just is no substitute for a system of social morality like those in eastern cultures of old. Modern society has the attitude that "if it's not illegal, do it". Unfortunately, the law will never be able to codify in black letters the rich spectrum of behavioral regulations imposed by morality, developed over thousands of years of human behavior. Thus, individuals conforming only to the law and ignoring ethics and morals will inevitably breach their moral duty, and the damage they do is limited only by their "creativity" in using the law and the social power they weild due to their position, wealth or influence.

In short, we need to disabuse ourselves of this trend to consider ethics and morals some hokey, freedom-fettering construct that has become obsolete. It is very much necessary, and Wall Street is a great place to look if you want an example of why.

Really. There's no shortage of investments that are *easy* to understand, and the lack of free lunches means that investments you -don't- understand, tend to come with drawbacks that are invisible to you, because you don't understand them.

What's wrong with: "Buy 100 shares of a company with a total of 1M shares, if the company pays a dividend, you get 100/1M of it, if the company goes broke, your investment is lost. There's a $5 fee for the purchase, but other than that no fees or associated costs whatsoever"

I sort of agree. I'm a proponent of source control, versioning, etc. of legal documents. I think hypertext could take a lot of the drudgery out of codes that are generally annotated rather than rewritten. I think that would help us apply the moral code more completely and transparently. The more expert you have to be to read a code, the less transparent. There could be standards that use UML however, which is better suited to modeling social-logical flows versus a programming language which is good at

You say that jokingly, however, your point is rather poignant. If Wall Street types were presented with a way to transmit their methods and assumptions in a non-human readable way like a programming language, it becomes less transparent, not more.

You are assuming that legalese is human-parsable, that it is a consistent language and that humans can easily spot and demonstrate errors in it. With a programming language, you can give a test case that fails and point out this precisely. You can more easily argue that a rate or a progression is not defined, or defined in a way impossible to parse. You can't sweet talk an interpreter.

Sure, it doesn't remove all dishonesty magically but it does remove the ability for some elaborate lies. It will make just

> My view is that there just is no substitute for a system of social morality like those in eastern cultures of old. Modern society has> the attitude that "if it's not illegal, do it".

"The very emphasis of the commandment: Thou shalt not kill, makes it certain that we are descended from an endlessly long chain of generations of murderers, whose love of murder was in their blood as it is perhaps also in ours. " -- Sigmund Freud

He may not have gotten a lot of things right, but, I think he hit the nail o

Now, in addition to lawyers and accountants, you need computer programmers to invest. This smells like a racket. On the other hand, it can't get any worse than the legalese, and maybe that is the point.

The average consumer cannot understand cell phone contracts, gym membership contracts, car lease contracts, bank account terms and conditions and a whole bag of other things. So you're saying they should abstain? Hell, I cant get a parking voucher from an underground car park these days without the back of it being covered in fine print you'd need a scanning electron microscope to read.

No sir, the answer isn't to "vote with your dollar". It's to acknowledge that the entire social system is broken and massiv

Well, this is not entirely without precedent. Even the field of Physics employes this method of specifying things that are complex enough that warrant a "model" which is highly dependent on what the model chose to include or exclude. For example, in tracking satellites, you would think that you should be able to use Physics and the myriad of formulas alone to come up with the position of satellites. But because real world physics (think drag, friction, N-body G forces etc) is too hard to figure out and are

Now, think about it, how better to describe an algorithm than an actual working program?

Pseudo-code is far better for describing an algorithm than actual running code. If one uses "production" code to express an algorithm, then one has to also accept the limitations imposed by the language and programming environment.

For example, if the demonstration code takes into account the possibility of integer overflows, that check becomes part of the "official" algorithm. While this may be okay as long as the algorithm remains implemented in a single language/environment, it becomes a problem when on

2) Badly written laws can just as easily be written in Python as they can be in some human language. Judges etc are normally far more familiar with the official language of the courts.

Yes, but there's a very practical difference here. It's all too common for lawyers to respond to questions about a new law's actual meaning with "We don't know yet; we'll have to ask the court system". This can be and is done; it's not unusual for new laws to trigger a number of court tests to determine the actual legal mean

Now, in addition to lawyers and accountants, you need computer programmers to invest. This smells like a racket. On the other hand, it can't get any worse than the legalese, and maybe that is the point.

When banks sell a product, structure, portfolio, etc, to each other, they are already converting the legalese into code or at least data for pre-existing code: it's the only way you can come up with an estimate of the value of the asset in question.

Of course I suppose that to most lawyers, any programming language will look like cuneiform anyway.

This could be viewed as payback for what the legal system did to software by allowing software patents. Such patents are written in legalese, and don't require a "working model", i.e., a runnable implementation in some programming language. So it's impossible for software developers to read the patents and understand whether their own code is a patent violation. We can only determine whether we're violating

This would be a fantastic idea. Not only would the rules be transparent and non-ambiguous, but the potential for experimentation and self-analysis would be incredible. Python is definitely one of the better languages to use for this, as it tends to be very readable and self-explanatory as far as programming languages go.

Sure, but it's better to have that hack disclosed in such a way that machine analysis can find it than disclosed in such a way that it only becomes evident after a corporate lawyer brings up an obscure precedent to a judge.

Ultimately, all laws and regulations could be setup to be a computer program.What is a programming language, but a way to exactly specify algorithms and data structures? In this case, we only need the algorithm part.

Now, you'll never be able to get rid of human judgment. All the input parameters will be up in the air. But what does get you to do is focus on the assumptions you make on the numbers you put in.The best example I can think of now is filing my taxes. I use a computer program and all my energ

Here is another fantastic idea. How about a law requiring the IRS to provide free software that is easy enough to use for the average person so we don't have to spend $250-300 billion (or 20% of the total taxes collected) annually on tax preparers? After all, the complex investments that are being talked about here are typically bought by people who should understand what they are buying, i.e. financial professionals, and who have a choice not to buy them if they don't. Not so with taxes.

A fantastic idea ! Furthermore, have it online. Furthermore, put the data that the govt gets anyway into the forms so that they're partly pre-filled. Indeed, do what we've done in Norway for a decade.

By now it's progressed to the point where I can -literally- file my taxes from my mobile phone in 15 minutes. And it takes that long only because my investments are semi-complex (i.e. some of them are foreign so don't come pre-filled)

Oh, and yeah, it does mean you know how much taxes you owe instantly, after you fill in the forms, you press "calculate taxes", and up pops the answer, none of that file paperwork, wait months for the response.

Please do not teach any lawyers anything about Python. What is left in readability would be destroyed.And they would go on to other languages like Perl, Now that's a lawyers language:D
We will have to make a new language for them call black and white. Where any gray terminology is a syntax error.

Is a functional programming language any more inherently reliable since you are trusting the compiler anyways? Does it effectively matter if the code can be "provably without side-effects" if you are trusting the implementation via a black box on a different level? Honest question from a noob.

Is a functional programming language any more inherently reliable since you are trusting the compiler anyways? Does it effectively matter if the code can be "provably without side-effects" if you are trusting the implementation via a black box on a different level? Honest question from a noob.

Any legal framework, if it does include a specific language, should be based on what the common languages that are currently used, i.e. they should have company XYZ submit that they are using language "ABC" and here is the source code. The problem with mandating a particular language(s) is that these are subject to change with time. A legal framework should stand the test of time, and thus not include requirements for "Python". Python might not exist in five years, or may become obsolete in five years.

Granted, various versions of Python 2 are still very much alive and kicking. As time progresses, Python 3 gradually will take over. (The only thing that could avoid this would be a code fork, and I see no sign of that.)

I realize their desire for better consistency in the language. Still, parenthesis give specificity at the cost of readability and writing speed. I think there ought to be fewer parenthesis required in programming, not more. (And no calls for Perl, please. Other parts of the language drive me nuts.)

IPython is an interactive interpreter that will allow you to skip the brackets in many cases, but you'll still need them in an script. Certain editors and IDEs have a mode that auto-complete/inserts the brackets.

The benefit of having print as a function, is that one can override it:

Python might not exist in five years, or may become obsolete in five years.

Since the code is freely available, Python will continue to exist one way or the other. That's one of the upsides of open source. Also, Python is closer to bleeding edge than obsolete right now.

The reason I think they specify a language is that otherwise you'll see code switched to whitespace [dur.ac.uk] or brainfuck [sange.fi] before being submitted to ensure maximum confusion. Remember than most organizations who are required to disclose something do so with the intent of obfuscating that legally required information as much as

That's a good point to make, though I think your estimate of 5 years does little justice to Python. Regardless, the problem with NOT specifying a language is that it means I can make my own proprietary language and release that source code (and not the compiler, say).

Also, Python is open source through and through : community developed, open specs, several open source implementations. This means that even if one day 25 years from now Python is a dead language as far as practical usage goes, it will be no harder to understand and execute as it is today.

The problem with mandating a particular language(s) is that these are subject to change with time. A legal framework should stand the test of time, and thus not include requirements for "Python". Python might not exist in five years, or may become obsolete in five years.

You could say the same for English, since it changes constantly. Then again, English never had well-defined syntax or semantics in the first place...

One reference language is a far better choice than a whole slew of them. To much unnecessary flexibility just adds complexity. Even if mainstream Python went in a different direction, the legally mandated dialect would survive for that purpose.

downloaded and run by an investor, must provide the user with the ability to programmatically input the user's own assumptions regarding the future performance and cash flows from the pool assets, including but not limited to assumptions about future interest rates, default rates, prepayment speeds, loss-given-default rates, and any other necessary assumptions.'

...it is forbidden to have a straightforward sentence with less than two conjunctions.

Something that needs to be considered is the existence of so called "Filing Agents". I work for such a business.

Right now, the SEC requires companies to file documents in a specific subset of HTML, as well as (in some cases) XBRL, which is an XML-based reporting language. In some rare cases, documents are another type of XML, or even specially formatted ASCII documents (ugh).

Securities lawyers and company administrators don't want to understand the highly technical processes involved, so they outsource their technical reporting requirements to filing agents. We take care of all the nitpicky details that they don't want to consider. Looks like we'll have to learn Python as well. We've been meaning to graduate from Perl anyway, so no big deal.:-)

It is thus inevitable that someone will create a condition which can be best capitalized on by someone else by playing along. It is equally likely that somebody else will think that they can best capitalize on a situation by playing along, and will become a patsy. (Extrapolate this, and you have a speculation bubble.) Like plays in a chess game, those who understand what's really going on and can predict X steps ahe

Like plays in a chess game, those who understand what's really going on and can predict X steps ahead will put themselves in corresponding favorable positions.

Chess is a game where there are only two players, there is no element of chance, and both players have all available information about game state at any given time. Which makes it laughably simple compared to finance.

The whole credit default swap thing IMO looks most like an n-player iterated prisoners dilemma, except that the (n-dimensional) payoff

ECMAScript or JavaScript would be a much better language to make this requirement for. Python would be a mistake. JavaScript is a much more limited language in terms of dialect and concepts and is much more neutral than Python is; yet JavaScript can express nearly any level of complexity. It is also readable by majority of the programming world. It is also an excellent data transport language. Python is not readable by the majority of the programming world. It is also terrible as data transport langu

I can see it already, the financial institutions will all cry "but these magical formulas are what makes us money and if we make them available our competitors will be able to use them too"! And of course they would also scramble to hire some of the winners of the Underhanded C Contest: http://underhanded.xcott.com/ [xcott.com]

Frankly using a mathematically provable means of describing all manner of (if not all) legal requirements would be an excellent idea. The notion of gray-areas wherein judge and jury have traditionally run wild would be non-existent. One could apply legal requirements to any case with absolute confidence of the outcome regardless of venue. Court proceedings would consist of nothing but what they were intended to consist of, the determination of givens.

Judges running wild is one thing. On the other hand, jury nullification is an important safety valve that we cannot afford to eliminate. It is marginalized, misunderstood, underused, and abused, but we'd be ultimately worse off without it.

"My name is Alan Glashwiecz, of Smoot, Sedgwick Associates. Am I correct in thinking that you are the Manfred Macx who is a director of a company called, uh, agalmic dot holdings dot root dot one-eight-four dot ninety-seven dot A-for-able dot B-for-baker dot five, incorporated?"

"Uh." Manfred blinks and rubs his eyes. "Hold on a moment." When the retinal patterns fade, he pulls on his glasses and powers them up. "Just a second now." Browsers and menus ricochet through his sleep-laden eyes. "Can you repeat the company name?"

"Sure." Glashwiecz repeats himself patiently. He sounds as tired as Manfred feels.

"Um." Manfred finds it, floating three tiers down an elaborate object hierarchy. It's flashing for attention. There's a priority interrupt, an incoming lawsuit that hasn't propagated up the inheritance tree yet. He prods at the object with a property browser. "I'm afraid I'm not a director of that company, Mr. Glashwiecz. I appear to be retained by it as a technical contractor with non-executive power, reporting to the president, but frankly, this is the first time I've ever heard of the company. However, I can tell you who's in charge if you want."

"Yes?" The attorney sounds almost interested. Manfred figures it out; the guy's in New Jersey, it must be about three in the morning over there.

Malice – revenge for waking him up – sharpens Manfred's voice. "The president of agalmic.holdings.root.184.97.AB5 is agalmic.holdings.root.184.97.201. The secretary is agalmic.holdings.root.184.D5, and the chair is agalmic.holdings.root.184.E8.FF. All the shares are owned by those companies in equal measure, and I can tell you that their regulations are written in Python. Have a nice day, now!" He thumps the bedside phone control and sits up, yawning, then pushes the do-not-disturb button before it can interrupt again. After a moment he stands up and stretches, then heads to the bathroom to brush his teeth, comb his hair, and figure out where the lawsuit originated and how a human being managed to get far enough through his web of robot companies to bug him.

Awesome! I'm so glad somebody recognized this from "Accelerando" by Charles Stross. I think I've read that book 3 times by now and it always makes me smile. It actually gave me a little chill when I read the title of this story. Amazing that Stross wrote about this years ago. I wonder if the idea has been floating around longer than I thought.

So rather than actually explain what the item is, they'll just build a model of what it is, and let you put in your own assumptions.

So we'll create a bunch of programming overhead, and end up with huge improvements.Namely that iInstead of descriptions nobody reads or understands, we'll have programs nobody runs or understands.

I've got an idea, I know it might sound crazy but here it goes.If you see someone selling a great deal, but you don't quite get what they're selling, how it works, or even why it's such a great deal, DON'T BUY IT.

We could even impose this on industry, maybe make it a legal/ethical requirement that people moving around large sums of money act with due diligence or something.

If people actually stuck to this, and only bought things that they understood and made sense to them, the companies making these confusing products that nobody understands would have to make simpler more straightforward products.

These guys need to step back, and make products that THEY understand. If the designer of the product can't figure it out, it's too confusing. If none of the potential customers can understand it, it's too confusing.

Really if they currently can't implement the description, how does documenting it in python make it any better?

Most people probably can't explain the "WHY" of a stocks movement from day to day. Are you expecting people to not buy stocks? If everyone was on the same page about financial products, we'd be pretty close to 'perfect markets' and no one would make much money. It's because so few have any idea why something is worth what it is in a market that people bother to get in to it: to make money off someone else's misunderstandings.

I've got an idea, I know it might sound crazy but here it goes.
If you see someone selling a great deal, but you don't quite get what they're selling, how it works, or even why it's such a great deal, DON'T BUY IT.

It's a great idea. But the problem with it is that even if you know this stuff, it can still be a big mess because of the risks you assume. If I borrow huge sums of money to make my bets, then even a little bad luck can be disastrous. But I might not care, because it's not my money at stake. Second, most of this money is probably OPM (Other Peoples' Money). That means it's very likely that a bunch of people who don't have a clue have delegated through one means or another, their investing authority to someo

The problem this solves is a financial company's tendency to say "the model predicts this complex asset has a value of $Money" without explaining the model and its assumptions. Forcing them to show you the model lets you decide how much you think the asset is worth, and how full of crap the bank is. I'm sure if you asked in 2009, many banks had the modeled value of sub-prime mortgage derivatives at like 50 cents on the dollar or something, because they built their models to show a value that wouldn't make them bankrupt, instead of a more realistic value like 10 cents/dollar. This regulation would make it easier to call them on that stuff.

Or some other other functional language like that? Usually when you are trying to formulate loads of rules, it would seem that brevity and exactness of results trumps the implementation detail of performance.

The said variable 'i' hereafter referred to as "i" shall be a variable and not of unvarying or constant except for the purposes of using the said variable within a clausal computation and shall be initially equated to 1 (one) neither less nor more and "i" shall be displayed to a third party within visual distance from the visual display device but not beyond unless further provision is granted and provided by the creator of the said work. These courses of action shall be repeated for 10 (ten) times neither more nor less withstanding any systemic error which may cause the premature termination of the said operations and includes the increment of "i" by 1 (one) in a positive monotonic uniform manner performed prior to each display to the visual display device. Upon termination of the aforementioned operational sequence the operations shall cease until recommenced upon instruction of the operator.

OK, how about if instead of providing mileage ratings that car advertisements simply had a URL to a Python program that if you entered information about your driving habits that it would come out with an MPG value for a specific car. Obviously, there would be a completely separate Python program for every single car.

Of course, 99% of the weighting would be handled by the questions "Do you drive with a lead foot?" and "Are jackrabbit starts your normal mode?" But the other 34 questions would be there as specified by the government regulation governing the production of these Python applications.

Having a model and the user gets to make up the assumptions, you are getting a traditional garbage-in, garbage-out algorithym. Any model can conform to any belief system given the "proper" inputs. Isn't this half of what the climate arguments are about? Not the code, but the assumptions being pushed into the model?

I can't imagine that this would provide the average Joe Sixpack any useful information. I would say this isn't "transparent" in any way - unless the inputs to the model were published and required to be adhered to. This would make legally binding assumptions like in 2050 there will be fewer literate people than in 2000. I'd like to see the government come up with a plan for that.

Or worse, if a fundamental assumption of the model is rising interest rates and every investor makes 100% return in five years, great. Does the ability to push out a program that says if you enter the five year interest rates as steadily rising then justify advertising that every investor will make 100% of their money?

This also reeks of the idea that if you can't read a programming language you are a second-class citizen. Richard Stallman would be proud.

I can't imagine that this would provide the average Joe Sixpack any useful information.

Joe Sixpack doesn't typically buy collateralized debt obligations. In fact, if he bought a tranche of a CDO, I think that would immediately disqualify him from his everyman status. The main customers for these sometimes obscenely complex instruments are investment firms.

Problem is, the legalese is so dense, even professional investment analysts have a hard time understanding the payout scheme. If I understand the proposal correctly, the Python code will itself authoritatively define the flow of funds from the investment vehicle. It won't simply be a model that makes predictions based on initial assumptions -- it will also "allow the use of the proposed asset-level data file that will be filed at the time of the offering and on a periodic basis thereafter". Thus given specific data about the performance of underlying assets up to any given point, the code will spit out an authoritative answer of "who gets paid what (if anything)".

Since a structured investment vehicle is essentially an algorithm wrapped in a contract, it makes sense to use a programming language to specify that algorithm. I personally like Python; but I agree with other posters who have said the regulation should ensure that other languages can be added over time.

Companies are protected from all sorts of investor inanity by the vagueness of the public's view into their business models.

Asking a company to produce a model is asking the company to allow investors to claim that any action outside the model constitutes a violation of the promises made in the prospectus that is the model.

Adding a hold-harmless clause stating that the model is innately inaccurate is the same thing as just not producing the automated model at all.

Keep in mind people don't like computers, programs, math or finance. You have to consider that. So I've gone on Wikipedia and did a search on a computer language that produces *minimal* code.

I briefly glanced only at the first sentence from the following page (http://en.wikipedia.org/wiki/Brainfuck) and trimmed the first sentence for length: "The brainfuck programming language is... noted for its extreme minimalism.". See, this is what people want, it keeps things simple.

There's lots I don't understand about this. This seems to me to be only valid for long term funds invested in bonds and Treasuries or something.

Isn't what these people do is change their decision making constantly with shifting criteria? Isn't the bulk of what brought the house of cards down either unknowable, in denial, or covered over with Enron type mark to market delusions?

I understand the theoretical aspect of codifying some set parameters around an invest

However, this proposal is encoding a scenario-based financial forecasting model developed by management and making a private entity (meaning not a governmental body, although perhaps a public company) publish that model. That's a bit too detailed, insidery and strategy-exposing for me, and I'm all about good transparency and g

You're missing the point. The point is to make sure that the companies taking money are providing transparency to their investment strategy, not only to the investors but to the credit rating agencies as well. The firms in question purposefully obscured CDOs and other exotic financial instruments so they could play hot potato with the emperor's clothes and cash in on the commissions.

If a "Derivative" is to be used as Insurance on an Investment, then to not own the Investment is Gambling. What is the difference in Gambling and Investing? I know a grinning show off could pop off something goofy. But how would the Supreme Court see it? Because you know, it's going to go to this level.

This would not have prevented the current financial crisis and it will not prevent the next. It's a small step in the right direction, however. The SEC has been one of the most incompetent agencies for some time and I think they're trying to turn themselves around. In this case the SEC is simply acting like a grown up overseeing a bunch of kids. You want to offer a complicated financial instrument to the public, you document it precisely. There's value in this: For example, you couldn't possibly have a thir