Not-So-Smart Contracts

So-called “Smart Contracts” are a nightmare waiting to happen. Based on Bitcoin, Smart Contracts are essentially software-based legal contracts that programmatically execute financial transactions when certain conditions are met. For example, a smart contract could be written for a loan such that if borrower misses a payment, the lender could deduct the loan payment, as well as a hefty late fee, from the borrower’s account, automatically, with no recourse available. Interest rates could fluctuate literally with the weather (simply by tying the conditions of the Smart Contract to a weather API), or even be based on a random number. Connecting Smart Contracts to the even more dystopian “Internet of Things” means that if a person is thirty seconds late to work, they can be docked pay automatically, as soon as they walk in.

Smart Contracts have two major flaws. The first is that they couple personal finances, transactions, arbitration, and enforcement in one terrifying monolith. This means that instead of parties in dispute going to small claims court (arbitration), say, and seeking a judgment (enforcement) against the other, so that they can receive a payment (finances) from them, the Smart Contract combines all of these steps into one algorithm. The theory justifying this dangerous approach is that people are inherently untrustworthy, and presumably, that software is not. Ethereum, the most prominent organization developing Smart Contracts technology, brags that it “allows people to safely interact trustlessly”, and the original Bitcoin whitepaper talks about “the inherent weaknesses of the trust based model”, and calls for “cryptographic proof instead of trust”.

From this perspective, the second flaw is even worse. Ethereum uses an object-oriented language called Solidity to write Smart Contracts. From their documentation, “Solidity supports multiple inheritance by copying code including polymorphism.”.  Object-oriented programming has all sorts of complexity problems, but one of the worst is multiple inheritance.

Multiple inheritance is its own disaster waiting to happen: it introduces the possibility of something that Bob Martin calls the “deadly diamond of death” that creates ambiguities that are problematic in interface software, and potentially disastrous in financial applications.

Meanwhile, this is a “simple Smart Contract” from the Ethereum documentation (the word “simple” appears many times in this document):

pragma solidity ^0.4.0;

contract Coin {
    // The keyword "public" makes those variables
    // readable from outside.
    address public minter;
    mapping (address => uint) public balances;

    // Events allow light clients to react on
    // changes efficiently.
    event Sent(address from, address to, uint amount);

    // This is the constructor whose code is
    // run only when the contract is created.
    function Coin() {
        minter = msg.sender;
    }

    function mint(address receiver, uint amount) {
        if (msg.sender != minter) return;
        balances[receiver] += amount;
    }

    function send(address receiver, uint amount) {
        if (balances[msg.sender] < amount) return;
        balances[msg.sender] -= amount;
        balances[receiver] += amount;
        Sent(msg.sender, receiver, amount);
    }
}

Got it? Will your technolawyer get it? This is “the simplest form of a cryptocurrency” (their words). Here is another contract that I wrote, using inheritance:

contract my_mortgage is a_great_mortgage {}
contract a_great_mortgage is a_subprime_variable_interest_rate_mortgage_that_is_enforced_automatically_and_will_ruin_your_life {}

(Hint: read it out loud)

Imagine the worst legalese you’ve ever seen, and now imagine it as computer code, obfuscated by multiple inheritance, connected directly to your bank account, with no possibility of appeal in court, based on protections afforded by law, as that would presume a “trusted third party” for arbitration. Software inevitably has bugs, and I am not encouraged that the primary language for Smart Contracts will reduce their number. In fact, it is painfully easy to see much bad software being written with Solidity.  Ethereum argues that “one of the many advantages of having a robot run your organization is that it is immune to any outside influence as it’s guaranteed to execute only what it was programmed to.”  We are supposed to trust these “neutral” systems over each other.

The companies and institutions promoting Smart Contracts are nothing if not ambitious.  CoinPrism encourages you to “store your house on the Bitcoin blockchain” (I do not). What will this mean if you agree (voluntarily or otherwise) to a buggy and/or malicious contract that happens to have access to ownership of your house?  I don’t doubt the intentions of the authors of Solidity et al, but the road to hell is paved with good intentions. Perhaps the “trust-based model” needs to be reconsidered.


Flea Market

“That’s $14.35.”

“Fourteen… thirty-five?” He felt stupid saying it so slowly, but it sounded wrong.

“Yep,” the woman sitting on the other side of the table said.  He thought he saw a slight leer.  “You want it?”

“Ummm, well, I, uh, hmmm…” He had an uncomfortable sense that she somehow understood his disfluencies better than he did.  “I’m not sure, hmmm.  What is it?”

