Tuesday, April 21, 2009

The genius behind Google’s web browser

About five miles outside Aarhus in Denmark – the country’s second- biggest city and the unofficial capital of Jutland – sits a converted farmhouse. Inside, in a large wood-floored space with vaulted ceilings – once part of the stables – a big brown leather sofa is positioned a few feet from a DVD player. From the outside, with its rough cobbles and small, recessed windows, the farmhouse still seems steeped in the past; yet this is the place where a key part of the future of the internet first took shape.
The drive from Copenhagen has taken longer than expected, and the farmhouse is hard to find. Lars Bak, its owner and a programming genius to his peers, made his home here for a reason – he doesn’t particularly want to be found. His Alsatian, Mickey, isn’t pleased to see us either: the dog has to be restrained before I even think about stepping out of the car.
It’s a cold December day in Denmark. We are further north than Edinburgh, but the sky is the uniform grey you see in the East Anglian fens. Bak seems uncomfortable as we shake hands, and I get the feeling that he wants me nowhere near the part of the farmhouse where he lives. Instead, we go into the vaulted room with the brown leather sofa. Nowadays it is a home cinema, but before that it was the office where Bak did his programming. The temperature is only slightly warmer than outside. I shiver as I take out my notebook. “So, what do you want to know?” Bak demands. We have four hours to go.
Lars Bak isn’t a household name – or at least this one isn’t. There’s a better-known Lars Bak in Denmark who’s a professional cyclist. But this Bak will have a more profound impact on your life than any sportsman. His most recent computer software program, called V8, is part of the Chrome web browser, a lynchpin in the business plan of Google.
Companies don’t really make money out of web browsers – the Explorers, Safaris and Firefoxes of the internet. So why is a new one so important to Google? Why invest time and effort in a free product that generates no income for the company behind it? The answer is not in the browser itself, but in the things it can access: namely, web-based software programs. These are a source of revenue for Google. The company has high hopes for Google Docs, for example, an online suite of programs that replicates many of the desktop programs in Microsoft’s Office – Word, Excel and PowerPoint – the tools of the modern business. But to deliver better versions of those programs and others over the internet, you need better browsers, ones that can handle the code that will be thrown at them. Many of us already use web-based programs: e-mail accounts such as Hotmail, Yahoo mail or Googlemail, for example. But they are relatively simple: their complexity pales in comparison with the programs stored on the average computer desktop.
The sophistication of web applications is increasing much faster than the corresponding power of the browsers. It’s like having lots of high-performance sports cars using rutted, bumpy roads. And yet no car manufacturer has ever invested in road building. That sort of move would, after all, benefit competitors equally, not to mention being massively expensive. Software development doesn’t cost as much but the competitor problem remains. But Google says it doesn’t mind: without an improvement in browser performance, the company argues, we all suffer.
The ability to access complex programs through the web is known as “cloud computing”, and Google isn’t the only one arguing that it’s the way ahead. Even Microsoft, the company synonymous with applications and operating systems located on the desktop, has talked about moving into “the cloud”. Steve Ballmer, Microsoft’s chief executive, has promised an “operating system that runs in the internet” – something he has dubbed “Windows Cloud”. But for cloud computing truly to take off, web browsers need to be better.
And that’s where Bak comes in. The Dane had first appeared on California’s Silicon Valley radars in 1991, when he joined Sun Microsystems and began building a reputation as one of the industry’s best programmers. He left to help start Animorphic Systems in 1994, which was then acquired by Sun. Once back at the company, Bak developed what would become Java HotSpot, an industry-standard computing system.
In early 2000, however, he left the hub of the computing world for Denmark, moving home for the quality of life, for his daughters, whom he wanted to attend Danish schools, and for his wellbeing – both mental and physical. The developer community in the US can be intense, the lifestyle unhealthy. When Bak returned to Denmark, he lost 20kg in two months (thanks to that very American phenomenon, the Atkins diet), and he hasn’t put it back on.
In 2002, Bak started a company, OOVM, which was based in Aarhus. In 2004, he sold it to a Swiss company, Esmertec, and stayed on for two years, helping integrate the two groups. When he left Esmertec, he wasn’t particularly looking for a new project: he had money to support himself and his family, and ways of keeping busy, including a plan to paint the farm. It would take a year, he reckoned.
Then came the call from Google. For Google, Bak was the obvious choice – he had the experience and talent to build the vital component for Chrome, its JavaScript engine. For Bak, working for Google was a “no-brainer”. “I don’t care about being a top-level manager. It’s about pushing the technological envelope.” Bak was ready for the work, but not for a return to California. In fact, that wasn’t even an option – despite Google’s notoriously worker-friendly offices, with gourmet food in the canteen and free haircuts on site. Instead, Bak would work from home – more than 5,000 miles and nine time zones from headquarters. Google was “prepared to trust me. They knew I wasn’t going to goof off.” The plan to redecorate the farm went on hold. “In the end,” he says, “I only had 14 days [for the painting]. I still have the paint.”
Bak at his home-turned-office on the Jutland peninsula, where he lives with his wife, children and pet Alsatian, Mickey
Bak started work, setting up an office in what is now the home cinema. The farmhouse is built around a courtyard, with the family home opposite the office. Every day, he walked across the cobbled stones to his office and started writing code. And at the end of each day, he walked back across the courtyard and left it all behind for the night. In between those strolls, he threw himself into building a browser that would increase the possibilities for others to do what he was engaged in: working from home, attached to the head office and all its tools only by the power of the internet.
Bak may be a computing genius, but he didn’t touch a computer until he was at university. “The computer room at high school was a dark and smelly place for nerds,” he says. “I played sport. Springboard diving – which is pretty cool, by the way. The nerdy stuff came late.”
In Outliers, Malcolm Gladwell’s 2008 exploration into the origins of talent and success, the author explores the idea that you need to practise for 10,000 hours to truly excel in your chosen field. Has Bak done his 10,000 hours, I ask? I can tell he thinks it’s irrelevant; he’s not interested. “I’m just glad I bloomed late,” he emphasises again, “rather than as a teen.”
Perhaps because of being a late-blooming nerd, Bak has never gone in for the caffeine-fuelled all-night coding sessions of programming legend. But that may also be due to the type of program Bak specialises in: the “virtual machine”, a concept originally explored in the 1970s by computer scientist Gerald Popek and his project partner Robert Goldberg. Virtual machines are what they sound like – computer-world versions of real machines, capable of running a single computer program or a whole range of programs. The Chrome browser falls into the latter category. V8, Bak’s virtual machine, compiles pieces of code common to different programs in order to cut down on duplication and allow web applications to run faster.
“Virtual machines are a strange beast,” says Bak. “There’s no perfect solution, instead you optimise for the ‘sweet spot’. There’s a lot of craftsmanship. It’s a long game, you can’t burn out.
“There’s a constant workload,” he adds, “so I always stop for dinner. You can have a normal life.” For Bak this means family and privacy. The issue of work/life balance crops up again and again in conversation – and though he’s not anti-American, he clearly prefers the Danish way of life. “In the US, there is an aggressiveness, the extra level of belief in yourself that is needed. The European way is less aggressive. But in the US, you can get promoted and stay in touch with the technical side. In Europe, you turn into a paper manager. It’s hard to get your fingers dirty.” By working in Denmark for Google, Bak was aiming for the best of both worlds.
Bak called his project V8 as a joke: the V8 engine is what you might find mounted underneath the chrome-finished bonnet of a car – “and Google is cool like that – whatever the project working name is, that’s what it’s called. There’s no intervention by marketing to give it some name.”
From day one on the Google project, Bak enlisted the help of one of his former students, Kasper Lund. Lund is a smaller, younger, more outgoing character, and he agreed to come to the farmhouse to work. He also served another function – keeping Bak entertained. Lund and his competitive boss got into the habit of interspersing work with battles of ping pong and Wii tennis. Who wins at the former, I wonder; Bak responds: “Ask Kasper.” Oh, so Kasper then? “No.” Later, he lets slip: “He’s a better player, but I win.” Their relationship has changed from teacher-student to something closer to peers, but not quite; a friend describes it as wizard and apprentice.
Many computer programs are built using previous versions, or related code, but V8 was started from scratch – a blank slate. When I meet Lund later in my Denmark trip, he takes great delight in underscoring this fact: “It’s the purest form of coding there is.” Bak clearly agrees – as Lund speaks, he can’t stop smiling.
As V8 grew and the project expanded, Bak and Lund moved from coding in the farmhouse to an office at the university in Aarhus where Bak teaches. It’s a 30-minute cycle ride away, and the commute-as-exercise fits nicely into Bak’s philosophy of balancing work and life.
Battle of the browsers
The internet has seen the creation of many browsers in the course of its short existence, but the main story has only four protagonists: Netscape Navigator, Internet Explorer, Firefox and Chrome.
In terms of popular usage, Netscape Navigator was the first. Everyone used Navigator – in part because there weren’t any serious alternatives – and it worked fine. Then came Microsoft’s Internet Explorer (IE), which was integrated into the company’s dominant Windows operating system, driving its growth. By 1998, IE had overtaken Netscape in terms of usage.
An antitrust suit was filed against Microsoft, but by then it was too late. IE controlled over 90 per cent market share and, despite the legal wrangling, to this day it is still shipped as the default browser on most of the world’s PCs. Netscape was bought by AOL, and after much dithering was taken out of development in 2007.
The story would end there but for the “open-source” community. Open-source software was (and to an extent still is) the scourge of Microsoft. Chief executive Steve Ballmer once referred to the Linux open-source operating system as a “cancer”. Software like this is constantly improved by a community of software developers who work on the project for little or nothing. The fruits of their labour are usually distributed free. In 1998, Netscape turned the code of Navigator into an open-source project called Mozilla – and out of that grew Firefox.
Firefox has taken 20 per cent of IE’s market share, and is still growing. Many of its features – such as tabbed browsing and accessibility settings – were available earlier on other products, such as the browser Opera, but thanks to word-of-mouth, good marketing and Firefox’s appeal to more technically literate users, it has grown to be IE’s biggest challenger. And because it is open-source, third-party developers can extend Firefox’s capabilities by building new applications, making it an even more powerful tool.
The browser market was looking like a two-horse race between IE and Firefox, with an honourable mention for the Mac-based Safari, until Google launched Chrome in 2008.
Chrome still has only about 1 per cent of the browser share but that will grow. With Lars Bak’s V8 engine, Chrome is incredibly quick. The browser uses a lot of open-source code and open standards, but has also introduced some important innovations, such as its use of independent tabs. This sounds dull, but it’s critical. Here’s why: normally, running several web-based applications through the browser can lead to a crash. And when one browser tab crashes, the whole program needs to be restarted, losing any work or activity going on in other tabs.
Chrome runs in a way that means any browser crash is limited to just that tab, so that if you are composing an e-mail in one screen, and a video crashes in another, the e-mail you are writing is not affected. You can close the crashed tab and continue working. Making the browser operate in this way –like the desktop – is crucial for the future of web applications.
Of course, the speed at which Chrome functions is also vital. For web-based applications to be a success, they need to respond quickly, or users will become frustrated. Speed, stability, security – these are all critical areas for the future of everything we do online. And the browser is the gateway.
The office at the university may be a long way from head office, the Mountain View Googleplex in California, but it is still recognisably Google. Colourful chairs and beanbags are scattered through the entrance area, which leads on to two main rooms where up to a dozen people work. But there’s no canteen, just a kitchen with a nut dispenser and a fridge full of bottled water and Diet Coke. Bak has introduced a no-sugar policy: “It’s not no sugar as such – you get natural sugar from fruit. But no chocolate, no obvious candy.”
It is testament to the loyalty in the office that everyone has signed up to this regime. Everyone seems to cycle, too, and to leave work around 5pm. “We start early, and when you get tired, there’s no point doing any more so we go home,” says Lund. It’s almost a word-for-word description of the working life that Bak described to me two hours earlier at his farm. And it’s convincing. But what about communication with the gang at Google? When Bak, Lund and crew leave the office at 5pm Aarhus time, it is still only 9am in San Francisco. Are they taking advantage of Silicon Valley’s tendency to work around the clock, or is it really not necessary to be in touch with headquarters? Lund says that overnight e-mailing works fine for most situations. The day of my visit, Bak is due to participate in a conference call after the rest of the office has gone home. He tries to play down his feelings about this, but it’s obvious he would rather not have to take part.
Programming can be a very solitary pursuit. Although Bak and Lund work in close collaboration, there is still a sense of isolation from the rest of the world. You write code, test it, refine it, write more, and just keep going until something works like you need it to. For Bak, it’s very simple, and very secluded. And then, for some reason, the rest of the world wants in – to know about you and your work.
Bak values his privacy. He is clearly uncomfortable having his photo taken at his home. But when I point out that typing his name into the Google search engine brings up page after page related to his cyclist namesake, and suggest that this must shield him from undue attention, he shrugs. “I’m too old to care about what people say about me.”
What does annoy him is people misunderstanding his work – or “the technology”, as he puts it. One example he gives is an article about him in which the journalist confuses Java and JavaScript (the former is a stand-alone program which can be accessed online, the latter is a browser-dependent scripting language). We both laugh at the mistake, and for a moment I feel like Bak and I have clicked.
The world found out about Chrome in an unusual way. The story broke via a specially commissioned comic that was sent out early by Google – apparently in error. There was a PR scramble to shore up the news, involving hastily arranged conference calls and a blog post explaining what had happened, followed by a press conference and demonstrations of the product at the Googleplex.
In the excitement and debate about why Google was releasing a new browser, and whether the leak was deliberate, few people really looked carefully at the comic. Despite being created by Scott McCloud (something of a legend in the world of comics), it’s tough going. There is talk of Java Script (not Java!), CPU and memory leaks – details of computing that most people don’t want to know. But the comic does show the thinking behind many of the features of Chrome, and the way separate teams set about solving each part of the puzzle. Bak and Lund first appear briefly on page two, but it’s around a third of the way through, on page 13, that we are properly introduced to “The V8 team in Denmark”, who explain the development of this “Virtual Machine”. There’s no mention of why V8 was built a continent and an ocean from Google headquarters.
Lund and Bak like the comic. It’s framed in its entirety on the walls of the Aarhus office. “At first, I thought it was a strange idea,” says Bak. “But then I realised it’s brilliant. Compared to the usual white paper you get, it’s 10 times better. People thought it was funny.”
I suspect one reason they both like it is also that it treats Bak and Lund as equals – although Lund is characterised as physically hulking compared with Bak. “It made me look like a 15-year-old boy,” says Bak. He allows himself to smile.
Chrome attracted more than 10 million users in its first 100 days. Although that’s an impressive number, it still only translates into about 1 per cent of browser usage online. It will be a while before it can compete with Firefox, Internet Explorer and others. In December last year, Google announced that Chrome was now out of its development, or Beta, phase and is ready to be shipped as a pre-installed browser on some PCs. This could rapidly increase the number of users. Moreover, the European Commission’s antitrust battle with Microsoft over, among other things, how its own browser, Internet Explorer, is integrated into its Windows operating system may give competitors such as Google a chance to claim ground.
Legislation and market share aside, the technical challenge has been laid down. “Microsoft will have to build something better than V8,” Bak says. Most tech watchers doubt that they will manage to any time soon: in tests, V8 processes JavaScript 56 times faster than the most used version of Internet Explorer. “We started with high benchmarks,” says Bak. Then he adds, modestly: “It’s been an OK success.”
Even if the Chrome comic didn’t launch Bak into instant stardom, his profile has been rising over the past few months. More and more people want to know about the man behind Chrome. He would rather be writing virtual machines than running the Aarhus office, and he’d rather be doing almost anything than talking to journalists, but that’s part of the game and he accepts it. That said, he’s still a long way off the heights of Facebook founder Mark Zuckerberg or Bill Gates. Did he get any fan mail after the comic came out, I ask? He laughs at the idea: “No. But I didn’t get any hate mail either.”
Rob Minto is the FT’s interactive editor

No comments:


Blog Widget by LinkWithin