Friday 30 March 2012

A First Visit to the United States, 1976

In 1975 while working at Digital Equipment Corporation (DEC) I wrote a new terminal driver for the IAS timesharing system for the PDP-11. The 11 had an amazing variety of hardware interfaces for communicating with terminals (and for everything else too). In those days, hardware really was hardware, and device drivers messed with registers containing actual bits stored in actual transistors. Now of course, device drivers are just sending neatly packaged messages to other computers.

But enough of that. In our lab in England, we had only a few of the multifarious bits of hardware that I needed to test against - there was the DC11, the DH11, the DJ11, the DL11 (which came in at least five different varieties) and a brand new one, the DZ11. They were all completely different, having practically nothing in common. So, once I'd got all the basic functionality working, I had to go somewhere that had all of these. That meant only one place - Maynard, Massachusets, home to "The Mill", and the company's headquarters. And so, in early June 1976, I set off on my first ever business trip, my first journey outside Europe, and my first ride on a jet plane.

Every journey starts with a single step. My first step was the bus, which conveniently stopped outside the house where I lived, to Reading station, where I could catch another bus to the airport. I had a huge suitcase, containing several copies of the vital tapes with my code on - no Internet in those days, nor even Decnet, so if anything happened to the tapes, my trip would be pointless. As I boarded the bus, the driver said, "Looks like you're off on a long journey then." He seemed quite taken aback when I said, "Yes, I'm going to America".

The flight was on a TWA Boeing 707, three seats either side of a central aisle and a total of about 140 seats. First class, for the privileged few (not me) was like US domestic first class now - wider seats with a bit more recline, about the same as today's Premium Economy, though with better food. There were just two flights available per day, my TWA flight and British Airways on a VC10. A quick look at Expedia now shows seven wide-body flights per day (if I've correctly navigated the confusing mess of code-shares), which means over 20 times the capacity.

But before that, I had to navigate Heathrow Terminal 3. (It's a slightly embarrassing sign of age that I knew Heathrow before Terminal 4, which didn't open until 1986 and now seems positively ancient). It was my first time at Heathrow, not counting when I went there once or twice in the early 60s with my cousins just to look at the planes. It was very confusing. Now, after over 30 years of more or less continuous travel, it's easy to forget just how daunting it all seems the first time.

The plane was quite empty - I had a window seat, with someone in the aisle seat, but an empty seat in the middle. Back then empty seats were the norm. Even ten years later it was quite common to find a whole row of five seats on the unlamented L-1011 where you could stretch out and sleep through the flight. After all I'd heard about airline food, I was amazed to find that the meal was quite edible.

Once I'd retrieved my suitcase, I had to get out of Boston to Maynard, which lies about 20 miles to the west of the city. This could have been hard, but for one of the amazing and wonderful things about working for DEC back then - the private helicopter fleet. The company owned about a dozen Bell Jetrangers, which operated shuttles between all the New England sites, and to Boston airport. And this wasn't just an executive perk - any employee, including a lowly recent graduate like me, could use it, just by calling a number and making a reservation.

I'd never even seen a helicopter up close before, much less travelled on one. It picked us up in remote corner of the airport, then had to taxi to a place where it was allowed to take off. I was amazed as we hover-taxied along the marked vehicle routes, with airport trucks in front of us and behind, for all the world like a wheeled vehicle. Then we flew to Maynard. Passengers weren't given headsets, and the noise level inside was unbelievable.

I still needed a rental car. A colleague took me to a nearby Avis depot, and in no time I was the proud driver of a brand-new Plymouth Duster. American cars were still vast compared to European ones, and while classed as a "compact" it was twice as big as my car at home - despite having only two doors and vestigial rear seats. It fully lived up to the quality reputation that American cars had at the time. The following day I noticed that the water temperature gauge was pegged against the stop. I took it back to the same gas station and said, "It seems to be running hot". The mechanic (unwisely) pressed his hand to the engine, swore loudly, and gave me another car. There was no water in the engine - and probably never had been.

The new car was an AMC Pacer. This has to be one of the most bizarre mass-production cars ever built. It was like a greenhouse on wheels, absolutely perfect for a record-breaking summer where temperatures exceeded 100F for days on end.

But I'm getting ahead of myself. My first stop after arriving was the Mill, a huge collection of 19th century buildings which had once been a giant woollen mill. DEC had started here in a very small way in 1957, and by the time of my trip two decades later had filled the whole complex and overflowed into numerous other sites across Massachusetts and New Hampshire.

