[元アップルプログラマー Don Melton:image]
少し前に話題になった元アップルプログラマーの Safari 開発秘話が大変オモシロい。
Don Melton は Scott Forstall の下で極秘に Safari 開発に当たった責任者だった。
Don Melton: “Keeping Safari a secret“: 03 January 2013
* * *
本名を名乗らなかった Safari
日夜 Safari の開発をやっていた頃、まだ Safari という名前で呼ばれるようになるずっと以前のことだが、それはマイクロソフトの Internet Explorer のふりをしていたものだ。そう、1998 年以来 Mac OS にバンドルされていた Internet Explorer for Mac のことだ。Safari 発表の半年前のころには、Mozilla ブラウザのふりをし始めた。
For much of the time we spent developing Safari — long before it was called by that name — it pretended to be Microsoft Internet Explorer. Specifically, Internet Explorer for Mac, which Apple had provided with the OS since 1998. Less than six months before Safari debuted, it started pretending to be a Mozilla browser.
* * *
なぜそんなことを?
なぜそんなことをしたのかって? コードも動作も非常に異なる Safari をどうやって偽ることができたのかって?
Why did we do this? And how did we make Safari pretend to be these browsers when its code and behavior were so different?
チームを編成してそんなブラウザを作成するよう Scott Forstall に命じられたせいだけではない。このプロジェクト全体を極秘にしておかなければならなかったのだ。そのために、オリジナルチームの大部分を雇うのに、仕事を始めるまでは何をやるのか教えてやるワケにもいかないというひどく込み入った状態で、管理上の難問題だったのだが、その話は別の機会に譲るとしよう。
Not only was I tasked by Scott Forstall with building a browser and building a team to build that browser, I had to keep the whole damn project a secret. Which, by the way, really complicated the shit out of hiring most of the original team since I couldn’t tell them what they were working on until they took the job. Talk about your management challenges. But that’s another story.
* * *
極秘任務
そう、極秘だった。かといって、Jony Ive のデザイングループが当時そうだったように、あるいはまた数年後には iPhone チームがそうなったように、肉体的にも閉じ込められていたワケではなかった。しかし名指しで訪ねてこない限り、われわれをキャンパスで見つけるのは不可能だった。できたとしても、われわれの誰かが実際に Safari を動かしている現場 — 通常密室でやっていたが — を見ない限り、何をやっているのか分からなかっただろう。
So, secrecy. We weren’t under physical lockdown like Jony Ive’s design group was then, or like the iPhone team would be years later. But unless you knew who to look for, you were never going to find us on campus. And if you did, it’s unlikely you could tell what we were doing unless you caught one of us actually running Safari — something we usually did with our office doors closed.
* * *
チームの心配はしなかった
ウワサになることについては心配していなかった。Forstall が私を信頼していたからだ。その点は — 他にもいろいろあるが — 彼が偉大なボスだった証拠だ。それに私も自分のチームを信頼していた。さもなくばそもそも彼らを雇ったりはしなかっただろう。われわれの誰も、そしてアップル内部のベータテスターたちの誰も、密告などしなかった。ベータテスターの数は非常に限られていたが、みな非の打ちどころがなかった。
I wasn’t worried about talk either. Forstall certainly trusted me – that’s one of the many things that made him a great boss. And I trusted my team — otherwise I wouldn’t have hired them. None of us nor any of the internal beta testers at Apple were going to snitch. There were too damn few beta testers, but they were above reproach.
* * *
何が心配だったか
当時はツィッターもなかったし、フェイスブックもなかった。仕事内容をブログに書くようなバカはアップルにはいなかった。それじゃいったい何を心配したのかって?
Twitter and Facebook didn’t exist then. Nobody at Apple was stupid enough to blog about work, so what was I worried about?
サーバーのログだ。死ぬほどそれが怖かった。
Server logs. They scared the hell out of me.
* * *
ユーザーエージェント文字列
ウェブブラウザがウェブサーバーからページを読み込むとき、ブラウザは ID としてサーバーに対してユーザーエージェント文字列(user agent string)を明らかにする。基本的には名前、バージョン、プラットフォームなどのことだ。同時にまたブラウザはサーバーに IP アドレスも手渡すので、サーバーはどこにページを送ればいいのか分かるワケだ。このやり取りのおかげでウェブは動くことができ、さらに誰がどこで、どのブラウザを使っているかをサーバーに教えることができるのだ。
When a Web browser fetches a page from a Web server, the browser identifies itself to that server with a user agent string — basically its name, version, platform, etc. The browser also gives the server an IP address so the server knows where to return the page. This exchange not only makes the Web work, it also allows the server to tell who is using what browser and where they’re using it.
何をいいたいのか分かるだろう? でもそれだけではない・・・
You can see where this is going, right? But wait, there’s more…
* * *
固定 IP アドレス
1990 年当時、先見の明のあるアップルの IT 担当者は、アップルのために IP アドレスの Class A ネットワーク全体を確保しておいた。そうなのだ、アップルは 16,777,216 個の固定 IP アドレス(static IP addresses)を確保していた。そしてこれに属するアドレスは — 今では「/8 block」と呼ばれているが — すべて同じ数字で始まるのだ。アップルの場合、それは 17 だった。
Back around 1990, some forward-thinking IT person secured for Apple an entire Class A network of IP addresses. That’s right, Apple has 16,777,216 static IP addresses. And because all of these addresses belong together — in what’s now called a “/8 block” — every one of them starts with the same number. In Apple’s case, the number is 17.
IP アドレスが 17.149.160.49 なら、それはアップルだ。17.1.2.3 もアップルだし、17.18.19.20 もアップル、17.253.254.255 もアップルというワケ。クソッ!
IP address 17.149.160.49? That’s Apple. 17.1.2.3? Yes, Apple. 17.18.19.20? Also, Apple. 17.253.254.255? Apple, dammit!
すっかり騙されていた。
I was so screwed.
* * *
CIA 並みのプロジェクト
みんなが忠誠を宣誓をして CIA の非合法活動なみに密かにこのプロジェクトを遂行していたけれど、アップルキャンパスのネットワークを利用するときに Safari を「Safari」という名前で使うワケにはいかなかった。さもないと、ウェブサーバーの管理者がどこかでログファイルをスキャンして、ユーザーエージェント文字列と発信元の IP アドレスを突き合わせるかもしれないのだ。そうなれば 2003 年1月7日の Macworld で Steve Jobs が発表しようとしているビッグサプライズがダメになってしまう。ひいては自分もそうなるということなのだ!
Even though we operated the project like some CIA black op — with loyalty oaths and all — we couldn’t let Safari be “Safari” when we used it on the Apple campus network. Otherwise, some Web server administrator somewhere might be scanning their log files and notice the connection between user agent string and IP address origin. Then the big surprise Steve Jobs wanted to unveil at Macworld on January 7, 2003, would be shot. And, likely, so would I.
* * *
自分が考案したユーザーエージェント文字列
そこでわれわれは自分が巧く考案した Safari のユーザーエージェント文字列を隠したのだ。「自分が考案した」という意味は、それが実際に Safari および WebKit の数少ないコードのひとつであり、1)それを考案したのは自分だと主張でき、2)今でもソースコードに残っているからだ。残りのハッキングについては自分のエンジニアチームがすべて削除ないしは更新してしまった。実に頭のいい連中を雇ったものだよ。
So we hid my cleverly designed Safari user agent string whenever we were at Apple. And I say “my” because that’s actually one of the few pieces of code in Safari and WebKit that 1) I can claim to have designed and 2) is still actually in the source. Thank God my engineering team removed or refactored all my other hacks. I hired good people.
* * *
今でもその名残り
アップルキャンパスのネットワークを使うとき以外、すなわち自宅ではいつも、Safari をいじって本当のユーザーエージェント文字列を有効にしていた。互換性テストのためにそうせざるを得なかったのだ。文字列をいじることで当時のウェブサイトと最大限の互換性を確保することができたのだ。Safari のユーザーエージェント文字列には今でも余分な情報 — KHTML、Gecko など他のブラウザエンジンの名前 — が残っているのはそういうワケだ。
Whenever we were off the Apple campus network, e.g. in our homes, we modified Safari to enable its real user agent string. And we had to do this for compatibility testing. That allowed me to tweak the string for maximum compatibility with the websites of that time. Which explains why the Safari user agent string has so much extra information in it, e.g. KHTML, like Gecko — the names of other browser engines.
* * *
ちょうど10年前の今ごろ
真の Safari ユーザーエージェント文字列を無効にしたまま出荷するワケにはいかなかったので、次善の策として、一定の日時が来たら自動的に有効になる方法をとった。ちょうど10年前の今ごろ、発表の数日前のこと、ついに Safari は世を忍ぶ隠れ家から堂々と自分を名乗れるスポットライトの下へ出て行ったのだった。
We couldn’t ship with the real Safari user agent string disabled, but we came up with the next best thing — automatically enabling it after a certain date. Just about this time 10 years ago, days before it was to debut, Safari went from hiding its light under a bushel to being proud of who it really was.
私は発表前の数日間、インターネットのサーバーログをくまなく探しては心配で眠れぬ夜を過ごしたものだった。
And I spent the days before that debut nervous and losing sleep as I combed the Internet for server logs.
* * *
敵を欺くにはまず味方からというワケだろう。
ジョブズ時代の開発秘話だ。
Don Melton については彼をゲストに迎えたポッドキャストがメチャオモシロい。
Forstall のインタビューを受けたときや開発当時の様子のほか、あまり耳にすることのないアップルプログラマーの名前が続出する・・・
★ →[原文を見る:Original Text]
Read Full Post »