Terminator Salvation

“Terminator Salvation” (2009) movie poster Disappointing. But go see it if you can sucessfully lower your expectations and smirk at the awful plot holes.

In a way this is a dreadful, dreadful movie. But in another way, composed as it is from the scavenged flesh of previous Terminator movies (and WWII action movies) laid over a mechanical script, and executed by soulless, unstoppable actors, it’s quite impressive to watch from an (emotional) distance.

The biggest question this movie raised for me was: how come Terminator robots are so rubbish at fighting? Their basic martial arts technique is throwing people into stuff. To some extent that can work, in that: if you throw Michael Baen/Christian Bale into enough filing cabinets/walls/windows, you will eventually wear them down, but if you were a huge, mechanical Arnold Schwartzenegger with superhuman strength, why not just take the easy route and crush their puny human heads, or rip their arms off. (The one in this movie even grabs the gun from the hands of a human at one point and chucks the gun away, before proceding to throw the human against more metal cabinets. Arnie in the first movie was smarter than that.)

The first movie was smarter than this one. Much smarter. It had a kind of gritty realism which made the outrageous premise (time-travelling killer robot from the future) credible. This movie is big and dumb and the woeful script is plainly just there to give an excuse for the explosions and the robots. (And the exploding robots, and the robots causing explosions.)

High points: visually it looks quite tasty. The post-apocalyptic wasteland looks lovely and cold and desaturated. In fact the whole film is art-directed to within an inch of its life.

Also, Sam Worthington, as the half-man-half-Terminator—(He has a metal endoskeleton, and a controlling microchip which appears to a) do fuck-all, and b) be embedded conveniently near enough the surface of his neck than he can just pull it out at an importantly emotional moment before saving the day)—is generally very watchable. He does proper acting and things, and his disbelief and inner conflict are all very believable.

Oh, and John Connor’s doctor girlfriend is very pretty. (Very pretty. Kind of a weird eye thing going on, but that’s quite endearing.) Anton Yeltsin is alright as a young Karl Reiss. Bale, as Connor, is, adequate. Spends all his time grumping.

Like I said, though, my main problem with the film is that it’s complete nonsense. There’s no logical, believable thread through it to make you care about the exploding robots. It feels like stitched-together other films. Very post-apocalypic-zombie-movie near the start, with Terminators that look like reanimated metal corpses; scenes and shots which appear to have been lifted wholesale from other movies in the franchise: the motorcycle/truck chase; the melting-the-robot-then-freezing-it-routine; the climactic fight in the factory. All the explosions and helecopters make it look like umpteen Vietnam movies. When Worthington first appears, reborn as a Terminator, he’s covered in mud and screaming, either like a newly-born Urak Hai in Lord of The Rings, or that guy in Apocalypse Now. Ho hum.

Then there’s the constant prompting the audience via clunky lines in the script. “Prepare medical team, stat. By the way: it’s John Connor.” Pish. The gurrilla resistance all seem like clichés, barking some orders, and bravely defying other orders, and, for some reason, amazingly well equipped and all looking like be-stubbled male models, as they cluster round their radios in a selection of apocalyptic international locations.

All in all, it’s what you should expect from the 4th film in a blockbuster Holywood franchise. Written by a committee, directed by a moron, and probably focus-grouped to within an inch of any remaining artistic life.

It was quite fun to watch a digitally-recreated naked Arnold Schwartzenegger throw Christian Bale into metal cabinets, but really it made me want to go back and watch the original The Terminator again. For all that that film’s effects don’t really stand up terribly well nowadays, it manages a wonderfully sustained tension, brilliant performances and a thoroughly engaging emotional core that Terminator Salvation doesn’t come near. The terminators in Salvation are just not as terrifying.

(Oh, and how much of a bastard is John Connor for accepting that donation at the end?!)

Hindley-Milner type inference in Scala

I’m working on a spreadsheet application at the moment. (Very exciting.) Part of the implementation obviously includes an expression language (so you can write things like total = sum(numbers) or vat = price × 17.5%).

Part of the design is to disallow things like "text" ÷ 11 or apples + oranges, and for that I need a type system.

So I’m investigating type systems, and rules for inferring types, and I’m looking at the algorithm they call Hindley-Milner type inference. I found an implementation of the algorithm in Perl by Nikita Borisov. This was in turn based on a Modula-2 implementation described in a paper by Luca Cardelli, Basic Polymorphic Typechecking (1987/’88). Given that I read maths only very painfully and slowly, it’s a very clear and readable paper.

I have reimplemented the algorithm in Scala (the language I’m using for my application).

