BT

John Graham-Cumming on Polyglot Programming and Geek History
Recorded at:

| Interview with John Graham-Cumming Follow 1 Followers by Chris Swan Follow 541 Followers on Apr 16, 2015 | NOTICE: The next QCon is in San Francisco Nov 5 - 9, 2018. Save an extra $100 with INFOQSF18!
25:13

Bio John Graham-Cumming is a wandering programmer who's lived in the UK, California, New York and France. Along the way he's worked for a succession of technology start-ups, written the award-winning open source POPFile email program and churned out articles for publications such as The Guardian newspaper, Dr Dobbs, and Linux Magazine.

Sponsored Content

Software is Changing the World. QCon empowers software development by facilitating the spread of knowledge and innovation in the developer community. A practitioner-driven conference, QCon is designed for technical team leads, architects, engineering directors, and project managers who influence innovation in their teams.

   

1. [...] John, first if you can just introduce yourself and then talk a little about CloudFlare because it's a company that I'm familiar with but I find an awful lot of people, despite its enormous reach across the web, don’t know CloudFlare.

Chris' full question: Hi, this is Chris Swan, one cloud editors at InfoQ. I'm here at QCon London with John Graham-Cumming. John, later on today, is going to be doing a presentation about how he uses Go at CloudFlare and that's going to be available separately as a video. So I'm not going to talk very much about that. But I'd like to start off really, John, first if you can just introduce yourself and then talk a little about CloudFlare because it's a company that I'm familiar with but I find an awful lot of people, despite its enormous reach across the web, don’t know CloudFlare.

I was going to say the one thing about CloudFlare is that you've probably used it and you don’t realize it because our network is so huge that a huge percentage of what we think now that pretty much everybody on the internet passes through our network every week without realizing it because there's such a large number of websites.

So my name is John Graham-Cumming. I'm a programmer at CloudFlare. I've been with the company for over three years now. It's a fairly young company. So I was there when it was fairly small. Now it's getting midsized I guess. What we do is that we are a content delivery network and protection service for websites. So if you visit a popular website, for example, Reddit or OkCupid or many other household names, you are actually coming to one of our servers first. And we are looking at that traffic to make sure it's not malicious and we're accelerating it to make your experience as fast as possible. I'm one of the technologists so I work on lots of the things that are not even seen inside CloudFlare. So I'm a systems engineer so I tend to work on things that are behind the scenes. So I'm behind the scenes behind the scenes.

   

2. Excellent. So one of the things that CloudFlare did last year was Universal SSL, which seems to be a really major step forward in making SSL accessible to the masses. How has that gone from your view of what's happening there?

Well, so Universal SSL was something we had wanted to do from long ago. We talked about what we want to do just give our SSL away for free. You should be able to give a certificate away because if you think about it, it isn’t actually that difficult to make a certificate. I mean you run a program and the certificate is made. There are security things around how the certificate authority keys are controlled. That's really what it is. So we felt this was something we should include. In fact, it was overwhelming the reaction because suddenly what was something you had to pay for and was quite complicated to do was just included, right? So yeah, I'll have that. Thank you very much.

And we've gone on to announce other things to do further securing of connections which is also free just because we think that's what should be part of either a free or a flat rate. So it's something you're paying sometimes by the bit for, right? So some services would charge you, oh, you want to do SSL? There's a setup fee and then there's -- it costs you more which is ridiculous.

Chris: So I was lucky enough to spend a bit of time with Matthew Prince at the start of the year. It feels to me like the CloudFlare mission has very much evolved from initially being about DDoS prevention and then maybe being recognized as the accidental CDN I think was the term at one point. Now the mission seems to be to save the web.

I think Matthew likes to say that save the web thing; and it can be interpreted many ways. So it's a little unclear what saving the web exactly means. But from our perspective I think what it comes down to is if you run a website, staying up to date with all of the new things that are happening in terms of protocols or attacks or technology is very, very hard. So what we want to do is say if you’re not Amazon or Google or one of the major, major properties, we'll give you the same kind of technology as those people have when you don’t necessarily have the capabilities.

So SSL we'll give it to you for free. We gave SPDY which is the new web protocol that Google came up with, that's just included. IPv6, that’s just included. That's what we meant by saving the web, which is sort of put everybody on the same playing field, I guess. You've got the same technology available to you and make it one click. Just go in and say, "Yeah, I'd like to do that piece. I'd like to have a firewall. I'd like to have these features."

