The best kittens, technology, and video games blog in the world.

Monday, August 20, 2007

Dynamically typed road traffic

Cloud the kitten by taw (public domain)I moved to London a few weeks ago. I live at 82 Mildmay Road, Islington, London, N1 4NG, I code Ruby on Rails at Trampoline Systems, I have a beautiful kitten girl Cloud (the blue-eyed white furry creature above), and I use a MacBook.

Let's start from the culture shock part. The British start working at saner hours than Polish, somewhere between 9:30 and 12:00 instead of 7:00 to 8:00. They start their day by eating "English breakfast", which consists of fried eggs, oversalted beacon, sausage made of 50% recycled plastic bottles and 50% soy protein isolate (and definitely no meat), baked beans, half-cooked mushrooms, black pudding (no idea what it is made of), tomatoes prepared in a way that makes them lose the tomato taste, semi-sweet toasts, and a few other weird things. The whole thing is huge, hard to digest, and completely unsuitable for a breakfast. At least that was what I thought at first - now I kinda like eggs, baked beans and semi-sweat toasts.

The next culture shock was in moving around. Pedestrians don't care about traffic lights. On the continent it's expected for people to wait till the light is green before crossing the street. In London nobody does so - people just check if the road is free and if it is they go. As most streets in the city center seem to have pedestrian islands in the middle, it is enough if just a single lane is free from traffic. At first I thought it will certainly lead to huge increase in traffic accidents, but it seems the British roads are actually safer than most of the continent. That's lot like static versus dynamic typing - instead of statically checking "type" of road (RedRoad or GreenRoad) you check if it responds correctly to :pedestrian message and cross if to does. Much more efficient after some getting used to.

Switching from Ubuntu Linux to Mac was weird. Macs have one big advantage over Linuxes - TextMate. As far as I can tell it's the only advantage. Other than that:

  • They lack single package management system like apt-get. One needs to use a mix of fink, port, gems, binary packages, hand-compiled packages, and I still couldn't install Amarok.
  • No copy & paste by select and middle-click is annoying.
  • Safari sucks almost as much as IE4, Macs are pretty much unusable without Firefox.
  • Macs are not a very good Unix. Packages are outdated and unupgradable (Ruby 1.8.2 from 2004 on a laptop sold in 2007 - wtf?). Basic utilities like find and cp don't accept standard GNU flags. Locale is very annoyingly not UTF-8 without some work. There's no good terminal (neither the builtin one nor iTerm are anywhere near konsole). Filesystem is case-insensitive (yuck). There's no strace and debugging options are limited compared to Linux.
  • There's no good music player. iTunes is a stinky pile of donkey shit compared to the most awesome Amarok.
  • There's no good iPod client. iTunes sucks compared to even gtkpod. iTunes sucks compared to everything.
  • MacBook screen is very small. MacBook trackpad is horrible (not unlike trackpads in all other laptops). Control vs Command distinction is annoying even after a few weeks (Control-D but Command-C, huh ?).
Did I mention TextMate ? The good things are TextMate, TextMate, magsafe connector for power supply, and TextMate. I've tried pretty much every Linux text editor out there and
TextMate is far better than any of them. Maybe even good enough to make me say on Mac.


Chris said...

As far as debugging goes, you probably want to look at the old-school trio (ktrace, fs_usage, sc_usage). ktrace gets about the same amount of data as strace but the interface is somewhat different and you get to do more filtering on your own (dtrace will be in 10.5 so this is of legacy value).

Beyond that, you want to use CHUD which gives you a rather nice system profiler which can be customized fairly extensively.

taw said...

Chris: ktrace is better than nothing, but ptrace-based tracing like strace is much more convenient and powerful.

Any hints on good terminals/music players/iPor clients for Mac or good text editors for Linux ?

Greg said...

Black pudding is a type of blood sausage. A lot of people are squeamish about it! Not as gross an idea as white pudding though.
Welcome to the UK anyway.

Luntain said...

I am here for 3 weeks and haven't yet even seen an english breakfest :).

The odd thing about traffic lights in UK is that when there is green for pedestrians on crossroads, it is green on both perpendicular streets. That means that no car can go through crossroads when pedenstrains have green! In Poland and Germany it is not the case. Green light is for directions (street and sidewalks) in turns. It is considerably safe to cross when cars go on parallel street to your sidewalk, and people in London do just that (and sometimes more :)). I think this is the main reason why people ignore traffic lights here. That system is just inefficient.

Arto Bendiken said...

I know where you're coming from, with regards to the Mac switch. I still miss Ubuntu periodically.