“It’s a clock. Antique. It’s worth at least a hundred and fifty but I gotta get rid of it.”

“A deal,” he thought. “Maybe. This lady knows what she’s doing. Probably not $150, maybe less, but who knows? Maybe it’s worth even more.  I could get Sam to look at it… Besides, it would look good on the bookcase, next to the lamp.”

What he said was, “Huh,” but again he sensed that she was reading him more closely than he would have liked.

The vendor sat at the edge of a plastic folding chair, arms folded, with raven-black hair, wearing a dark purple dress made of what looked like velvet, the steward of a table covered with old dolls, old bottles, old mirrors, objects waiting for a place to go besides the dump.  The table’s faux oak veneer was peeling, revealing the damaged particleboard underneath.

“It’s nice,” she said.

It was, he agreed. But it also looked heavy, and he had a long train ride home.

“Yeah…” He started to pull back.

“You can have it for ten. I gotta get rid of it.”

He tried to remember what was in his wallet. Did he have a ten? He was pretty sure he had a twenty, but sometimes these flea market people didn’t have change, and they had to go to the next table, to their… friends? Probably more of a you-scratch-my-back kind of situation (now that was an old saying). Anyway, he definitely didn’t have… fourteen-thirty-five, and didn’t feel like spending more time with this transaction than necessary, and already regretted following his curiosity to this weird place, and this weird woman, with her weird table, but if he had a ten on him, what the hell, it was a nice… clock, or whatever it was.  It didn’t look like a clock to him, but it looked old and ornate and brassy, and they don’t make things like they used to, and it would give his apartment a slightly classier feel, and… She was staring at him, waiting, waiting for a decision, while he tried to remember if he had broken a twenty recently… He had! Yesterday, when he stopped by the deli to get a coffee.  The guy hadn’t been crazy about giving him nineteen dollars in change, either.

“Sure,” he said.

He took out his wallet.  There was no ten, only three twenties and a few singles.  He blankly handed her a twenty.

“Hold on, I’ll get you your change,” she said, and headed to the adjacent table.

“Careful, it’s heavy.”


Gluten Free

Hey, how you doin’ little pizza pie?
You are the apple cobbler of my eye;
You look like a panini fallen from the sky;
Just a little taste of you I wanna try;

Gluten Free! Gluten Free!
Gluten Free! Gluten Free!

Hey my lasagna babe you look so fine;
My little cupcake yeah – you’ll soon be mine;
Delicious canolies all in a line;
If I can’t eat you up it would be a crime;

Gluten Free! Gluten Free!
Gluten Free! Gluten Free!

(Bridge)

I want to slurp you up just like spaghetti;
Warm you like toast that’s nice and bready;
Run my fingers through your raw cookie dough;
Why I can’t have you baby I just don’t know;

(Instrumental)

My cookie cuttin’ days are just about through;
My angel cake went and left me too;
No devil’s food for me, you know it’s true;
Babe I’d go hungry if it weren’t for you;

Gluten Free! Gluten Free!
Gluten Free! Gluten Free!
Gluten Free! Gluten Free!
Gluten Free! Gluten Free!


A Plea to Iowans on the Eve of the Caucus

I am writing on the eve of the Iowa caucus with a plea to voters in Iowa, many who see Donald Trump as the answer to American’s problems.

He is not.  His rhetoric against Islam and Muslims is already pouring gasoline on a conflagration, serving no other purpose, and his election to the presidency would have the effect of increasing the quantity of gasoline a million-fold.  Members of the three great monotheistic religions have coexisted peacefully together before, so it is not without precedent that I still have cautious optimism that it can happen again in my lifetime.

I cannot speak for all Americans, but I do not want my president to lead my country into a religious war with Islam.  There can be no winner in such a war.  The dangers are too great.  And the only security system in the world that can prevent random attacks is a totalitarian one.

The election of Donald Trump to the presidency would only escalate the tension between Islam and the West.  I am concerned that his election could lead to a thermonuclear event in the next ten years, on one side or the other.

Again, today I plead with my fellow American citizens of the great state of Iowa.  Please do not elect Mr. Trump to be leader of the Free World.  We will be more safe and secure as a country without the terrifying drastic measures he has proposed.

Thank you for reading this.

Daniel M. Tsadok


Dune: An Analysis of the Atreides-Harkonnen War

(Warning: Dune Spoilers Aplenty)