Chris: So you touched upon the issues around CAs with Universal SSL. I came across a project called Convergence that Moxie Marlinspike was creating and advocating. It felt to me like Convergence was going to be the way to go for these things, and really it was going to do the CAs out of a job. Why do you feel that that hasn’t got traction? It seems that maybe Google is not kind of jumping all over it with Chrome or building it in could be partly to blame there.

I think Google does have a lot of market share in the browser so they can add things and make them part of the new world. Look at SPDY; that has become something that they have pushed. I think the certificate authority thing is a little bit difficult because there is a tremendous amount of inertia because you've got all these certificate authorities. It's hard to change the security infrastructure within a web browser. And the thing is if you do change it, then you've got an education problem about, okay, what if we told users to expect in terms of okay, this is the lock icon sort of thing. That's really badly understood as it is today.

So I think there's some reluctance to change the model completely. Now, that's not necessarily -- I mean Moxie Marlinspike is a pretty bright guy so he's probably got a good idea. But I think it's going to take a while to do that. I hope that things like Universal SSL mean that just everybody is using SSL. Maybe there will be a CloudFlare browser and we'll just push for that.

   

3. That would be a nice idea. Tell us about your personal background, how you ended up at CloudFlare in the first place. What was your journey there?

My journey there. So I have known Matthew Prince who is the CEO at CloudFlare for about 10 or 11 years. I met at I think called the MIT Spam Conference in the early 2002 where we were both speakers. I had, at the time, written an anti-spam filter, a machine learning one, fairly early one called POPFile which had become very popular, an open source project. I just got talking to Matthew and we got to know each other and became friends and stayed in contact over a long period. I was living in California at the time. I ended up moving around quite a bit living in New York, living in France, working in Germany and all sorts of things and back in the UK now.

Matthew just kept persisting on telling me, "Hey, I'd love to work together." And then he created CloudFlare which I thought was a really, really bad idea. But when he told me about it, I was like, "No one is ever going to hand you their DNS and hand you their website to manage. How is that going to work?" To his credit, he just kept on at me and at some point I was like, "Okay, maybe actually this is really going to work." The ironic thing is that I was so horribly wrong about this because in the early days of CloudFlare not only do people give us their DNS which they do today. But in order to do it, they actually had to give their username and password for their registrar. So they would literally hand over their username and password. We would go to Network Solutions and reconfigure it for them. So people were desperately willing to have this kind of service. Now, luckily, we don’t do that anymore. We have much better systems that don’t require giving away credentials.

So about three years ago I joined to work on technology things.

   

4. One of the other platforms that you're associated with at the moment is Electric Cloud. What's that and what are you doing there?

Electric Cloud is a company that I co-founded in California when I lived in California. I had been working at a company that had really horrible software builds, really, really long software builds. And John Ousterhout, who is my co-founder and also is now a professor at Stanford, came to me one day in my office and said, "I've got a better idea. What we're going to do is we're going to do parallel builds." Unlike CloudFlare, I thought that's an excellent idea. We should just go do that. We then talked to many other companies about it.

At the time, if you had a large C or C++ code base, you basically could use make and there was a parallelism feature but it always broke. In reality, it always broke at some level of parallelism. And we built a wildly complicated thing that solved that problem. So it was really very interesting. So we built an emulation of make, which I actually did, and then we built our own file system underneath. And so we could compare what the makefile says and what actually happens. We could figure out where there were problems. And therefore, if parallelism was going to break the build, as part of the build, restart bits and fix it. You always got a perfect build no matter what level of parallelism you did. And we could actually output here's how to fix your makefiles so it's perfect for that.

So that was a company that I founded. I'm only peripherally involved these days because it's gone on and done other things, and I moved back to Europe. But yeah, anything that's around making software build fast and reliable, that's what Electric Cloud does.

   

5. You also wrote a book about make. Has make been one of the things you've gone really deep into?

Yes. Yes, I have. And that's why I have gray hairs. I would say every software developer has used make. Some have actually fiddled with makefiles and got into it. At Electric Cloud, what happened was one of my jobs was we needed to emulate GNU make. And we couldn’t actually use GNU make. It's GPL and also it was completely wrong for the infrastructure we were doing. So I was given the task of just write another version of GNU make to talk to our system, so just from scratch. So that's what I did. I actually had the manual and I had the test suite of GNU make and I wrote a complete emulation of GNU make in C++, which some other people then took and made infinitely better I'm sure. That really got me into GNU make.

