Desktop screenshot
Arch Linux on Acer Aspire + Gnome + Troll theme. Wallpaper from wallbase.net.
Arch Linux on Acer Aspire + Gnome + Troll theme. Wallpaper from wallbase.net.
After a half-arsed attempt to learn Scala, I’ve decided to give Clojure a go. I’m a Python coder by habit and so I’m a sucker for pretty syntax. Scala looked capable, but so much about it just looked ugly to me. Which of course is all in the eye of the beholder, but as I’m the one going to be doing the beholding I just found Scala code a bit to inelegant for my taste.
Having said that, I did give the Play! framework a go, and very nice it was too. If you work with Scala or Java I’d definitely recommend it.
Clojure is a Lisp. I’d only briefly looked at Lisp and Scheme before, and it all seemed a forest of parentheses. However a closer look shows a very elegant way of programming. Unlike Lisps of the past, Clojure might have a chance to succeed. It runs on the JVM, which means clean interop with all that Java code of yesteryear, as well as benefiting from one of the largest open source ecosystems out there.
Here’s an example of Clojure:
(+ 1 1)
This simple function produces 2. In other words, it’s 1 + 1 = 2 in a more sane-looking language like Python.
The key to understanding that snippet of code is that + is a function, taking two arguments. A Clojure program is functions calling functions calling functions, all carefully nested. The result of one function is passed to the next, which processes the result and passes it to the next, and so on. In a “pure” Clojure program there is no “data” as such (other than I/O). Everything is immutable.
I’m not sure I really “get” this paradigm yet – it’s a dramatic shift from the object-oriented/procedural way of thinking. Python has functional concepts (reduce, list comprehensions etc) but it doesn’t have the functional purity of Clojure. While in many ways simpler than Scala, the simplicity belies an inner, alien complexity.
Once I’m more familiar with Clojure syntax (I’m reading Programming Clojure by Stuart Halloway) I’m going to have a look at web development on Clojure, in particular Compojure.
Tumblr has been in the tech news recently, due to a few hours shortage – something to do with a database cluster. Foursquare were down the other month, again with database issues, this time using the infamous web-scale NoSQL MongoDB solution.Not to mention the Digg 4 fiasco.
In each case, this prompts a serious discussion in proggit or Hacker News – why are they doing it all wrong ? Must be because they used language X, framework Y, database Z.
It’s almost a rite of passage when you build web applications – the 2 am “site down” SMS, Tweet or email that means that you’ve got to go and restart Apache or whatever it is you need to do before the customers start to complain. Sometimes it’s a hardware fault, sometimes a stupid programming mistake, sometimes a DOS attack, sometimes some esoteric failure in the database cluster. Doesn’t matter, the site monitoring is pinging 500 errors and your boss is panicking on the phone.
In fact, downtime is almost inevitable, especially when you are growing fast and iterating quickly. The thing is, we are still in the infancy of a new technology. Think of how unreliable biplanes were in the 1920s compared to a 747 today – that’s about how far along we are in server-based applications. The difference is that airplanes, even in the 1920s, were designed to do one thing – stay up in the air long enough to get people and cargo to their destination. Modern web applications are in contrast a series of hacks upon hacks over a simple set of protocols really designed so that academics could share their physics papers.
I suspect in the next decade or so, as cloud computing matures along with better hardware such as SSDs, that these kinds of scalability issues will become more and more a thing of the past. People will learn from the experiences and build new frameworks and solutions around these so that scaling up to millions of users can be done transparently and cheaply. Google App Engine really points the way, as limited as it is right now. Whether we continue to use relational databases or NoSQL is really not that important, what’s important is that we learn how to crack the scalability problem.
A couple of weeks ago, before the Great Ice Age started in Scotland, we went to our local Odeon to see Skyline and Burke and Hare. The latter was what newspaper film critics call an "enjoyable romp". Simon Pegg was his usual good self, the humour was suitably dark and tasteless and it was all-in-all worth the cost of the ticket, though to be honest it's the kind of film you could just as well watch on DVD.
As for Skyline...well, the trailer was enticing. I mean, giant spaceships appearing above Los Angeles, people being sucked up into the sky...what could you hate about it ?
For starters, bad acting. We're talking SyFy quality here. If you've ever seen such masterpieces as Mega Shark vs Giant Octopus you know what I mean. Syfy at least provides some familiar faces - usually washed out 80s has-beens (Debbie Gibson, Tiffany, what's-his-name who was in the Breakfast Club) - but apart from someone who I think was in Scrubs they were unknowns.
And there's nothing wrong with that - many a great movie or franchise started with unknowns. But here there is no chemistry, just some random collection of LA media douchebags you don't care about, and the obligatory tough Mexican dude. But other than the Mexican dude, you don't really care whether they live or die. The acting was stilted, acting students on their first job, or worse, Star Wars prequel standard.
The special effects were OK. Not terribly bad - not as bad as Syfy, who take bad CGI to a whole different level - or Ed Wood bad, but just meh.
What really annoyed me though was the way they shamelessly ripped off just about everything else out there. Throughout the whole sitting - there was just the two of us I think in the whole theatre - I passed the time by counting off not only the cliches (of which there were a-plenty) but the sheer brazen theft that was going on:
As for the ending....basically the hero and his pregnant girlfriend get sucked into the spaceship, his brain is accidentally downloaded into an alien, and he takes off with her, presumably taking on all the other aliens in the process. A lot of people complained about the ending, but at least it had the virtue of being original. In fact the ending was the only original thing about the whole damn movie.
I wouldn't bother with this one, really. If you want to see a low budget alien invasion movie done well, go see Monsters. If you want to see a big budget alient invasion movie done better, go see the Battle of Los Angeles. I've not seen either, but I'm sure they'll be a damn sight better than Skyline.