The Mac package management situation is, thankfully, not quite as bad as you think. Stick with MacPorts exclusively and you can't go wrong. The package selection is almost as good as on a Linux distro. What's more, it's really easy to roll your own package if you need to (by creating a simple Portfile).

Ignore all the old crap preshipped with OS X, and just install them from MacPorts to have sane, newer versions (that means Ruby, Apache, etc). It all goes into /opt/local and you can just delete that directory at any time to get rid of MacPorts, should you wish.

Note that you can get a more GNU-like userland by installing the coreutils package (plus some others, I don't recall then names) from MacPorts.

sjs said...

Using my MacBook has forced me into the habit of specifying flags before arguments on the command line. It can take some getting used to for a Linux guy, but at least it's similar to the other BSDs.

Command being where it is quite comfortable imo. I think you'll come to like it with time. Cmd-x/c/v/a/etc means that Ctrl-* is free for command line use. I dislike Ctrl-Shift-x/c/v in Terminal (Xfce4's term).

The only editor I have really learned to like on Linux is Emacs. I still use TextMate on my Mac though, it really is a fantastic editor. I'm kind of surprised that you're not a fan of some version of Emacs, what with Rlisp...

Cute kitten! :)

taw said...

sjs: Emacs is not that bad at editing, its main problem is that it assumes that the user will spend almost all of their time in a single Emacs window. I never code like that - I'm using multiple tabbed terminals, and multiple editor windows which I open and close as I wish. Emacs just completely doesn't fit that.

taw said...

Arto Bendiken: I'm used to Debian/Ubuntu and from my point of view Mac package management situation is not even remotely Linux-like. For example port doesn't have amarok, while fink has amarok but it doesn't build. Neither port nor fink ettercap builds. Many other packages I tried were missing or broken too, I think I managed to install less than half of the packages I tried. Horrible, horrible, horrible.

Alexander said...

> They lack single package management system
> like apt-get. One needs to use a mix of fink,
> port, gems, binary packages, hand-compiled
> packages, and I still couldn't install Amarok.

MacPorts is sufficient. Once you've got MacPorts, you don't need Fink, nor do you need to hand-compile packages. Do "port edit joe" (to pick a simple port) to see -- most of it is actually boilerplate data.

Creating a portfile is usually just as easy as downloading and compiling by hand, and it's certainly more rewarding, since by doing this you reap every benefit of the package system: MacPorts manages the file system for you, so you get easy uninstall and upgrade built in, "port provides", package repositories (see /opt/local/etc/macports/sources.conf), variants, etc.

It's true, though, that MacOS X would benefit from an Apple-supported, system-wide package system that encompassed both apps and Unixy software. Given the ease with which you install most Mac apps, though (download .dmg, drag into Applications), nobody is actually suffering right now.

Gems exist even in the APT landscape, because many gems do not get packaged, ever. MacPorts has many of the important ones -- Rails, Mongrel, mime-types, the PostgreSQL bindings, RMail, RedCloth, hpricot, etc., so I rarely find the need to install a gem.

As for Amarok, it's a KDE app, not a Mac app. Why are you so surprised?

Mathias Gaunard said...

As for traffic and stuff, this is not at all specific to UK. It's the case in most of non-scandinavian and non-germanic europe.

As for the working hours, I would have assumed that this is the standard in the whole western europe.

Divide said...

Black pudding -- it's made of people! (Actually pork blood, AFAIR. Disgusting all the same.)

taw said...

That reminds me:

Fry: "My God! What if the secret ingredient ... is people!"
Leela: "No. There's already a soda like that. Soylent Cola."
Fry: "Oh. How is it?"
Leela: "It varies from person to person."

divide said...

It's been ages since I've last watched Futurama... but yeah, lots of fun and obscure references.

Both this quote and my remark are references to Soylent Green -- an amusing 70s (or so) SF flick; but I assume you already know that.

Anonymous said...

If OS X doesn't suit your way of doing things, you're trying to do things that are unsuited for doing on the Mac.

For instance, installing new programs. Programs are notorious hacker tools and virus infection vectors. Macs weren't intended to be used as terrorist hacking tools. If you can't get your things done using Apple's programs, you're doing it wrong.

The reason for no GNU flags and no UTF-8 is because OS X is built on the American BSD userland, which is unsuited for your anti-American (dare i say communist) ways. Learn to speak English (and not Britnglish, there's a reason it's called ASCII.)

If you don't love your Mac, you're obviously dead inside. How can you not love the flashy graphics designed to keep you complacent for long enough to be unable to return your Mac to the Apple store?

And besides, using free software is stealing from hard-working real programmers. Haven't you ever thought of the lives you're ruining every time you run ssh or gcc?