• My Cyborg Name


    Artificial Networked Device Responsible for Exploration

  • Mighty Mouse

    I wrote up some first impressions of Apple’s new Mighty Mouse on the Whirlpool forums, if anyone’s curious. The things appear to be selling like hotcakes at my local AppleCentre!

  • Patterns in Software

    Paul Graham writes in his “Revenge of the Nerds” article:

    … in the OO world you hear a good deal about “patterns”. I wonder if these patterns are not sometimes evidence of … the human compiler, at work. When I see patterns in my programs, I consider it a sign of trouble. The shape of a program should reflect only the problem it needs to solve. Any other regularity in the code is a sign, to me at least, that I’m using abstractions that aren’t powerful enough — often that I’m generating by hand the expansions of some macro that I need to write.

  • Language Optimisations vs Domain-Specific Optimisations

    To quote part of the abstract from Arch D. Robinson’s awesome paper, The Impact of Economics on Compiler Optimization:

    Compile-time program optimizations are similar to poetry: more are written than are actually published in commercial compilers. Hard economic reality is that many interesting optimizations have too narrow an audience to justify their cost in a general-purpose compiler, and custom compilers are too expensive to write. This has already happened accidentally for C++, albeit imperfectly, in the form of template metaprogramming.

    In a nutshell, writing optimisations is hard. Often, it’s too much of an engineering effort to implement tons of optimisations in a production-quality compiler: the gains you see simply aren’t worth the amount of effort. I won’t ramble on about this, since that’s the focus of Robinson’s paper, and it’s an enlightening read if you’re interested in that topic. (It’s also an enlightening read of you’re wondering what all the fuss is about with C++ templates.) Related to Robison’s paper is a talk given by Bill Pugh, titled “Is Code Optimization Research Relevant?”. One standout slide from that talk is this one:

    18 years from now, if we pull a Pentium III out of the deep freeze, apply our future compiler technology to SPECINT2000, and get an additional 2x speed improvement … I will be impressed/amazed.

    And Bill is pretty much right. But I won’t talk about whether research on optimisations is relevant or not — again, have a browse of Bill’s talk if you want to debate that with him.

    What I do want to talk about is that both Robinson’s paper and Pugh’s talk both hint at something which is never explicitly stated: the successful optimisations which have been done in the past few years are mostly domain-specific optimisations. These are optimisations which apply to only to a particular problem area, e.g. graphics (thus the word “domain” in domain-specific). Pugh gives the example that optimising matrix multiplication is quite successful: here, the domain that is being optimised is matrices, a well-defined and well-known area of maths. Robinson makes the point that C++ templates are successful because they can be used to create domain-specific optimisations, since they can be used to meta-program the compiler.

    One interesting example of a domain-specific optimisation are the vector units on a modern desktop system: AltiVec on the PowerPC, the PlayStation 2’s Emotion Engine, MMX/SSE on Intel x86s. While they’re not part of the compiler, they are a perfect example of just how well you can optimise code when you start having domain-specific constructs available (in this case, vector operations). Modern-day programmable graphics cards such as the latest NVidias and ATI Radeons are proof that native language (and hardware) support for vectors can reap massive speed benefits, and IBM’s new Cell CPU begs for properly vectorised code to get any decent performance out of it. The point of all this is: if your programming language natively supports expressing the problem domain you want to solve, you can really optimise the hell out of it.

    In the future, I hope that languages or compilers will enable us to easily write domain-specific optimisations, because language optimisation research — especially for imperative languages — simply aren’t going to give us that much of a speedup anymore. Look at the number of optimisation options in the gcc manpage and count how many of them will really give you a significant speedup. Beyond some basic, well-known optimisations, such as constant propagation and inlining, are the rest of those obscure optimisations really worthwhile? Is it worth it to put the engineering effort into those optimisations when you not only have to code them up, but also maintain them and make sure that they don’t cause optimised program to behave differently to non-optimised programs?

    I’d rather that all that engineering effort be put into making the language and compiler more extensible, so that libraries can come bundled with their own optimisations that can be added to the compiler. This potentially gives a much greater speed increase. In low-level languages such as C, this doesn’t make such a big difference because you’re programming so close to the hardware (though it certainly can sometimes: observe the success of C++ templates). High-level languages that enable the programmer to more closely express the problem domain in the language, such as Python and Haskell, have much more to gain.

  • Flash Player 8 public beta for Mac

    Macromedia’s Flash Player 8 has entered public beta testing. For Mac OS X folks, the most significant change is that, well, it finally doesn’t suck. Or, to put it in another way, it doesn’t feel like you’re running it on a 16Mhz 68000. Finally, enjoy the delights of Strong Bad and godskitchendigital without Flash grinding 100% of your CPU!

    With joy, I can scratch “write Safari plugin from open-source Flash implementation” off my TODO list …

    Update: Flash Player 8 is now out of the beta-testing phase. You can download the full version from Macromedia’s Flash download page.

  • Valgrind vs C and C++

    From an interview with Julian Seward, author of the superb Valgrind (as well as cacheprof, bzip2, and a co-author for the Glorious Glasgow Haskell Compiler: quite a remarkably productive fellow, huh?):

    Valgrind is loaded with assertion checks and internal sanity checkers which periodically inspect critical data structures. These are permanently enabled. I don’t care if 5 percent or even 10 percent of the total run-time is spent in these checksóautomated debugging is the way to go. As a result, Valgrind almost never segfaultsóinstead it emits some kind of a useful error message before dying. That’s something I’m rather proud of.

    Nice indeed; I wonder if programming languages of the future will be able to do automatic assertions of such data structures in their run-time systems. All you’d need is to annotate the structures with some simple boolean conditions, and the language can merrily check them whenever a garbage collection pass is executed (since programming languages of the future will all have automatic memory management, of course. Right? Helllllllo?)

    And, one more little quote (sorry, I couldn’t resist):

    Valgrind is only useful because C and C++ are such crappy programming languages.

    A-men to that, Haskell brother. Snigger snigger snigger …

  • Endianness

    From Apple’s Universal Binary Programming Guidelines:

    Note: The terms big-endian and little-endian come from Jonathan Swiftís eighteenth-century satire Gulliverís Travels. The subjects of the empire of Blefuscu were divided into two factions: those who ate eggs starting from the big end and those who ate eggs starting from the little end.

    Good to see Apple addressing the important questions in their guides.

  • godskitchendigital

    It’s been about a month now since I received an email about this, and I haven’t seen it mentioned anywhere else yet. If you’re into electronica/dance music and have been looking for a decent online music store to buy tracks from, check out godskitchendigital. The name is slightly misleading: they thankfully sell lots of stuff, not just God’s Kitchen CDs. Some interesting bits of information about the site:

    • They have a pretty good selection of electronica available, and carry quite a few tracks that aren’t available even at the iTunes music store. I managed to track down some Satoshi Tomiie tracks there that I haven’t seen anywhere else.
    • The music file quality is very impressive: pick and choose between 320k (LAME-encoded) MP3, 192k M4A (MPEG-4 audio), or, for another 50c, get the .WAV files instead (!). Note that they have a weird system where if you order a .WAV, you get shipped it on a CD rather than just downloading it. No, I don’t understand that either, but it’s nice to see they offer it as an option. For all the iPod owners, the 192k M4A files work perfectly fine in both iTunes + iPod.
    • 100% Flash interface. An interesting idea, though I’m sure it’s going to annoy the living hell out of Mac users, where the Flash plugin is unexplainably slow as molasses.
    • The big feature: no DRM. None. At all. If you download a 320k MP3, that’s exactly what you get: a 320k MP3, with properly formatted ID3 tags. No weirdass player you have to use, no iTunes music store-style M4P protected media. This is real nice indeed; I wonder what their legal department had to do to pull this one off.

    So, if you like electronica, go check it out. The all-Flash interface might not be that appealing (especially for Mac users), but the selection is good, the price is reasonable (especially for electronic music, where you tend to want singles/EPs more than albums) and the downloads are excellent quality. Oh yeah, and no DRM!

  • Ryan Gordon on Games Development

    Ryan Gordon, the lone gunman who’s responsible for porting quite a number of Wintendo games to Linux and Mac OS X, was interviewed recently. He had this to say about coding for games:

    None of the games are rewarding. Is that bad of me to say? Game development has nothing to do with quality and everything to do with shipping what you can get away with. That’s just how it is; I didn’t make this horrible world.

    Nothing unexpected, I guess. I wonder how many fields haven’t succumbed to the “it’s all a matter of what you can get away with” mantra of quasi-engineering? Writing academic papers, maybe? Nahh …

  • Creating Universal Binaries with GNU autotools

    If you’re a Unix hacker on Mac OS X, chances are you’ll be using a very large number of open-source projects that use GNU autotools: these are the projects that you typically compile with the ./configure script. It turns out that building a Mac OS X “Universal Binary” that runs on both PowerPC and Intel isn’t too hard at all, with the appropriate magic incantations to the ./configure script:

    CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \
    ./configure 

    Notes about this:

    • You will get a ton of warnings from the linker during the compile that the -syslibroot parameter was ignored since no linking was done. Just ignore them. (If you find out how to shut ld up, do email me!)
    • You may need to pass the --disable-dependency-tracking to ./configure, especially for projects that use GNU libtool. Yeah, this means you won’t get proper dependency tracking for your project, so (just like the Universal Binary Programming Guidelines suggests) I’d suggest you compile a universal binary only when you build a proper release package.

    Update: Note that this is merely a way to get autotools to build universal binaries. It definitely does not mean that your project will automagically work with on both PowerPC and x86. (In particular, you’ll have to change autoconf-supplied architecture and endian macros such as AC_C_BIGENDIAN: see the autoconf section of the Universal Binary Programming Guidelines for more details.)

    Update (2): It seems that this technique has officially been sanctioned by Apple: technical note TN2137 uses the exact CFLAGS that I’ve described here.

  • WWDC, San Francisco, Tuesday

    Not much news other than geek news again, I’m afraid. (I guess attending a conference from 9-6:30pm saps most of the day away!) The day was pretty uneventful, though I did sneak out to visit the Apple Store and CompUSA during one session time slot where I really wasn’t interested in anything that was running. You’d all be very proud of me: I picked up quite a few things at both places, but put them back down before I bought them. Fear my willpower.

    One thing I did forget to mention on Monday was one awesome demo at the end of the day. During the Graphics and Media State of the Union talk, a DJ was invited up on stage to show off some of the new graphics features on the Mac. A DJ showing off graphics, you say? He demonstrated completely live, real-time “sequencing” of visual compositions of movies, and had hooked up visual effects to effects he was running on the music. e.g. Mixing between two songs would blend two different videos together, and applying a grinding resonance filter to the music would make the screen warp and distort. It was all very, very cool stuff: something I wanted to do quite a number of years ago when I was actively doing mixing. Apple is really being a bad boy and inviting me back into some of my old habits! The DJ there is playing at a local San Francisco club on Thursday: I’ll so be there.

    At the end of the day, I ran into Ashley Butterworth, one of the other people at WWDC from my own Uni who I hadn’t met yet. We ended up going back to his room and randomly nattering about various geeky things, from Cocoa development to Objective-C vs Haskell. After that, I retired to my hotel room and flopped into bed, and that was that. Zzzz …

  • WWDC, San Francisco, Monday

    Geek news first: I guess all the geeks have heard the news that Apple’s switching to Intel x86 processors. I won’t offer any particular opinion of mine here (at least, not yet …), though I will warn that there are plenty of totally crackpot theories flying around. If you’re not a long-time Mac user (or possibly even a Mac developer), it’s far too easy to believe some outlandish theories that so-called respectable people are crying about. Probably the two most balanced and accurate things I’ve read so far about it is John Siracusa’s editorial, and (somewhat surprisingly) MacRumor’s Intel FAQ. I’m waiting for the hype to die down (and also to play with one of the Intel Mac developer systems) before I make any judgements.

    The rest of the day was pretty good too, though quite uneventful. The sessions that day were relatively interesting (yep, that means I actually attended all the sessions, aren’t I a good boy?), and I retired back to the Courtyard Marriott early since I’ll have plenty more times in my life to come back to San Francisco and party like it’s 1999. (Nothing to do with how I have plenty of work to do, email to check, and sleep to catch up on, I swear.) I seem to run into all the other Australian students when I’m least looking for them, too: no sign of them for almost the whole day, and then when I’m just about to leave, I run into about ten of them.

    All in all, a pretty cheap’n’cheerful day for me, with the small exception of that small announcement by Steve Jobs, of course. Sounds like fun, if you ask me! I’m all about fun.

  • San Francisco, Saturday and Sunday

    I left Los Angeles on Saturday afternoon (to the great sadness of my cousin’s kids: sorry Kevin and Kallista!) for the windy city of San Francisco. For the first time evar, LAX did not completely suck. Traveller’s tip: if you can, try catching an afternoon flight from LAX. There are no queues. Since I’m sure frequent LAX travellers will be stunned after reading that, let me repeat that: no queues. I had maybe five people in line before me at the check-in counter, exactly two people in line before me at security, and that was it. I was a very happy camper on that LAX visit.

    The flight itself was fine: a tiny little aircraft (three seats per row; one on the port side, two on the starboard side) with complementary beverages (I love Coke, Cokey Coke Coke, Here It Goes Down, Down In My Belly, Mmm Mmm Mmm). I arrived in San Francisco around 4:15pm; strangely enough, that was one hour ahead of schedule, but I ain’t complaining. By the time I arrived at the hotel (the Courtyard Marriott, for those interested) and settled in, it was about 6pm. The Moscone convention centre where WWDC was held was kinda very hard to miss (that’s the 2004 image, but 2005 is more-or-less the same), so I grabbed my fancy WWDC badge from there, and had dinner at the Sony Metreon building across the street. (What is it about the USA that gives rise to meal names such as “croissandwich” and “chickenshroom”?)

    After that, of course, I visited the Apple Store, which was a mere 5-minute walk away from the Sony Metreon building. As usual, I didn’t end up buying anything there, but it was just one of those mandatory things I had to do when you’re in a North American city. What was more intriguing was the Virgin Megastore that was right next to the Apple Store: after spending around half an hour there, I picked up a James Lavelle Global Underground mix CD (Barcelona #023, not the more popular Romania #026 one), and the new DJ Rap album named Bulletproof: we’ll see if the oldskool jungle and drum’n’bass girl is still as good as she was in the late 90s!

  • Los Angeles

    Shopping, shopping, shopping. That sums up L.A. pretty nicely for me: all those fun boutique shops that haven’t come to Australia yet (Banana Republic, Club Monaco, Zara, the Apple Store, Barnes and Nobles, and of course, Victoria’s Secret), and the one-and-only Fry’s Electronics, the biggest place I know of that has such a craphouse website.

    I guess Dom and Zoe were feeling like they needed a small break, so they actually came down to visit L.A. with me, which was awesome: I introduced the two to The Grove, the only place that I absolutely have to go to while I’m in Los Angeles. Sun, outdoors, great cafÈs and eateries (hello Cheesecake Factory!), movies, girls wearing tank tops, free wireless courtesy of an Apple Store … yep, my kinda place. I’m a tad (but only a tad) ashamed to say that I spent far too much money there for my own good. But hey, you only live once, right? (At least my credit card still works, which means that I haven’t used up my credit limit yet …)

    My relatives in Los Angeles took me to a totally awesome Japanese BBQ retaurant for dinner on Friday: think Korean BBQ, where you sit at a table with a fire-making stove thingy in the middle of the table, but Japanese intead. Of course, this may not have been the best decision after my cousin and I ate at Tony Roma’s for lunch and thus overstuffed ourselves with ribs, but somehow I still managed to scoff down the huge piles of beef and veges. Very, very yum; very, very good.

    All in all (much like this blog entry), my trip to Los Angeles was too short. It was great catching up with my cousins and being able to see Dom and Zoe for a bit longer, but really, one and a half days just isn’t that much time to do anything, particularly in a city as diverse as Los Angeles. Ahh well, considering that the Apple University Consortium scholarship more-or-less paid for the trip over here, I guess I can’t complain too much!

  • Sony PSP and Wipeout Pure

    One thing that made a serious dent into my ever-growing credit card debt while I was in Toronto was getting a Sony PSP, which I’m glad to say was money well-spent. Wipeout Pure absolutely rips arse. (Dom, I’m up to 21 gold medals now, go me!)

    There’s been plenty of good reviews on the PSP floating around on the Web, so I won’t add to them. All I will say about it is that Wipeout Pure is great: if you’re an oldskool Wipeout 2097/XL fan like myself and was a bit disappointed with the feel of Wipeout Fusion, Pure brings back all the goodness of 2097. At first I thought it would be a bit restricting playing on a small screen instead of a nice big TV or monitor, but the freedom the PSP gives you is a big win: I was playing the thing at the airport lounges, planes, and in bus shuttles. I wouldn’t use it as an iPod replacement simply because the iPod does that job a lot better (and as significantly longer battery life, too), plus the PSP isn’t quite small enough to fit into one’s pocket yet.

    So, at least if you were interested in the PSP for Wipeout Pure, go get one. Pure is the pinnacle of the Wipeout series so far.

  • Toronto, 27th May to 5th June

    First, apologies for the lack of posts. I’ve been a pretty busy boy, and the few hours I’ve had to myself, I’ve either had to do Uni work, CSIRO work, or sleep (usually in that order :).

    How do I sum up Toronto? It was one of the most busy and best one-week holidays I’ve had. For those of you who don’t know, the main reason I went there was to attend my cousin’s wedding. It was a traditional Hindu wedding (you can find some photos on my gallery site) and was absolutely wonderful. It was possibly the only wedding reception that I attended where we had two hours of speeches and dancing before dinner was served at nearly 10pm, and I wasn’t bored in the least. I got to meet and catch up with cousins who I haven’t seen in 15 years; you know when you meet up with some friends from your childhood and you’re so relieved and happy that you just click with them? That’s what it felt like — one of those natural highs that keeps you going for days, multiplied by every single one of them I met.

    Apart from meeting up with the relatives, I of course also visited Dom and Zoe, who are very much settled in and happy in Toronto. I got an excellent reminder of just how nice it is to live in the heart of a city: a 10-minute walk brings you to fantastic cafÈs, excellent shopping, and even the water (for those Australians who miss seeing the ocean glitter during a sunny day, like spoiled old me).

    Amongst other things, I met up with the esteemed Wolfgang Thaller, the Glasgow Haskell Compiler Mac maintainer, all-around far-too-clever person who knows a hell of a lot about everything, from World War I to Alpha Centauri to s Objective-C and C++ wizardry. Plus, Wolfgang didn’t even yell at me when I was half an hour late to meet him at the bus station (oops). Nice chap, he is! We ended up soaking up the sun on a rare sunny Toronto day at Harbourside, which is just south of CN Tower, drinking lattÈs, tea, and beer, and consuming a most excellent 600oz steak for dinner. (I still don’t get Canada’s units of measurement, by the way: make up your mind whether you use metric or imperial! Metric preferable.)

    The other surprise to come in Toronto was meeting up with an old friend of mine, Astrid Fauchon, for those of you who knew me 10 years ago and remember her. For those who want the details, feel free to email me, but I’m happy to say that it was really good to see her again, and that it gave closure to one of the only bits of my life that I felt never really wrapped up nicely.

    The most interesting bit of the trip was really feeling all the events happen together: I just had a great time. I was getting probably an average of 4-6 hours of sleep every day, and while I was a little stressed at times, I was really glad I was kept so bu. Catching up with cousins and old friends and just clicking with all of them felt wonderful, and drove the point home that friends and family really are the important things around. I’m really lucky to be able to see all of them again, and I guess it changed my perspective on things a little. A trip like this reminded me that making the trek halfway across the world to see friends and family is so much more than worth it, and all the nervousness of not seeing them in 15 years and worrying about whether you’ll get along well is often gone in the first few seconds. Here’s a toast to good mates!

    Update: I’ve posted some photos online of Toronto in general, Jennifer and Ashish’s wedding, and meeting up with my cousins.

  • Control-T

    Well, you learn something new every day. How many Unix veterans know about the Unix status character, Control-T?

  • Off to North America

    I’m off to North America for the next 2 weeks: Toronto, Los Angeles and San Francisco, in that order. If any readers are attending WWDC in San Francisco, drop me an email and let’s meet up!

  • coLinux

    We needed to set up some Annodex servers for demos this week, and our server software currently runs best on Linux. So, what to do if you’re using Windows machines which you can’t install Linux on for whatever reason, political or technical? Run Linux inside Windows, of course, via coLinux.

    coLinux is great. No, scratch that — coLinux is really great. Not only does it work, it works really well: it’s fast (I really don’t think I’ve ever seen a Debian system boot up in 2-3 seconds), it’s stable, and it even uses a pretty small amount of memory, since Linux servers tend to be on the trim side. A full-blown Linux installation for us with Apache serving multi-megabyte multimedia streams to multiple Windows clients was using up less than 30MB of Windows’s memory pool. Low fat.

    If you must have Windows on your desktop/laptop for whatever reason, but need Linux and are getting sick of doing the reboot dance just to switch OSs, give coLinux a whirl. And, if you want to get geek cred points, watch your friends’ jaws drop when they see X11 applications hosted on coLinux displaying in Cygwin/X; it’s pretty scary just how well it all works. Now, whither my coLinux for Mac OS X port (and flying car)?

  • The Mother of All Demos

    Ars Technica has an new article (that Slashdot seemed to miss) titled A History of the GUI. The first couple of pages of the article are great, but unfortunately it soon degenerates into screenshots of various GUIs that were introduced in the late 1980s.

    However, it does talk for nearly a full page about Doug Engelbart’s Mother of All Demos, given in 1968. As befits its name, Engelbart’s demo is one of the most important events to ever happen in the history of computing. It not only featured the first demonstration of the mouse, but also …

    featured hypertext linking, full-screen document editing, context-sensitive help, networked document collaboration, e-mail, instant messenging, even video conferencing!

    Hypertext linking and networked document collaboration guys, in 1968. We still don’t have a decent networked document collaboration system today, bar wikis (which aren’t real-time), and SubEthaEdit (which is great, but is limited to plaintext, and only works on the Mac). Engelbart was doing stuff 37 years ago that we still haven’t managed to conquer today.

    Anyway, to get to the point of this post, I really encourage you to check out the following two video recordings if you can make time for them — they’ve been lovingly digitized and preserved so that we can view them so many, many years later:

    They’re absolutely amazing. So damn amazing, this will probably be the one and only time I’ll tell you to download and install RealPlayer just so you can view Doug’s 1968 demo. You can feel history in the making as you watch the videos, I kid you not. To some extent, I almost despise Kernighan and Ritchie for spawning a culture and mindset that ultimately won, despite being more mediocre. Where would we be today if the world had embraced Smalltalk instead? Ah, time to stop being sentimental and crank out more C code, so I don’t look like such a starry-eyed kid again …