And then of course I started working with people's actual makefiles and seeing the real problems they had. So then I just learned the language to a point where I do know it pretty well. I did end up writing a book. In fact, a new edition of that book comes out next month. So there's a proper published edition from No Starch

   

6. You're talking about Go later. You just talked about C++. It feels to me that you're a genuine example of this polyglot programmer phenomenon if it's indeed a phenomenon. How do you decide which tool to pick out or the bag for different projects?

I do know quite a lot of languages. I would say I'm incredibly weak at anything that's around the web browser, so JavaScript or any of the things that's going there I know nothing about. I'm a complete neophyte. I've been very much a systems programmer. My first job was writing network drivers in C and Assembly. So I came up from a very machine embedded kind of thing. One of my early jobs was to write a TCP/IP stack, which I foolishly did by reading the RFCs and not actually by going and getting the Berkeley Distribution. And the reason is we didn’t have internet access so I didn’t know you could go do -- you know, it was a different time.

So I'm very much somebody that’s come from that track, so C, C++, things like that. How do you choose which tool? I mean it just depends on what you're doing, right? So the reason I do a lot of stuff with Go and CloudFlare does as well is because we've got lots of machines with lots of cores so we've got lots of ability to do things concurrently and Go is inherently a nice language for that. It's somewhat C-like so that syntax is something people can pick up really quickly. It's a safe language. It's typed so you don’t shoot yourself in the foot. I mean I'm also doing coding in Lua because we use Lua pretty extensively, and that's a whole different world. So that's completely unsafe in terms of typing. You can do whatever the hell you like and things.

And so I think it depends on the particular task at hand. In my talk, I'm going to talk about some of the things we do in Go; some of the things we don’t do in Go. It depends. I've done a lot of Arduino programming in C, for example. A lot is driven by here's the problem I'm trying to solve. So it depends on the day.

   

7. Let's stick with the Arduino stuff if we can for a moment. [...]

Chris's full question: So let's stick with the Arduino stuff if we can for a moment. I've seen a number of I guess your hobby projects, kind of picked up and enthused about on Hacker News, et cetera. If I look at your GitHub Simonoids. Simonoids kind of attracted me because I did a Simon program in the '80s and it got published in a magazine. Since then for me Simon has been often the program that I rewrite time and time again to discover a new platform. Do you have that same sort of issue?

I wrote that actually because -- I don’t know why. I had one of those -- Simonoid is Simon in an Altoids can, right? So that's the name. So the whole thing, it uses an Arduino Pro and it fits the inside -- the whole thing with these four buttons. SparkFun had this circuit board with four LED illuminated rubberized buttons. I didn’t know why I got this idea, but that will be fun. It's like a pocket Simon. Of course, you can buy these things for two quid in some shop somewhere. Sometimes these things are sort of crazy idea. Let's just see what we can do with things I've got hanging around. I also built Pong in two cans from Marks & Spencer, two sweet cans. That's also an Arduino.

The interesting thing in that is that it plugs into a television. The TV signal generation is done in software, which I just find fascinating. That device is fast enough to generate the scan lines directly and you just feed it straight into the TV. There's a nice module for it that does that. Right now I'm building a MAME cabinet using a Raspberry Pi 2. That's close to being done. That's primarily because I want to be able to play Williams Defender which is a 1980s, early '80s game.

   

8. You're going to go the full hog there and have a full button control Defender with just the up/down joystick?

So I want to be able to play a few other games. So I've also got the joystick and also got left/right which, of course, wasn’t used in Defender. And I've got two players as well which in Defender, there was actually only one joystick and you had to switch players. But yes, I have a cabinet I just painted. It has the buttons in it. It's pretty much ready to go. I mean I can play it now.

Chris: Excellent. If find that Raspberry Pi is a fantastic substrate for MAME, and with the faster processor on the Pi 2, it just extends the library.

Exactly. With the Pi 2 you can really run Emulation Station. I think you can have a good time. The Raspberry Pi I love but sometimes there's particularly reason when I found kind of frustrating. You suddenly think, "Wow, why is it so slow?" It's like, oh, yeah, it isn’t that fast a machine. You’re sort of used to, ‘Why is this working like my MacBook Pro?’. It actually is kind of restricted.

   