In an age of sterile campuses composed of indistinguishable low-rise buildings (like the Cisco campus in San Jose), it's hard to image anything as weird as the Mill. Software engineering was in building 5, at the very back of the site. To get to Main Street required traversing the whole complex, via aerial walkways connecting the buildings. This might have been straightforward except that the site wasn't level, and the buildings all had different ceiling heights. The entrance from the huge parking lot to building 5 was via a short walkway straight to level 5, referred to as 5-5, which happened to be where my temporary office was located. The next step on the journey was to descend two floors to 5-3, then take a walkway across to the sixth floor of building 3 (3-6). Walking the length of 3-6 allowed a peek into a lab containing a simple aluminium prototype front panel with two rows of lights on it, like the PDP-11 - except that there were 32 lights in each row. In 1976, this was the very first VAX, and a very closely guarded secret.

From the far end of 3-6, another walkway went to building 4 then down one floor and back across  another walkway to 3-4 (i.e. two floors down). The path continued like this until eventually you emerged into the main lobby, in building 12, and into the open air. Leaving through the parking lot, you passed by Ken Olsen's personal non-reserved parking space. It was a matter of corporate pride that nobody had reserved parking, not even the CEO - but woe betide anyone else who tried to park in that space.

Building 5 had been a warehouse for unprocessed wool at some point in its history. In consequence, the wooden floors were completely saturated with lanolin. If you made the mistake of walking round without shoes, your socks quickly turned into a soggy, sticky mess, beyond recovery by any washing machine. The fire risk was truly unbelievable - if a fire had started the whole building would have been an inferno within minutes. The Mill had its own fire department, bigger than the town of Maynard's, but it's hard to see what they could have done to save this particular building.

There were very few hotels in the area in those days. There was a distinctly low-end motel in Maynard. In Concord, two towns away, was the historic Colonial Inn, but that was full. I was booked into a Holiday Inn in Marlboro, about 15 miles away. On my map of Massachusetts this didn't look far, and there were very few roads marked. While Massachusetts is one of the smaller states of the US, it's still about a quarter the size of England - so my map wasn't very detailed. I set off trying to follow it, but soon became hopelessly lost. Eventually I realised I was passing in front of the same military base for a second time. I stopped and very cautiously approached the guard post, my hands in the air. I'd read all about how trigger happy Americans were, especially the military, and I was taking no chances. The guard was probably surprised, but very courteously and helpfully gave me the directions I needed.

The hotel was typical for its time, squashed into the space between two highways, with heating and cooling supplied by a huge roaring monster piece of machinery under the window. I quickly discovered that I didn't like hotel breakfasts - and still don't. I'd noticed on the way to work an establishment called Dunkin' Donuts, and decided to try that instead. For "the folks back home", I took a picture before going in there. You can see my Pacer, far right, and a good selection of contemporary American automobiles, particularly the excellent red specimen in the foreground, which seems to have a flat tyre. As I walked in the waitress said to me, in an astonished tone, "You from outta state?". I was probably the first person ever to take a picture. The breakfast was excellent, as long as you like massively sweetened fried dough covered in fake chocolate.

Chastened by my navigational experiences, I tried to buy a more detailed map. In England, then and now, it's easy to find high-quality large scale (50,000:1) maps by the Ordnance Survey. So I was surprised to discover nothing similar in the US. (They do in fact exist, at 25,000:1, but they are extremely hard to find). After some searching I found a large street atlas of the area, which I still have somewhere. I carried it with me on every single trip for several years, until eventually I'd memorised what I needed. It was organised around towns, each one having its own page, with no overlap to the adjacent towns. And naturally, each town had its own street names. There were very few roads that carried a single name across town boundaries. So you'd be driving along, say, Elm Street in Hudson, and you'd cross the town line, turn to the appropriate page - and then have to solve the topographical puzzle of finding that you were now on Oak Street in Marlboro. To make it harder, each town had an arbitrary orientation, aimed primarily at making the best use of the space on the page.

I was lucky to have good friends in the US already. My former boss had moved out there a year earlier with his family, and I'd met his friend Lois when she travelled to England. And a colleague - Roger - was travelling with me. That meant that I was well looked after - I rarely had to spend an evening by myself. Lois at that time was renting a house in Marlboro, close to the hotel, where one evening I met the famous Dave Cutler who was then writing the the VMS operating system, more or less single-handed. Shortly afterwards she moved to a delightful, and very old, house in Harvard, where I ate many excellent dinners on later trips.

