Interviews: Ask Alan Donovan and Brian Kernighan About Programming and Go
Alan Donovan is a member of Google’s Go team in New York and holds computer science degrees
from Cambridge and MIT. Since 2005, he has worked at Google on infrastructure projects and was the co-designer of its proprietary build system, Blaze. Brian Kernighan is a professor in the Computer Science Department at Princeton University. He was a member of technical staff in the Computing Science Research Center at Bell Labs, where he worked on languages and tools for Unix. He is the co-author of several books, including The C Programming Language, and The Practice of Programming. Recently, the pair have co-authored a soon to be released book titled The Go Programming Language. Alan and Brian have agreed to give us some of their time to answer any questions you may have about the upcoming book, Go, and programming in general. Ask as many questions as you'd like, but please keep them to one per post.
Hi, I've stopped using Go when I saw the hacky stuff I need to do to get libraries like OpenGL to behave correctly. (see https://github.com/golang/go/wiki/LockOSThread) Are there any plans to fix this?
There's already a game called Go, which has about a gazillion articles on how to program it. Couldn't you come up with a name that would be less ambiguous? Now, when you see a user group for "Go programming", you have no clue which one it is.
Support microSD: in a post 9/11 world, it is unwise to carry your data on media that you cannot comfortably swallow.
Why the hell would anyone use Go?
(Serious question, since our editors didn't tell us why Go was created, what Go's intended purpose was and whether or not anyone is actually using Go.)
How does 'The Go Programming Language' compare to 'The C Programming Language'?
Why was package versioning left out? And are you guys still fond of this decision? As I use Go more and more I see this to be the weak spot; software has been around for many decades, and we all know that it is continuous evolution. Go's import system does not allow specifying or hinting a version, nor does the `go get` command (although it supports major VCSes), and that's how hacks like gopkg.in have been conceived. And it's not like package managers for other languages haven't already solved in a more or less elegant way the problem already...
Go language differs from many other languages in how it handles Errors. Can you summarize the benefits and drawbacks to the Go language error handling approach when compared to Java for large scale applications.
Do we really need to introduce Brian Kernighan? Has the quality of the slashdot readership really dropped this low, or am I just an angry old fart who thinks that all the kids should know who my antiquated heroes were?
Seeing as how it was created after the Internet was big, and one is constantly searching the Internet about the programming language one using, wouldn't you want a distinct name so search results are what the programmer wants? "Go" is the 35th most common word in the English language. When you search for "go" you get entries about games, movies, etc. Google, coincidentally gives the best results if the programming language is what you are searching for, but even Google gives you results for all sorts of things. The programming language isn't even a dominant result on other search engines.
Obviously, if you use a search engine to find things about "JavaScript" or "Erlang" you get what you want. I can't imagine going through the trouble of creating a programming language and then failing to give it a distinctive name.
Democracy Now! - your daily, uncensored, corporate-free
For what scenarios and projects do You recommend it and for which you recommend against using Go?
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion. -- Spazmania (174582)
I can understand the convenience of not needing to mark a class as an implementer of an interface. But on the other hand, it would be nice if you at least had the option of marking a class as an implementer of an interface, so your IDE could tell you your class is not complete.
Democracy Now! - your daily, uncensored, corporate-free
What serious long-term real-world potential do you see for Go?
How do you see the potential of Go replacing existing open source webstacks such as Apache and PHP, Python or Ruby? Was Go built with a technology update of existing approaches in mind? How feasible is it in your opinion to try and replace the existing complex stacks with pure Go runtimes?
We suffer more in our imagination than in reality. - Seneca
Is there an official cross-plattform Go IDE in the works? Experience shows that adoption is accelerated by offering a solid toolkit that is easy to pick up and get started with - such as the formidable Android Studio IDE Google offers to developers. Are there any plans similar to this for Go?
I would like to see it take the place of C++ in the development of performant end-user applications with GUIs - are there any officially sanctioned projects that aim to provide a serious GUI toolkit and stack based on Go?
We suffer more in our imagination than in reality. - Seneca
A large hindrance for seaching information on Go is its name. Many people have pointed this out already.
What plans does the Go project team have in terms of naming conventions to make future searching for information on Go easyer? Is there an alternative term that you recommend using when searching Google for Go related information - perhaps something like the term "go-lang" or so?
What plans does the Go core team have to mitigate this problem? What approach to searching for Go stuff do you recommend right now?
We suffer more in our imagination than in reality. - Seneca
What was the main motivator with the decision to leave inheritance out of the Go? Code complexity argument goes both ways here, assuming keeping up with the Liskovs.
Well, if all of computer language history is any guide, that's going to present an asynchronous performance issue.
I'm a C programmer by choice. I require that the program does what I told it to, when I told it to. Anything else is malbehavior. Data structures are not garbage unless and until I say they are. So, if go follows the example of every other garbage-collected language I've run into thus far, I'd need to disable garbage collection (and most likely anything else that is running off by itself to do things I didn't ask for within the context of what I write.) I'm perfectly satisfied with local variables that are cleaned off with one CPU instruction on procedure exit; that's as automatic a "cleanup" as I care to indulge in.
Also, threading's not all that difficult. I use it all the time in C. I really don't see the big deal, but I'm willing to listen / read why it might be.
So that would be my question: As a C programmer with a deep collection of working, very fast algorithms in my areas of specialization, and a regular, nearly constant need to get as close to the metal as I can get, why would I want to transition to go? Just as an aside, being able to call C from go... go would have to offer something very significant indeed for that to fly. I can already call C from C.
I've fallen off your lawn, and I can't get up.
For someone like me who likes garbage collection, multiple dispatch, and extreme abstraction capabilities in high level languages like Common Lisp, and safety, compile-time error detection, readability, and speed in low level languages like Ada or Haskell, what are the benefits of using Go in comparison to these two different types of languages? What new useful features does Go bring?
Is there a plan for creating complete Android apps with Go?
There many books on "how to program" but few on "how to program well". Brian, your book "The Elements of Programming Style" is a wonderful and a classic, but my students have a hard time reading the examples (Fortran 66 and PL/I).
Is there any hope for an update?
Is there any similar modern-language book that you recommend?
Michael Nahas (son of Joe Nahas)
P.S. I totally stole as much as I could from you when writing my tutorial for the language Coq. Sorry/Thanks!
with a good form builder?
I develop embedded system applications using Go. The Python folks are working on a "micro python" to be a striped down system for embedded applications. What is the chance that there will be a "micro Go" in the near future?
Go exists because most programmers these days just write text pumps. We pump text from the database to the browser. We pump text from the browser to the database. We pump text. We pump text over "APIs". That's it. Programmers don't really need to know how the machinery works for pumping text to and fro. Nobody will be writing OS kernels in Go or device drivers in Go. That is not what it is for.
On the PR and ego inflation front, I would certainly suspect that Go is named from (Go-ogle) and was created because as a big tech (media) company, they didn't want to be left out and not have their own language -- Objective C / Swift (Apple), Java (Oracle), C# (Microsoft). In order to be one of the cool kids, Google had to create something so they did and with their $$ and "community" of paid influencers, they will evangelize it whether its actually necessary or not. Yet another text pump language.
Happy pumping!
I quit developing in Go after my first two experiences were terrible.
First, I tried parsing an internal CA certificate, and it failed because Go didn't like the encoding. I submitted a bug with a fix, since every other SSL package and language (OpenSSL, Java, Python, PHP, Perl, Ruby) all work, and the response to my fix was literally "No thanks." That ruled out me doing anything with a network stack at work with Go.
Second, I tried parsing a date, only to find that instead of using the POSIX sequences, Go decided to use Monday Jan 2, 3:04:05, 2006 as a spec-by-example, which can't be made to work for my case. I proposed at least allowing POSIX time representations on the mailing list, only to be told that Go is quite happy with what they have and "more esoteric formats will have to be parsed by hand."
Overall my interactions with Go maintainers has been awful - it seems like if it isn't their idea, they won't hear it. Why is that?
As the legend has it, C was created to support operating system development. As time has gone by C++ has slipped into OS development on larger platforms. It seems that much of the current core use of mother C is centering on embedded processors (all the way down to 8 bit micros with 256 bytes of RAM) and drivers in larger systems. For current use what design choices in C do you see as wise and what would you change given the current usage of C.
PS: Thanks you for co-authoring the most wonderful, perfect, clear and concise technology document ever.
Come on, be honest!
Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
Comment removed based on user account deletion
If you expect that kind of procedure to be done manually for each dependency when you build the dependent package then you don't understand package management systems and modern automated build procedures.
Hint: the version dependencies have to be expressed using a defined syntax and in one place only in the dependent package, and thereafter when building it, all the dependencies in their required versions need to be obtained and built automatically. What's more, multiple versions of packages need to coexist, because it is very common that two packages which depend on a third require different versions of it, and allowing only a single version in the tree would create a build conflict.
Manual hacking around to compensate for the absence of proper package management just doesn't cut it, except possibly for basement dwellers. Life is too short for everyone else.
How and when would you introduce kids to programming?
Should Go replace Java as development platform/language for android?
I'm not sure that that should be at -1. I mean, come on now. We have guests. That means we have certain standards to uphold. One of those standards is letting them see the true /. and, as such, we should probably have the app guy, the cow guy, and APK.
This is where we fling poop and screech like howler monkeys. It's what we do. We shouldn't get out the fancy China, we're just going to break it when they leave.
"So long and thanks for all the fish."
I'm curious as to the design decisions that led to the way that Go objects are implemented, which feel and seem to operate like C structs w/ function pointers. Yes, all objects are essentially structs with function pointers, but most languages provide a good deal of syntactic and functional candy on top of them to make them more useful. With Go objects, you get sortof-inheritance, sortof-polymorphism, and sortof-encapsulation, which requires re-thinking a lot of design patterns that people learn working with languages like C++, Java, and even PHP. That's not necessarily a bad thing, I can see arguments for forcing people to get out of their comfortable patterns, I'd just like to know why.
Why is there no native and correct way to deal with money? No language since cobol has properly dealt with currency leaving coders to write or use broken libraries.
In the preface there is a chart of "The Origins of Go" which includes many languages such as C, Modula-2, CSP, and so on. However C++ is missing from the chart. Oversight or intentional?
The "Rust" programming language boasts the ability to perform more static analysis (finding errors at compile time) than Go. Could Go add better static analysis?
Any response to articles like this talking about how the runtime is crap?
http://dtrace.org/blogs/wesolows/2014/12/29/golang-is-trash/
Any response to articles like this talking about how the runtime is crap?
http://dtrace.org/blogs/wesolo...
Reimplementing the Gnu+Linux toolchain in GoLang could provide safety that decades of eyes on C could not (thinking about the recent BASH bugs & OpenSSL overruns).
Even a small portion would add security to Android. Performance is close & 1.5's library loading should keep executables light.
Is there interest in rebuilding Linux's base userland?
Science & open-source build trust from peer review. Learn systems you can trust.
Could the GoLang team produce a walkthrough on enhancing the compiler?
Even something as simple as making the code more idiomatic (since it was translated) could garner huge increases in contributions.
A guide to the structure would also be helpful.
Science & open-source build trust from peer review. Learn systems you can trust.
The very first thing I tried to compile under Go's build scheme failed because of headers I don't have for a sub-service I don't need.
It was the "cups connector" for Google cloud print and it wanted libavahi.h even though I don't want or need any of that local network auto configuration stuff.
If the build system can't do what "configure" (autotools) does, or CMake, or CPAN, or any of the other portability systems, then it's not really portable is it.
Go? It went right to bit-bucket for now.
Innocent people shouldn't be forced to pay for inferior software development.
--"Code Complete" Microsoft Press
What would your advice be to people looking for work as a programmer? Either straight out of college with a CS degree, not a CS degree (but a degree), or someone transitioning to it from something else.
PS: I don't reply to ACs.
Now that Go has been in the wild for some time, which parts of the language would you change, and which bits have been an unexpected success?
Are there any plans for Golang version 2, and what might that include?
What do you think about GopherJS or similar projects?
We have guests. That means we have certain standards to uphold. One of those standards is letting them see the true /. and, as such, we should probably have the app guy, the cow guy, and APK.
This is where we fling poop and screech like howler monkeys. It's what we do. We shouldn't get out the fancy China, we're just going to break it when they leave.
"China" should not be capitalized when referring to dinnerware.
The pedantic guy is part of the true /. as well.
Now I know about china. And knowing is half the battle.
"So long and thanks for all the fish."
dlopen(3) and its friends allows a C developer to dynamically link to symbols at runtime, the ClassLoader.forName() method allows a Java developer to dynamically load classes at runtime, and other languages have similar constructs. Runtime linking is an extremely useful feature for implementing a module system so in-house developers or 3rd parties can create new implementations of well-defined interfaces; Apache HTTPD is a good example of how to use this effectively. Runtime linking has a number of benefits, not the least of which is security: a user (at runtime) can disable large chunks of code to limit the attack surface.
The May 2015 The State Of Go talk addressed this feature in the execmodes document, specifically:
It states that neither of these are to be available in 1.5 and indeed they do not appear to be. What's your take on runtime linking? Do you consider it a priority and do you think it'll be available in the next release?
Gentlemen,
I've really enjoyed Mark Summerfield's book (http://www.qtrac.eu/gobook.html). I keep it with me. I am seriously considering purchasing yours as well.
Should I?
Thanks.
The heat from below can burn your eyes out
Go has eschewed error handling at the end of a scope using exceptions in favor of placing the error handling after nearly every statement. Do you accept the criticism that having all of the the error handling interleaved with the main program flow can negatively affect readability and comprehension? If the problem exists, are there techniques developers should be using to avoid it? Are there plans to replace the 'if err != nil { ... }' boiler plate after each statement with syntactic sugar?
I was curious out of all the Golang books that currently exists, how does this book, "The Go Programming Language," differ from the rest and fit into the landscape of Golang? I've read some of the other books like "Go Programming Blueprints" and "Go in Action." Specifically with "Go in Action," the table of contents seems similar to your book.
I guess what was your motivation to write this book and how will it be different from all the rest? Brian, are you hoping this book becomes what "The C Programming Language" became but for Golang?
What is your approach for writing such short, clear and concise books? What is your writing process?
Do you (either) play Go? To what strength?
Birds are not dinosaur descendants;birds are dinosaurs, for all useful meanings of "birds", "are" and "dinosaurs"
Brian has cemented himself in computer science legend with The C Programming Language. What things made you decide to write The Go Programming Language? And why now?