9. One of the things that I think you've become most famous for perhaps is the campaign around Turing. How did that get started?

Yeah, that's kind of amusing which is that what happened was in 2009 I was at home and I saw a tweet from Stephen Fry saying, "Oh, it's Alan Turing's," whatever, "97th birthday. It would be 97th birthday today. And, I of course, knew Turing because I had studied computer science and I had done computer security and so I really knew about it. And I don’t know. I just got kind of angry about it that evening. I was on my own at home and I was like, "Oh, Britain should do something about this, blah, blah, blah." And I wrote this angry blog post. Surprisingly, quite a lot of people said, "Oh, that's a good idea actually. Did you know that you could do these partitions on the Number 10 web site?" Honestly, I didn’t. I had no idea. I literally come back to the UK that year from being away for 15 years. I had no idea you had this direct democracy thing going on.

And so I just set it up. I just set it up that day. I just applied. You have to wait. There was a waiting period before it was published to make sure it wasn't completely crack pot. I think at some point in August, early August, it was approved. I thought maybe 500 people would sign it. How many people are going to be interested in this in Britain? Because it had to be people in Britain. It was, I don’t know, 33,000 signed in the end. So it just, I don’t know. It was one of those things that just caught the right tide I think.

Chris: Yeah. And I think it's become the beginning of a process that we now see carrying on through, especially with the sensationalism around Imitation Game and the Oscar's in the last few weeks and that kind of thing. So it's good to see that continue. You're now expending efforts on Plan 28. Tell us about that.

Charles Babbage, who was another British computer person albeit in a different century, is known for I think called the Difference Engine No. 2 which is a very large calculator. It does a particular thing very well, which the Science Museum in London built. Babbage never finished but he left plans and they ended up building it. There's a copy in the Computer History Museum in Mountain View in California. I've always loved that machine but it is a calculator.

And Babbage, while thinking about that machine came up with another idea which is called the Analytical Engine. And anyone who's written and uses a computer will recognize instantly the Analytical Engine as a computer. It has memory which he calls the store. You have to remember this is the 19th century. It has a CPU which he calls the mill; it's milling numbers; programmable with punch cards but I suppose in terms of program, also data input with punch cards and with a printer. The printer is actually the same mechanism that's used on the printer on the Difference Engine No. 2 in the Science Museum.

So what I'm trying to do with people who have really been involved with Babbage is figure out what can be built from Babbage's plans because he left to the South Kensington Museum, which is now the Science Museum, all of his plans. Most intriguingly, all of his lab notebooks, he's got this huge Quattro notebooks leather bound things. Imagine every day he's writing down his ideas about how he's going to build this thing.

So there's a big task right now partly being done by Royal Holloway to figure out, okay, what truly is the design of this thing because Babbage fortunately and unfortunately was kind of a classic computer nerd before his time. Every time he came up with an idea, he came up with a better idea. So he'd say, "I can make it faster like this. I need more memory." He didn’t say he needed more memory. He was talking about needing initially 15-memory locations. There may be 50. He imagines a thousand. You can imagine he's going to need the space.

So the difficulty is the Difference Engine No. 2 he left behind quite a clear plan of just build this, and the Science Museum did it, and it works. The Analytical Engine he left behind literally hundreds of plans and thousands of pages of notes, which are probably complete but you got to figure out, okay, which bits I'm going to fit together like that. I think we'll be able to do it and once done, it will be about the size of a small steam locomotive and run slower than a ZX81 but still...

   

10. When it's done, will you be able to run some of Ada Lovelace's original code on it?

Yes, absolutely. In fact, intriguingly, in the Science Museum in London, there are stacks of punchcards prepared by Babbage with programs on them, waiting for a machine, waiting for now 100, 200 years, whatever, for a machine to actually run them on. So yes, we would love to run those and see what they do.

Chris: So how would you estimate the engineering effort involved in building that thing relative to, let's say, the reconstruction of the Bombe at Bletchley Park?