At the weekend it was time to do some exploring. I'd heard about Framingham Mall as a place to go, so I took my new book of maps and aimed for Framingham. I still had a lot to learn - the Mall was nowhere near the centre of the town, which on a Saturday morning was like a ghost town. This was really the nadir of American town centres, before their gradual rebirth during the 80s and 90s. I found nothing of interest except a rather scary guy asking for money for some religious charity. I gave him $5 for my own safety, and quickly left. About the only activity left in the town was a busy railroad freight yard, which was the beginning of my interest in New England's very complicated railway system.

With Roger I visited Boston, a must-do considering it's the most historic major city in the country. We went to the newly-opened Faneuil Hall Marketplace, formerly the city's main produce market, reopened as a tourist attraction earlier that year, and still in 2012 very much in the same role. We ate at Durgin Park, a restaurant there which is famous - and  much-visited - for the exceptional rudeness of its service. We were not disappointed. We walked the Freedom Trail, and all the other things you're supposed to do in Boston.

One thing that struck me, and which has changed a lot, was the size of the cars. In 1976, only a few eccentrics drove non-American cars - VW Beetles and early, crude Toyotas and Datsuns. And the American cars were huge. I still remember seeing a Jaguar Mk 10, one of the biggest cars on the road in England, which was completely dwarfed by the cars around it. Now cars have shrunk, the most recent American cars are often derivatives of European ones, and those vast boat-like 1970s Chryslers dwarf everything around them - the few that have not rusted away by now.

Mention of Boston wouldn't be complete without its near-twin, Cambridge, home to the two great universities of Harvard and MIT, and especially to Harvard Square on the periphery of the eponymous seat of learning. Superficially it's an area that has changed little in four decades, but on closer inspection much of its charm has gone now. On this first trip I was introduced to Bailey's, a very traditional ice-cream parlour with delightful art deco furniture, that served the most amazing hot fudge sundaes, drooling with an extravagant excess of rich, dark sauce. It closed some time in the 80s, as did later another institution, the Harvard Co-op. This was a department store but best of all it had an enormous book department, completely oriented to the needs of the universities and crammed with textbooks on every academic subject imaginable. Before the Internet it was the perfect place to research obscure topics, better than a university library. I still have many shelves filled with books purchased there, including my extremely obscure favourite, the Dictionary of Synonyms in Selected Indo-European Languages.

Lunchtime drinking was still commonplace in Maynard in 1976. The drinking establishment on Main Street, imaginitively called The Maynard Pub, did a brisk trade in pitchers of beer at lunchtime, and again after work. I've even been told that it played an important role in the original design of Decnet. In the morning the architecture team would meet to design network protocols. Then after a well-lubricated lunch, they'd reconvene. If they could still understand what they'd done in the morning, it was simple and robust enough to be adopted.

Close to Maynard is the town of Concord, famous for its Old North Bridge where, in 1776, the revolutionary American forces defeated the British army and triggered American independence. This was exactly 200 years later, the year of the Bicentennial. We went to see the famous bridge, an unremarkable wooden structure which in fact has been rebuilt several times over two centuries, set in a very pleasant park. It makes a perfect early-morning walk if you're staying in Concord and wake up early, jetlagged.

There's a visitor centre where we went along to an illustrated talk about the events of 1776. The presenter didn't know how to react to the British sense of humour when, after she asked for questions, Roger piped up with, "Can we have our country back please?".

The hotel in the area was The Colonial Inn, a brisk walk away from the North Bridge in the centre of Concord. It has been there for a couple of centuries, though most of the rooms are in a rather charmless modern annexe dating only from 1949 - and not updated since. It makes up for that with boundless character and a very special New England kind of charm. Towards the end of the trip we were able to get a couple of rooms there, and moved from the Holiday Inn. It has been my base in the area ever since, despite the temptations of the numerous soulless modern hotels that have since opened. They serve a hearty breakfast of pancakes with maple syrup, which I'd never heard of before. In the evening they have a selection of traditional New England dishes in a delightful period dining room, which makes up for the sometimes haphazard service. (Staying there a few years later, I ordered a bottle of decent wine - the waiter's comment, as he pulled the cork, was "Jesus Christ, what a long cork!").