Because Scala is itself a statically-typed language, some of the logic becomes clearer than the Perl version (for example, it is obvious where type variables are expected as opposed to type terms). Scala is also somewhat syntactically lighter than Perl, and a lot lighter and more expressive than Modula-2, so you may find it easier to read too.

The essential algorithm is elegant: given an expression in the form of an abstract syntax tree (AST), it recursively creates a tree of types in the expression, inserting placeholder ‘type variables’ for all the unknowns. It then ‘unifies’ sub-types, for example, ensuring that a function call’s result type is the same as the function definition’s result type. The final unification creates the most general type tree possible which accurately captures the expression type. The final unification may include still-unbound type variables, which would indicate that the expression is polymorphic in these type variables.

My code is available for download in the hope that others find it as useful as I found Luca Cardelli’s paper and Nikita Borisov’s Perl implementation:

http://dysphoria.net/code/hindley-milner/HindleyMilner.scala

You can run it as a script to see it analyse some example expressions: scala HindleyMilner.scala

Note: I believe that there was a mistake in the original Perl code; when unifying two variables, it tried to ensure that generic type variables were always bound to non-generic ones, not the other way about. This was in order to satisfy the requirement “In unifying a non-generic variable to a term, all the type variables contained in that term become non-generic.” However, it does not matter the order in which they are bound. Once the ‘bindee’ is further bound to a term, they both become bound to the same term. The original code omitted a call to prune in the method occursintype which (I believe) lead to a fault, for which the mistaken ‘fix’ was added.

Update 15 Sep 2013: Now compatible with Scala 2.10!

Watchmen

“Watchmen” (2009) movie posterOoh, fantastic movie. I loved the book, and I loved the film. One of the few that I’d go to see again. It’s increadibly rich in detail and nuance.

It’s also a superhero movie—and a relatively stylised one—which is far more grounded and relevant than the supposed crop of gritty, rebooted things like The Dark Knight. Which is nice.

It ‘works’ in the way that the best fantasies work: it takes an outrageous premise (an alternate 1985 in which Nixon is president, superheros are real, including a man who has been turned into a superman by a nuclear accident), and tells an interesting story.

They have changed one thing from the book: the giant squid at the end is, er, something else in the movie. But it works. (It actually makes a little more sense than the monster in the book, I think.) And thematically, historically and in terms of character, it’s all very faithful to the novel, which is astonishing in itself.

The soundtrack is very 1980s, and rather enjoyable. (Ride of The Valkyries in the Vietnam War sequence is kinda odd—at least to me who hadn’t seen Apocalypse Now.) Richard Nixon was a little less than convincing-looking too. But there’s not much I can criticise it for.

3 thumbs up

Cyborg Beetles Take To The Skies

Have you ever wanted your own army of implacable cyborg beetles?

Oh, come on, you know you have.

Wouldn’t it be great to take a beetle (a), attach a microcontroller (d) with electrodes (e) attached to the beetle’s nervous system and muscles, then control it via wifi (b).

How The Robobeetle WorksAmerican researchers have apparently created a prototype beetleborg and had the poor godless bastard creature fly across a room under the radio control of its maniacal, scheming human masters.

They built it out of a rhinocerous beetle, since they presumably happened to have one lying around. And because rhinocerous beetles are very strong for their size and have scary big horns. (Apparently they are also clean and make good pets too.)

Practical uses for the remote-control zombie insects include surveillance, finding people trapped under rubble and Egyptology.

I like to think that future models could be equipped with enhanced titanium horns which could be used to free hostages and cut telephone cables.

Anyway, this one scores a ‘9’ on my Meddling With Nature-ometer. Impressive, potentially useful, and fucking creepy.

I leave you with this fun fact about rhinocerous beetles from Wikipedia:

Rhinoceros beetles are also the strongest animals on the planet in relation to their own size. They can lift up to 850 times their own weight. To put this into perspective, if a human of average height and weight had the strength of the rhinoceros beetle, he would likely be able to lift a 65 ton object (e.g. an M1 Abrams tank).

Madagascar: Escape 2 Africa

“Madagascar: Escape 2 Africa” (2008) movie poster Ah yes. It is a truism that no man is an island. Unless his name is Madagascar.

This is a funny little film. Very funny. Rather strange. Ultimately entertaining (and a little bit exasperating).

I didn’t like the original Madagascar much. I just didn’t get whether the characters were supposed to be animals-as-metaphors-for-humans (in which case they spent too much time trying to eat each other for my liking), or ‘real’ animals with human voices (in which case why the hell did the lion not eat the zebra a lot earlier?).

This just abandons all notion of realism or actual animal behaviour. It’s all just completely bizarre. All of the characters basically exist to set up the gags. Fortunately it’s really, really funny, in a completely stupid way. Continue reading