The Bombe at Bletchley Park I think is markedly simpler. The Bombe has -- it's very, very impressive to look at. First of all, it's electromechanical. It's not completely mechanical. The Analytical Engine is totally mechanical. You're talking about something that's probably got 40,000 parts, all of which have to -- made to move together so much, much harder. You can more compare it to the Difference Engine No. 2 which is essentially something like an eighth to a quarter of the size of the Analytical Engine. That project took well over 10 years. So I'm not holding breath. This is a serious effort academically to understand what Babbage had.

   

11. Is it called Plan 28 because it's going to take 28 years to do it?

No. It's called that because one of the sets of plans that Babbage drew up -- it's called Plan 28 and they're just numbered, right? It's being fairly closely studied. That in so many ways a placeholder name. It can be called almost anything else because there's a Plan 25, there's a Plan 29, et cetera. But Plan 28 has been studied fairly much in detail and it has rather nice diagrams of how the punch card reader works and also how the microcode works because that's the most surprising thing that the Analytical Engine has microcode in it. So it has literally barrels, like a barrel organ with the microcode on it to orchestrate the operation of machine.

Chris: It sounds like something straight out of The Diamond Age.

It is straight out The Diamond Age. And also if you're a computer programmer, I mean it has instruction pipelining. It has data pipeline. There's all sorts of optimizations going on where you sort of think how did he think of all these things. He's basically alone there in central London coming up with all these ideas. But I guess he was inspired to figure out certain mathematical things he wanted to do which he couldn’t do on the Difference Engine. He stumbled into modern computing basically.

   

12. We already touched on your book about make, but you've also written The Geek Atlas. How did that come about? And what's going on?

The Geek Atlas is a guidebook for nerds basically. It's 128 places around the world where you can really go and enjoy science and technology. How it came about is that because of my life and because I traveled a lot, I had seen lots of interesting scientific places and I also would sneak off and see things. I was working in Munich, and in Munich, there's a thing called the Deutsches Museum which is a bit like the Science Museum, but even more German, I guess I would say, in the sense that the collection is so good in terms of how it's presented and how many pieces they have.

There's one bit that really struck me about power generation, where they talk about how have people generated power, and it goes everything from a dog-powered bellows for a blacksmith. So the dog walks around which makes the bellows move which keep the fire going, to a turbine used in hydroelectric plant. You see this progression of technologies. I went back to my hotel room and I was like, "There must be a book for somebody like me who would like to discover things like that." I went on Amazon and Barnes & Noble I think and it didn’t exist. And I thought, "Well, maybe I can have a go at writing it," just because I'd been a lot of places. That's literally the genesis of that because I just sort of decided.

I wrote the sample chapter and my sample chapter was about Marconi, so the initial radio transmissions, and the site, and also what his radio transmitter looked like, because what I wanted to do was have not just a guidebook about go to this place in Cornwall and you'd be able to see this, but also how it worked or some scientific thing about it. What was Marconi's transmitter? What was it made of? And the circuit which is incredibly simple. In fact, I mean a huge amount of power but incredibly simple.

So that's the whole book. And it was a bit of adventure because some bits of the science I knew about, particularly with mathematics or computer science or some of those sorts of sciences and some bits I got into the Joint Genome Project which is in Walnut Creek in California. I had to really start to learn some stuff. If you're into science, it can be used as a real guidebook. There are people who would go around and cross off places they've been. It can also be sort of armchair experience. We're going to see some of those places.

   

13. Have you been to all the places yourself?

Not all of them. Almost all now. There's a couple of places that I wanted to go to, and after 9/11 they got restricted to non-Americans. So for a while it wasn’t possible to go and see where the Trinity explosion was on the first nuclear bomb. So I'm trying to go back. I think things have started to ease up a bit in that regard. But pretty much all of them are my experience of going there. For example, there was a business trip I went on with a friend to Baltimore in Maryland. We were driving along and I said, "Do you know that the NSA has a museum?" And he was like, "We have to go. We have to just take a detour on this business trip." So Fort Meade, outside of Fort Meade which is the secret headquarters of the NSA, there is the National Cryptologic Museum, which is I think it's in an old motel actually, just in front of it, this little tiny building, utterly fascinating. It's sort of like a mini Bletchley Park with the history of cryptology from the NSA's perspective.

Chris: Fantastic. Well, I ordered my copy yesterday.

Great.

Chris: Well, John, it's been a real pleasure talking to you. So thank you very much for stopping by.

Thanks very much. Thanks for the chat.

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT