Does the world need another programming language?

Rob Pike on how and why Google's new Go language was developed.

Rob Pike has certainly been places and done things. In the early 1980s, he worked with Brian Kernighan and Ken Thompson at Bell Labs, where he co-wrote “The Unix Programming Environment” with Kernighan and co-developed the UTF-8 character encoding standard with Thompson. Pike is now a principal engineer at Google, where he’s co-developed Go, a new programming language. Pike, who will discuss Go at next month’s OSCON convention, talks about Go’s development and the current state of programming languages in the following interview.

What were the motivations for creating Go?

Rob Pike

Rob Pike: A couple of years ago, several of us at Google became a little frustrated with the software development process, and particularly using C++ to write large server software. We found that the binaries tended to be much too big. They took too long to compile. And the language itself, which is pretty much the main system software language in the world right now, is a very old language. A lot of the ideas and changes in hardware that have come about in the last couple of decades haven’t had a chance to influence C++. So we sat down with a clean sheet of paper and tried to design a language that would solve the problems that we have: we need to build software quickly, have it run well on modern multi-core hardware and in a network environment, and be a pleasure to use.

Although we targeted Go for a particular kind of problem, it turned out to be a much more general and adaptable programming language than we had thought. So we’re using it for a lot of different things now. I think it might have an interesting future in any number of directions.

What’s it like to program in Go?

RP: Go has the feel of a dynamic language like Python or Ruby or JavaScript, but it has the performance and safety of a language like Java or C or C++. So you get the lightweight feel of a modern scripting dynamic language but the robustness and performance of a more old-fashioned language.

Does Go have a robust development environment?

OSCON -<br />
Save 20%RP: We have an interesting set of tools now that play with the language. One of the standard libraries that comes with the distribution is a complete parser. So depending on how difficult the problem is, you can write your own tool and maybe a page of code with the existing libraries.

There’s tools that let you link in existing libraries. With large packages like OpenGL or something like that, you’re much better off just linking against existing ones. We can do that with our wrapper tool, and there’s SWIG support so we can link against C++. But the fundamental libraries are all written in Go.

There’s plug-ins for Eclipse and a couple of other environments. There needs to be more. We don’t have an IDE yet, although we have some ideas about ways to do them.

Does the world need another programming language?

RP: It’s an interesting time for languages because there are many new languages coming about. There was a burst of language development in the late ’60s and early ’70s and then things died down. That’s not to say there weren’t any new languages coming along, but language design didn’t seem to be a very profitable enterprise. But then in the last five to ten years, there’s been a renaissance. One of the reasons for that phenomenon, which is what I’m going to talk about at OSCON, is that the languages in common use today don’t seem to be answering the questions that people want answered. There are niches for new languages in areas that are not well-served by Java, C, C++, JavaScript, or even Python.

How does Google compare to Bell Labs?

RP: A lot has changed in both worlds. When I worked at Bell Labs, we were doing much more research-driven, publication-oriented stuff. To a large extent, the company did not understand open source. When I came to Google, it was a very different orientation. We were definitely a company trying to make things happen. And at least a little later, open source became a fundamental part of the corporate culture. So they’re very different in that regard.

As far as day-to-day work goes, I think they have a lot in common. They’re both exciting places to work and they have a lot of smart people. But culturally, there’s a difference between a telecommunications company and an Internet company. They’re fundamentally different things.

This interview was edited and condensed.

Related:


Rob Pike will discuss Go’s development at the OSCON conference (July 19-23 in Portland, Ore.) OSCON will also be the site of the first Emerging Languages Camp.

Related