The difference in architecture between Britain and New England was very striking. To someone used to brick buildings, it was astonishing to see that practically all construction was of very tidily painted white wooden boards. Whole towns are made up of these pristine white houses grouped around a verdant square, the wooden church in pride of place.

During the day I was working, slaving over a hot computer in a windowless lab that took up much of one floor of the Mill. It was filled with PDP-11s of every kind, equipped with all of the vast panoply of peripherals available. One was called The Ark, because allegedly it had two of everything. All development work was done in the lab - nobody had terminals in their office. PCs and laptops were nearly a decade from being invented. Terminals were mostly the DEC replacement for the venerable ASR33 teletype, the LA30, or else early DEC video terminals - the VT05 and VT52. On this trip I saw a prototype VT100 - which went on to become the de facto video terminal and is still with us in the form of the control sequences used for terminal-like communication.

If someone was working in the lab, the only way to contact them was via a single shared telephone in the middle. When it rang someone would answer it (if you were lucky), then connect to a loudspeaker and announce who the call was for. If you were luckier still the person would come along and answer. But often, they weren't there and the call would just hang until someone came by and hung up the phone, possibly hours later. I lost our daily shared "Maynard call" from England several times this way.

1976 was the year of Bicentennial - 200 years of US independence. And nowhere was this taken more seriously than New England. I was lucky enough to be there on July 4th when everyone celebrated. I saw my first American parade complete with firetrucks, popcorn and families everywhere - and of course barbecues. It was impossible not to be drawn into the general festivity.

One of the pieces of hardware I needed, the DZ11, was so new that nobody had any. I had to drive to the plant where they were made, which was in a country town in Western Massachusetts. It was my first glimpse of rural America, of the distances and the isolation - though nothing compared to the West. I carefully carried it back, got it installed, and tested my software on it. I'd done everything I needed to, and it was time to go home.

The helicopter took us from Maynard to its corner of Logan airport, and the TWA 707 brought me home to England. It was the first trip of many, a journey that became tediously routine at times. But those first impressions of a foreign country remain forever.

Thursday 1 March 2012

Python 3 - what were they thinking?

I'm a huge fan of Python for all kinds of programming, just about anything that doesn't need high performance or huge data structures. At my new company we are using it for all kinds of things. It's because I like Python so much that I'm so mad at the core team for forcing the Python 3 do-I-or-don't-I dilemma on the world (and more specifically, on me). I was forced this week to make the company-wide decision as to which dialect to use. There's no really good answer, though in the end I decided on Python 2 rather than Python 3.

What makes me angry is that the need to choose was forced upon the world by the sheer arrogance of the Python team. There's absolutely nothing in Python 3 that couldn't have been done in a backward-compatible way, allowing a gradual migration. Instead, they chose to make numerous changes which make it impossible to write code which will compile either as V2 or V3 of the language.

If you're just writing your own code, you can of course choose either version. But the big advantage of Python is the vast number of libraries for doing just about anything you can think of. And if you want to use those, they have to be available in your chosen dialect. According to a blog I read, less than a quarter of all libraries have been converted, including some major ones such as Django, which presents databases as web pages. Or if they have been converted, the paint is still very wet on the conversion and there are likely to be performance issues or just plain bugs. Another blog started out by promoting the idea of using V3, but ended up by saying that if it's for serious production, you're better off staying with V2. As it happens we don't need Djano, matplotlib, or numpy (three of the biggest libraries), but you never know what's round the corner, or what nifty library you'd like to use but can't because its developers haven't made the effort to do the porting - and after all, why should they, given that much of this code is written by volunteers, for fun.

Yes, there is one fundamental change which it would be hard to do in a compatible way, which has to do with the representation of strings. But for most uses of the language, this doesn't really matter. Only if you deal with transformations between raw bytes and strings do you really need to be exposed to this. There would certainly be a way, using the "future" concept, to allow the minority of code that needs to know about this to deal with it in a compatible way.

All of the other changes are just change for change's sake. Yes, maybe the new form is better in some ivory-tower sense, but not enough to justify the millions of hours of work that are being expended on the migration. And all of them could have been done by introducing a new form, then deprecating the old form over a period of years.

So this is purely a "because we can" exercise by the Python team, to show us all how clever and how powerful they are. It's enough to make you go out and learn Ruby.