In Frank Herbert‘s novel Dune, the feud between the Atreides and the Harkonnens was “kanly” – no holds barred.  The word appears early in the novel, when the Baron Vladimir Harkonnen is discomforted by the Duke Leto Atreides‘ usage of the word in their final correspondence, in which the Duke refuses to meet with the Baron for a peace negotiation.  It is within this context that the story of Dune begins.

This feud reached its climax in a Harkonnen surprise attack on the Atreides home on Arrakis, in which House Atreides was virtually wiped out, with the exception of a handful of Atreides survivors, including the Lady Jessica Atreides and her son, Paul Atreides, the ducal heir.

The extent of the Harkonnen victory gives the impression that the Duke was outmatched.  Even the Lady Jessica thought of the Baron Harkonnen as “too potent an adversary” when she encountered him the aftermath of the Baron’s victory.  However, the Duke Leto may have been the greatest tactician alive in the universe at the time, superior to the Baron.  He was aware that Arrakis was a trap, and even that the Padishah Emperor had secretly sided with the Harkonnens.  He knew that the spice harvesting equipment would be damaged, and that he would be blamed for a poor harvest.  But he walked into the trap knowing also that the spice melange was the most precious commodity in the universe, and that control of Arrakis would give him tremendous power and wealth.  He also knew that the native Fremen would make potent allies on the planet.  He was supported by talented people, some “legends in their own lifetime”.  The Duke came to Arrakis as prepared as one could be under the circumstances.

How then, did the Duke allow himself to fall victim to the Harkonnen attack?  Leto made several critical errors.  A direct attack by the Harkonnens, even one aided by the Emperor, might not have succeeded, and a failed attack on the Duke could be disastrous for both the Baron and the Emperor.  The attack must involve treachery.

The Duke knew this, of course.  The Lady Jessica had received warnings of treachery through her Bene Gesserit sisterhood, in a message hidden in the Bene Gesserit way: written in a form of braille on a leaf in the royal gardens on Arrakis.  His son Paul heard similar warnings from the Fremen, whom the Atreides were already courting as allies, after saving the life of his Fremen housekeeper.  The Duke, while aware of the danger, still did not know, however, “which hand held the knife”.

The Harkonnen master stroke, most likely devised by the Baron’s advisor, mentat Piter De Vries, came in the form of a “scrap of a note”, with the Baron’s own seal, implicating the Lady Jessica as the Atreides traitor, falling into the hands of the Atreides mentat, Thufir Hawat, the Duke’s “Master of Asassins”.

In the moment that Hawat, shaking, approached the Duke with news of the note, the Duke made a fatal error.  The Duke decided to pretend that he believed the note, in the hopes that the real traitor might lower their guard.  As part of this decision, he pulled his best man, Swordsmaster Duncan Idaho, from a critical mission recruiting the Fremen to keep the Lady Jessica under surveillance.  Hawat was similarly distracted from detecting other threats, especially the real traitor, Paul’s tutor, Dr. Wellington Yueh, who betrayed the Atreides by deactivating the Atreides House shields immediately before the Harkonnen attack.

Why did the Duke weaken himself so?  Why play out a charade of distance from his partner when he most needed her counsel, trained as she was as a Bene Gesserit?  Why, when he must have known in his heart that the Lady Jessica, whom he hadn’t married in hopes of making an alliance with another Great House, not only had his best interests in mind, but loved him, and their son?

One factor may be that Leto relied overly on Hawat, a human computer, and one of the best mentats in history.  Hawat had virtually complete control of security in House Atreides, and when the evidence alleging Jessica’s involvement with the Harkonnens reached his hands, he was overwhelmed by the possibility, as intended by De Vries.  To Hawat, the Lady Jessica was a much more obvious suspect than Yueh, who was Imperially conditioned not to harm the Atreides.  Only the twisted mind of De Vries could imagine the possibility of breaking such conditioning, and Hawat could not.

The Baron understood the limits of a mentat well.  The Baron saw De Vries only as a dangerous tool to be used.  He instructed his nephew, the presumed heir to the barony, Feyd-Rautha Harkonnen, on the limits of a mentat (in the presence of De Vries) before making his attack.  The Duke failed to understand Hawat’s limitations.  Jessica, by contrast, realized that Hawat was vulnerable, and that the note was aimed at him.  She even presented this possibility to Hawat, making him realize that he himself was a target of Harkonnen intrigue, something he had left out of his computations, thus exposing the mentat’s blind spot.  But too late.