Sign up for the O'Reilly Programming Newsletter to get weekly insight from industry insiders.
topic: Programming
  • aram

    As an ada developer now using c and c++, I can understand some frustration with those “c” based languages. I’ve looked at Go a little while ago and really liked what I saw.

    Ada-like generics (templates) (things I liked in ada)

    Nice job, but the name “go” makes it very hard to search for.

    The world needs more and better languages, particularly compiled ones.

  • Kathy Sierra

    As a programmer, I’m interested in exploring “go” but like Aram, I am disappointed in the name itself. It leads to all sorts of false positives for those who like the game of the same name: “A post about go!” Oh. The language, not the game. Never mind. Somehow I didn’t have that problem with “Java”; the context difference for coffee vs. coding is usually enough.

    But seeing post titles/updates in the stream like “Learning go” “Do more with go” “Go rules!” make me cry ;)

  • Mike

    I’m all for new language development, but don’t use a name already used, even if it is obscure:

    http://en.wikipedia.org/wiki/Go!_(programming_language)

  • sulfide

    not sure what you guys are doing but when i google or bing “go-lang” or golang or “go lang” i get many many responses for what i’m looking for. i’d wonder what kind of code you are creatively capable of writing if you only search for “go”.. and then came here to complain

  • k

    There is a ‘custom’ search engine if you want to search for go-related stuff, so the name should not be an issue.

  • Darren Kulp

    I hope the “safety of … C” bit was the result of bad editing and not an original quote. I program in C daily and enjoy it, but I cannot think of any way in which I could call it safe relative to any of the other languages mentioned (or relative to practically any language in use).

  • Davide 'Folletto' Casali

    Uhm… and why not D, for example?

    I’d love to see a real world comparison between Go and D. They seem very similarly scoped.

  • eris

    You know guys, someone has already developed a very powerful compiled, systems development language that has generics, garbage collection, and many other powerful features as well as a very recognizable syntax while removing much of the C++ complexity.

    It’s called D and it could have really used Google’s support.

    It still could.

    How about we all get behind D and give it the support that it richly deserves. It’s getting hard for our little band to support its growing infrastructure needs.

    There’s three compilers for it now including LDC, derived from LLVM and Eclipse support.

    Please. Pretty please?

  • Sam Watkins

    C was/is plenty successful and I suppose it’s even harder to search for than “go”; or maybe not. So apparently if the language is good enough you can call it something ambiguous.

  • Babele Dunnit

    Me too, I will advocate Digital Mars D. And BTW I don’t believe Google people doesn’t know that one of the most experienced compiler writers out there paired with an outstanding language theory wizard and they developed a great, easy and powerful language now approaching his second, mature release. There must be something else, and AFAIK maybe Bright/Alexandrescu have been contacted by Google (and maybe refused any collaboration (well, world is strange))

    Go addresses exactly the same issues D was designed for. C/C++/Java developers out there, please check it out.

    Disclaimer: I am not Walter Bright’s cousin. I am just an old and tired C++ programmer.

  • bart

    Search for golang

  • Asa Zernik

    In regards to the comments recommending D: that probably fits a lot of the motivation, but Go seems to put a lot of emphasis on synactic support for concurrency (and in particular on this very pretty CSP-like model they have going), which from my admittedly brief perusing of information on D has no equivalent in that language.

  • Mp3 Player

    Analyze the failure of all languages in the last fifty years of the program hopes to develop a language and a most appropriate platform for the next fifty years of programming and anything that promotes beyond.The an end in itself, be-all , higher-level parallel programming language, does not seem to make is that we have too many options now.
    Mp3 Player

  • Mike

    This recent presentation by Robert Martin hits it on the head:

    http://www.youtube.com/watch?v=mslMLp5bQD0

  • 3APA3A

    Go? This language should be called “Og”, as in the caveman Og. No points for guessing what the mascot should be. Like C# and Java, Og keeps mainstream program language development firmly in the stone age.

    Fortran came out in 1954. This was 56 years ago. The level of abstraction offered by the (mainstream) languages Og, Java, C# is not substantially higher than that of a language more than half a century old. Not exactly brilliant progress.

  • tec-goblin

    A whole article basically to say “we would love to use C#, particularly now with its var and dynamic keywords, but it’s the adversary’s language”.
    Seriously, more scripting friendly but still strongly typed? There is already jython, groovy and c#.
    It must be so much fun to reinvent the wheel!

  • Adam Tibi

    I am wondering why did this interview ignored mentioning the C# language while it mentioned the less advanced and dying Java language. I think that this is done on purpose and can be categorised under the hatery to Microsoft.

    Guys hate whatever, but be fair!

  • Scali

    Over the years I’ve tried many different languages, but somehow I always keep going back to C/C++.
    It’s not the most pretty language out there, sometimes you really have to get your hands dirty… but that is also its strength.
    With all those new languages such as Python, Java, C# and whatnot, I keep running into the fact that all these new features like garbage collection and all sorts of syntactical candy come at a cost. Memory usage can go up a LOT, and performance can be abysmal if you’re not careful.

    Often I find myself stripping the code down to the basics to avoid these issues, or just plug in some ‘raw’ C/C++ code… there’s just nothing that can beat C/C++ in those areas (with the exception of assembly, but you can use inline assembly if necessary, and I do).

    I suppose those new languages are fine for 90% of the software written out there, where performance and memory consumption aren’t that big of an issue. But I happen to operate in the other 10% and I have yet to find a language that stops me from going back to C/C++ when the going gets tough.

  • dothebart

    Naming java, c, c++ in one sentence with ‘performance’ and putting oneself as equal in there seems to be a tautologie to me.

    While coding performance couldn’t be more different between all of the three, execution performance in most usage scenarios is also.

    Java and c# may be of similar speed (with some places the one being faster than the other) but I don’t think its appropriate to even name c/c++ there.

  • david_in_md

    Will Digital Mars give up the IP, and allow D to become an international standard (if it isn’t already)?

    I am eager to get back to using C/C++ especially after the new C++ standard is final and compilers can meet the standard.

    Is Go more designed for web development or is it considered a GP language?

  • hemo

    Language level I only see mixed salad of syntax, as a country with many dialects ( Java, D, Go, C# all from the father C/C++).

    May be I will see something different when the new language implementation will be made in one of the newly languages, not in C/C++.

    From a developer point, I see languages that comes with a lot of libs dones (packages), issues to discuss: time, quality, etc.
    But the cost of migration, source and human effort?

    We need people with time on a language to ensure quality, expertise, etc.

    Languages need evolution, not revolution. As part of a Culture.

    But in the background I see Copyright problems, Licensing, Free Software idea migration. companies inventing the wheel to avoid legal problems or have the potential for success that has already had another company with a similar idea.
    Make things better, but try to do it without commercial vanities.

  • Walter Bright

    The D programming language 2.0 has advanced support for concurrency in it.

  • Black Falcon

    Most new languages are similar to fads in the sociological sense. They come and go since they have little real relevance to real world issues. Most of the languages mentioned in this article will never see the light of day over the long haul.

    Languages are also used on a need-dependence basis. For example, still the easiest language to learn is classic BASIC, which is a great jumping off point for people who want to become professional programmers. Though this language has been derided over the years by “real programmers”, it has intense staying power in many areas and for its small size and macro-like syntax is exceptionally powerful. Practically all current and established scriptingdynamic languages have an ancestory from this original language.

    And people learn programming languages by their requirements, interest, but most importantly as a result of their personalities… People who have derided BASIC can’t seem to grasp the fact that the majority of developers have no real requirement for C++ or C.

    C++ is a language for internals developers. It is not a good choice for general application development and is even beginning to have a hard time keeping up with C#, VB.NET, and Java in the gaming community. It is difficult to learn and even more difficult to master. In fact, there are relatively few really fine C++ developers in the world.

    VB.NET, C#, and Java are the substance of general application programming along with a variety of other niches including gaming, utilities, and internals. The power of these languages is the fact that they can be used to produce compilers. Half the world’s compilers have been written in Pascal…

    Python, PHP, and in part Ruby are the primary scripting languages that have been popularized, though PHP is merely an equivalent of Microsoft’s “Classic ASP” and serves no purpose in general programming beyond the web.

    All of these languages can be used for just about any purpose required in the industry thus negating the need for any new languages that do not address specific situations. The classic example of the latter is PROLOG, which became popularized for use with “expert systems”.

    However, when it was found that only approximately 2000 such systems could be designed, the language quickly fell out of favor. PROLOG was also not designed to support large application development, which also played a factor in its demise.

    Now here’s the kicker… programming is a very precise art as well as a science. However, the sociological trend among young developers today is to mimic the devolutionary sociology of US society, which is to reduce precision to sound-bites, which in turn leads to confusion and poor results.

    Today young technicians are enamored with “getting it done” quickly with the least amount of effort; thus the penchant for languages that seemingly reduce code and replacing it with “declarative formats”. Guess what? It accomplishes nothing internally. Whatever the code being written, the internals still have to accommodate what has to be done resulting in similar internal code generation that has to be processed at the micro-instruction level.

    The move away from precision coding is a major factor in the consistent project failure rate of approximately 70%, which has been a constant since the inception of commercial computerization of industry. The Information Technology field has never matured as similar technical fields have done making it still one of the least cost effective technologies on the planet.

    Languages do not make for good solutions as does taking the time to plan out and design a good application that addresses a problem-space’s needs and requirements. And you can do this with any language and without object oriented coding techniques.

    What you need is intelligence, an understanding of the natural flow of applicationsystem development and a sense of craft, something that has been sorely lacking in the field since the mid-1990s.

    Its very nice that there is an “Emerging Language Camp” but in the scheme of things it will mean very little unless the languages can present a sense of style and strength to address most problems. In that regard, after working in this field for 35+ years, I would spend my time in more important endeavors, since most languages are merely about the syntax while getting the job done still relies on the same concepts that have been around from the start…

  • Black Falcon

    Oh, by the way…

    As it regards concurrency or what is more commonly known as parallelism; this problem was resolved in the early 1990s by a computer scientist that developed a common extension for all languages called, “LINDA”.

    This development was so extraordinary that it threatened the life-blood of most compiler manufacturers so this highly intelligent individual was blacklisted out of the field…

  • David Jones

    @Black Falcon
    “most languages are merely about the syntax while getting the job done still relies on the same concepts that have been around from the start…”
    Sounds to me like inventing new cars…
    Newer cars have a whole lots of features, can navigate you, make driving easier and safer for you.
    But driving still is basically the same.
    Still, I would rather drive a Koenigsegg Quant rather than a 2CV…