Wake Up and Smell the Wasabi
Five and a half years ago, Joel Spolsky announced that they had indeed graduated writing FogBugz from VBScript to an in-house language defined as a superset of VBScript called Wasabi, reimplemented using the semantics that suited them, and that they did this instead of porting the code to, say, Ruby. (The day after, the rest of the Internet announced that Joel Spolsky had indeed graduated from occasionally correct to stark raving mad. That link is from Jeff Atwood, who would naturally go on to start a company with Joel.)
Two years ago, Facebook announced that they had indeed been working on switching over from whatever standard-ish (but likely tuned) PHP machinery they were using to their own HipHop cross-compiler, which would spit out C++ that would then be compiled and work faster.
Joel may well have been right in that Wasabi, having been written, could smooth the transition to a non-caveman language by introducing smarter features, not breaking the current code base and finally allowing a high-fidelity cross-compile to another language where it may be kept from there on out. (I have no idea how they got there, but I know that they are now on C# and ASP.NET. And let’s ignore for a minute the labor that went into maintaining the compiler, training the programmers and so on.)
But what to make of HipHop? Google has never had problems with scaling because it started out focused on solving a scaling problem and the culture never left them. For the first few years of Google’s existence, being able to fit, index and work over many more pages than any other search engine was part of Google’s advantage.
Facebook might not be able to rewrite everything over the weekend, but they pride themselves on rapid iteration. Surely they could figure out how to map everything onto a new architecture with different tools (possibly by inventing a new language, maybe channeling people like Andrei Alexandrescu) and perform the migration over a non-disastrous period of time.
Eevee is right: PHP is a monster of a bad language. (For the rest of my life, barring something even better, I will carry around that link to use when people ask why I hate PHP. A third of the text could be slander and a third out of date and it would still be enough to keep me away. It may run the Internet, but it does so in spite of itself, and not because of itself.) It doesn’t matter to Facebook’s customers that Facebook is written in a sub-standard language, but it matters to Facebook that Facebook is written in a sub-standard language because it gates their productivity and multiplies their maintenance and support.
It seems that half of my posts here end with hopes that there will be a new perfect language which will solve everything. While I would love that, I don’t think it’s coming.
What I do see are opportunities. Rather, thanks to Bret Victor, I see pain and suffering where needs are not being met. There’s a place for a few languages to be excellent in their field. (The most vivid image is of a proto-C# to replace C++ that would be efficient and not assume you were the world’s foremost expert on memory management, but actively take care of it itself. I don’t just mean garbage collection (or maybe not at all), but a virtual machine or JIT that would recognize patterns and say “hey, I know how to implement this pattern super effectively!”, beyond just solving general cases.)
When companies do things like Wasabi or HipHop, it’s a sign of something more. It is the first inkling of a desire to not accept the limitations of what they have before them. At their best, it’s also a sign that they don’t accept the limitations of any other method; at their worst, it means that they are so set in their ways or so cheap that seeking out something else doesn’t turn into an option no matter what. Sometimes, you can’t tell except by doing it and looking back.
This is not a scale from point Ew to point Ah, and the pot of gold at the end is not “inventing a new language”. But being willing to transcend every readily available option is the spark that is necessary to change the world, improve the state of the art and make life better. I wish we’d do it more often.