Leto’s more fundamental error was to deny the love that bound himself and Jessica, love that he should have realized transcended any of the intrigues that the Harkonnens had put against them.  It was only when Leto denied this love that he was lost.  Shortly before the Harkonnen attack, Leto made the decision to change his strategy and marry the Laddy Jessica.  But too late.  The Harkonnen attack was already upon him.

Would the Atreides have prevailed had the Duke married the Lady Jessica?  Given the disastrous results of Leto’s decision to instead follow Hawat’s plan, it is likely that the marriage would have raised morale and strengthened House Atreides at a critical time, focused Hawat’s energies more productively, and allowed Idaho to cement his bond with the Fremen.  Yueh might have been exposed in time, and Harkonnen attack, stripped of a critical element, might have been postponed, giving the Atreides enough time to recruit the Fremen, allowing them to repel virtually any attack.

Jessica herself, always completely loyal to the Atreides, had been ignorant of her parentage until her extraordinarily gifted son noted the genetic markers in her and himself shortly after the attack.  The fact that Jessica actually was a Harkonnen, and the daughter of the Baron, no less, should be considered among the great ironies in modern fiction.


YouTube Approval Ratings

As of this writing, President Obama’s approval rating is 40%, according to Gallup, down from about 51% a year ago.  I’ve written about the voting aspects of YouTube before, so I was interested in how the YouTube ecosystem reacted to the latest State of the Union speech, as compared to last year’s speech.  For both speeches, I looked at the numbers for three different sets of videos: the official White House release, the Wall Street Journal’s release, and one put up by the New York Times (links to each below).

The first thing that became apparent is that the “approval ratings” for videos of the president’s speech were always higher than the president’s approval ratings according to the polls.  The official White House copy of the 2014 speech got 1,961 “Likes”, and 1,429 “Dislikes”, or a 58% approval rating.  This was the lowest of the batch, but still considerably higher than the poll numbers.  By comparison, the official release of the 2013 speech had an astonishing 81% approval rating.  That’s obviously a marked drop, but consistent with the relative drop in poll numbers.  More people also watched and voted on the 2014 speech: 45,000 more views (a 12% increase) and 1,000 more votes (a 50% increase).

The Wall Street Journal version showed a different trend: a drastic drop in views of more than 80% (from 374,004 in 2013 to 71,935 in 2014), but a comparable approval rating (67% to 61%).  Finally, the New York Times showed exactly the opposite trend: more than double the views (245,700 to 504,950), and an *increase* in approval ratings (61% to 68%).  In addition, the total number of votes tripled on the Times version, from 1,404 to 4,422.

That’s a lot of data, but what does it mean?  The first thing I would take away from these numbers is that it was a fairly successful speech, in the sense that many more people liked it than not.  57% is pretty good.  True, it’s not as good as 87%, which the 2013 Inauguration Speech got, but still a significant majority.

Also, the sample size is significant: about a million people watched the speech on YouTube, internationally, and it seems like the general trend is that the number of people who are watching the speech that way is increasing.  For comparison, the New York Times release of the president’s 2009 Inauguration speech got a mere 53,815 views, compared to 1.16 million for the 2013 speech, or twenty times more.  Possibly more importantly, participation is going up, not just viewership.  The percentage of people voting on videos, as opposed to just watching them, is increasing.

Perhaps the most troubling trend is the drop in viewership of the Wall Street Journal versions of the videos.  The Wall Street Journal is considered a conservative publication, so the possibility of a five-fold drop in viewership of the State of the Union among conservatives online could indicate a radical disengagement.  It may simply be a failure of marketing on the part of the Wall Street Journal, but it is worth investigating.  The corresponding increase in the New York Times versions only stress the point.

Finally, the demographics of YouTube are most likely very different than the demographics of television, and certainly than the demographics of households being polled.  YouTube is also international, so many of people voting on the State of the Union videos may not be American, and the president has generally been popular abroad.  The voting sample for YouTube is also more likely to skew younger than that of the polls.  In other words, the YouTube audience is more likely to be in the president’s political base.

There is no question that if current trends continue, the information revealed by YouTube viewership and voting numbers will be increasingly important to politics and beyond.

Video Sources:
2013 State of the Union: White House Official
2014 State of the Union: White House Official
2013 State of the Union: Wall Street Journal
2014 State of the Union: Wall Street Journal
2013 State of the Union: New York Times
2014 State of the Union: New York Times
2009 Inauguration Speech: New York Times
2013 Inauguration Speech: New York Times


Messing With Ruby

I’m overriding concatenation here, which completely messes up Ruby’s interactive console:

tsadok$ irb
irb(main):001:0> class String; def +(s); "no"; end; end
=> nil
irb(main):no:0> yes
irb(main):no:0> 1 + 1
irb(main):no:0> puts "hi"
irb(main):no:0> ^D
NameError: undefined local variable or method `nononono' for main:Object
no
irb(main):no:0> ^D
tsadok$

Lockdown

Apple’s iPad has been drawing a lot of criticism from developers lately for its locked-down platform. Any software that a third-party wants to develop for the iPad has to go through Apple’s approval process, which has proven to be a fickle arbiter. What’s interesting about the iPad is that it uses the exact same system as the iPhone, which didn’t draw nearly as much criticism. So what gives?

The answer is that it depends on whether you see the iPad as a device or a computer. If you compare the iPad to older devices like, say, the Nintendo Entertainment System, or just about any game console, for that matter, the iPad is remarkably open. The iPad’s development tools are free to download, as compared to Nintendo’s, which cost thousands of dollars. In addition, distribution for the iPad is trivial (it’s just software – no expensive cartridges to manufacture). As far as approving and allowing content goes, Nintendo has always had the exact same approach as Apple does now. There’s no question that Apple’s platform is much more open than Nintendo’s (or Sony’s, or Sega’s).

Of course, if you look at the iPad as a general-purpose computer, the picture changes dramatically. In that case the iPad is the most locked-down, restrictive computer in history. Even Microsoft never imposed the kind of control and restrictions on software development and distribution that Apple has. It’s virtually impossible to get any software on your iPad without going through Apple first. Could you imagine if you had to get Microsoft’s approval to install, say, tax software? Or if Microsoft had to approve of Firefox in order for it to be installed on your machine? Not that I’m praising Microsoft’s openness here – they have antitrust allegations to worry about – but compared to the iPad, Microsoft Windows is a haven of freedom. Third party developers working on the iPad have to say a little prayer that their app doesn’t offend Apple’s delicate censors, or worse, compete with Apple’s functionality (since Apple doesn’t allow software that offers “duplicate functionality”). If Apple does, for whatever reason, turn down their app, developers have no recourse or alternate distribution method. What Apple says, goes.

So which is the iPad – device or computer? The iPad itself makes clear that the distinction is arbitrary. A device is simply a locked-down computer, something that device makers have known for a long time. It mostly has to do with marketing; devices are usually designed (and locked-down) for a specific application (like gaming or e-reading), while computers (and their operating systems) are open-ended and multi-functional.

The iPad lives in a weird grey area. It has almost all the capabilities of a full-fledged computer, but Apple has chosen to treat it like a device. That makes it much easier to use than the Mac (in the same way that the NES was vastly easier to use than the C64). But it also raises all the control freak issues that Apple is infamous for.

I think the main worry among developers is that other manufacturers might follow Apple’s lead. That the trend will be to move away from general-purpose computers and towards locked-down, proprietary devices and operating systems. If that’s where we’re going, then developers (particularly independent developers) could be in serious trouble. This also extends to the web, I’m afraid: if consumers are only able to use locked-down, proprietary browsers, then net neutrality is once again at risk (this time from the client side), which will primarily affect independent developers and small businesses.

Is the iPad indeed this sort of threat? Only time will tell.


My Next App

I’ve been thinking about how I would build my next killer web application, surveying what the best options are out there to get it up and running as cheaply, quickly, and cleanly as possible. So here are my thoughts on what technologies I would use:

Application Framework
Ruby on Rails 3
Application Hosting
Heroku
Database *
MongoDB OR PostgreSQL
Front-End
Haml
Sass
Compass (Blueprint CSS)
Javascript Framework
JQuery
Asset Server
Amazon S3 + Cloudfront
Source Control
Git (possibly hosted on Github)
Offsite processing
Amazon EC2

* Heroku only provides Postgres “out of the box”.

Let me know what you think!


District 9

I’m writing this because so many of the reviews of this movie don’t seem to get it.  But I can’t write this post without spoilers, so if you haven’t seen it, SEE IT, and then come back here.

Ok – spoiler time.  By the end of the movie, it’s clear that:

a) The “prawns” (the derogatory name that we call the aliens) have vastly better technology, specifically, weapons than us.

b) They are physically strong enough to easily rip a human apart.

c) They basically understand us (although they can’t always predict us).

d) They have a mothership hovering in the air that can fit 1.8 million of them.

e) They are able to build another, smaller ship, again, more advanced than anything we have, by looking through our garbage and seeing what they can use.  They are able to do this underground, where we can’t see the new ship.

So why don’t people get that they’re smarter and stronger than us.  And because they’re smart, they empathize with us, the way we empathize with animals.  They don’t want to hurt us the way we don’t want to hurt animals.  They’re actually much more enlightened than us, and value life more, because they are on a higher level.  Their brains are more valuable.  Each one is more individual from each other than we are from each other, because they’re that much more complex.  They have more dimensions to express their individuality, because their thinking is more nuanced.  So they value our lives in some ways more than we value our own, and are more reluctant to kill us than we are to kill each other.  Again, over the course of the movie becomes clear how pitifully easy it would be for them to wipe us out in a few days.  But they choose to let us live.  They’re more sensitive and loving than us.

They have a virtually indestructible suit of death that can take out two cars and a dozen marines, and choose not to use it (except the child), even though it’s right there for them.  Their rifles can easily demolish our buildings in one shot.  These aliens could wipe us out and take over the planet at any time.  Easy as pie.  But they decide not to, even though they’re capable of anger (and with us killing their babies and threatening their children, they are slowly getting angrier and angrier), and go along with our primitive demands.

Imagine being kidnapped by humans from an ancient hunter-gatherer culture. You have an automatic pistol with you.  The primitive humans have no idea what it is, although they realize that it’s probably a weapon.  They’ve never seen anything like metal before, so they realize it’s powerful.  But they don’t have any clue of the true power your gun has over their wooden spears.  But you are a kind person and don’t want to hurt anybody (although they seem shockingly violent).  You probably know more about science and technology than they can imagine, although you admit that there’s a lot you don’t know about in the world.  But even the technology you do know about and understand would blow their minds.  Something as simple as a lighter might freak them out.  Or a soda can.  You’re also much more civilized (in the sense of non-violent).  They are willing to torture you (their primitive weapons, pointy spears, still hurt), but you won’t harm them, even though you are much larger than they are (as modern humans are as compared to primitive humans) and could easily overpower them.  You want to teach them what you know.  You want to teach them about commerce, electricity, radio waves, medicine, air travel, space travel (they have very primitive view of space, since it’s just “the sky”, and they debate if the sky goes up forever, or if the sky stops, and there’s something on top of the sky), and quantum physics.  They have no idea about any of that stuff.  You don’t even know where to begin.  But they’re very primitive, belligerent, and violent.  So you try to learn their strange culture and beliefs as well as you can, keeping your hands up (as they insist) to stay out of trouble, and just go with the flow.  You have your gun.  So again, while you could kill them at any moment, and reasonably expect to get away, you choose not to, out of higher principles.

You also live much longer than they do.  Their average lifespan seems to be about 40, which is sad.  They don’t have modern medicine like you do.  If you were a doctor, you would have much to teach them.  But you’re not.  You’re a just a data analyst.  Not that they would have any idea what that meant.  Imagine the wonder if these primitive people saw a computer, or even a cell phone for the first time!  Are they even ready for that?  You could show them a battery, and they would have no idea what it meant.  How would you even start to explain the technology behind a battery to them?  They don’t even know about electricity yet!  They have a written language, though.  That’s a start.  Maybe you can learn their language somehow, and start to teach them in their own language, which is too primitive to express what you have to say, really.  You start to feel an affection for these people, even though they are continually treating you with hostility and suspicion.  You don’t blame them – they’re so primitive!  You understand them, and their crude technology, but they don’t understand you.  You’d love to get home and tell your family all about the adventure!  And you long for the comforts of modern life (although you’ve learned to adopt to living in their humble wooden tents, which are drafty and require you to sleep on a rag on the floor, as they all do).  But these people are keeping you prisoner, and you refuse to kill them in order to make your escape.

So what can you do?

Whatever you think of the primitive culture is what the aliens think of us.  They’re much more moral and much less violent than we are.  They could easily kill us, but they’d rather teach us – they have so much they could teach us (although our smaller brains could probably not handle most of it), but they wonder if it’s a good idea.  Violent as we are, wouldn’t we just use their new technology to kill each other?  So the aliens are thinking: “Maybe we could send a few of our scientists there (along with a military escort, of course) and study them later.  For now, just get me the hell home!  These primitive people are violent and dangerous!”

Now do you get District 9?  It’s the sad story of how we make first contact with a superior race, and badly screw it up.  We’re not even smart enough to open ourselves up to what they have to offer.  And by the end of the movie, we dimly wonder what this creature, who can build an advanced spaceship out of discarded computer parts in his basement, will do next.