News for hackers. Stuff that matters.
Re:Rob Pike interview by cletus on Thursday April 30, 2020 @12:00PM (#23032314)
I have huge respect for Rob Pike but there's a bit of revisionist history going on here.

Go was originally envisioned as a systems programming language. It was often called "a better C". This exposed Rob Pike's lack of experience in the area (IMHO) because anyone who had done any systems programming at all knew that garbage collection made any systems language a nonstarter.

Where Go succeeded was completely unintentional (as as often the case): it was (and is, IMHO) a better Python. Go hasn't attracted C, C++ or even Java programmers. It attracted Python refugees. So it's no accident the touted use cases ("cloud infrastructure") are orchestration problems.

But at the same time, "cloud infrastructure" here refers to what, exactly? Kubernetes? Etcd? I think those could've been written in anything. More to the point, users of those don't really use Go as a result, right?

I think even Google found that internally Go was cannibalizing Python usage and little else.

Lots of Go newbies bemoan the lack of generics. I was never one of them. It's not the problem people think it is (IMHO). I'll be interested to see what this solution is even if simply means we can stop having having this conversation about Go not having generics. That alone is a win.

So I think there's two areas where Go screwed up. two big and one small.

The small one is the lack of IDE support. You don't need to write an IDE. You just need to have sufficient integration into Jetbrains IDEs (at a minimum).

The first big problem--and it still is a problem--is the dependency management, in that there wasn't a solution to this out of the gate (unlike, say, Rust and Crate). Like I was shocked the first time I saw import 'github.com/some_random_user/...' I dare you to go look at any even moderately sized Go project and unravel the levels of dependencies (including repeated dependencies, which may or may not impact binary size, I'm not sure). It's kind of a mess.

The second is, oddly, on concurrency or rather multi-core and multi-CPU utilization. Aren't we still in the GOMAXPROCS environment variable era? Really?

EDIT: adding this quote from Rob Pike in 2012 [1] as it's a first-hand account of Go's original design goals:

> I was asked a few weeks ago, "What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++.

[1]: https://commandcenter.blogspot.com/2012/06/less-is-exponenti...

Re:Rob Pike interview by floren on Thursday April 30, 2020 @12:04PM (#23032370)
> Go was originally envisioned as a systems programming language. It was often called "a better C". This exposed Rob Pike's lack of experience in the area (IMHO) because anyone who had done any systems programming at all knew that garbage collection made any systems language a nonstarter.

Yeah, Rob Pike and Brian Kernighan definitely lacked experience in C and systems programming.

Re:Rob Pike interview by cletus on Thursday April 30, 2020 @12:11PM (#23032468)
AFAIK Brian Kernighan was never involved with the development of Go. He just likes to try new things and wrote a book about it.

Rob Pike is probably most famous for his involvement in Plan9 (prior to this). I honestly don't know what this experience entailed.

Re:Rob Pike interview by mav3rick on Thursday April 30, 2020 @12:31PM (#23032762)
If you didn't know you should have clarified before making such sweeping statements. Who knew writing an OS would count as systems programming experience.
Re:Rob Pike interview by cletus on Thursday April 30, 2020 @12:42PM (#23032914)
"writing an OS" is a sweeping, unsupported and inaccurate statement. You can be involved in Linux and, say, write the ext4 filesystem or Wifi drivers. Those are pretty low-level. You could also write shell utilities like ls in probably anything where you're just using OS APIs. Is that low-level? I would say not.
Re:Rob Pike interview by SllX on Thursday April 30, 2020 @05:53PM (#23036617)
My friend, my comrade in arms, I have a link[1] for you. If you read only one of these papers, then please just read the first one, but please note the author credits on almost all of them.

[1] http://doc.cat-v.org/plan_9/4th_edition/papers/

EDIT: In the past half hour, the original website went down, I don't think it is related to my link. Here is a different link with the same contents:

https://9p.io/sys/doc/

Re:Rob Pike interview by anthk on Thursday April 30, 2020 @01:32PM (#23033516)
The C, Unix and AWK creators know nothing on low-level stuff.

Please, kid.

Re:Rob Pike interview by mav3rick on Thursday April 30, 2020 @01:55PM (#23033834)
Oh my god. Can you at least do your research now ? They wrote the core bits and not just userspace utils. Did you read what they wrote before blustering here ?
Re:Rob Pike interview by frank2 on Thursday April 30, 2020 @12:17PM (#23032556)
Mostly systems programming. In particular, he wrote its graphics system, then rewrote it, then rewrote it again. He led Plan 9 for many years. So, he has plenty of experience in systems programming.

What he seems to lack IMHO is sufficient curiosity about computing innovations not produced by him or the prestigious institutions he has worked for (Bell Labs, Google).

Re:Rob Pike interview by sdegutis on Thursday April 30, 2020 @12:45PM (#23032958)
There's multiple levels of experience. Someone can get really good at the technical solutions without learning what the human problems are and how to solve them.

For example, someone might dismiss IDEs as being unnecessary because technically the same job can be done without them by a superior human being, so the solution is to just be a superior human being.

Or as another example, someone could completely dismiss syntax highlighting as being useless for the superior, implying that the solution to the problem syntax highlighting solves is to just also become a superior human being.

There are multiple layers to any solution, and if one of them is missing, the others are kind of shaken out of balance.

Re:Rob Pike interview by floren on Thursday April 30, 2020 @12:21PM (#23032611)
Kernighan helped write Unix and Plan 9, literally wrote the book on C, and is the "K" in awk, among other achievements.

Rob Pike worked on Unix, helped design and implement Plan 9 and Inferno, and co-designed UTF-8.

Re:Rob Pike interview by microtherion on Thursday April 30, 2020 @02:30PM (#23034320)
Apart from UTF-8, the piece of software he designed I used most was the sam text editor. An opinionated and rather quirky design, with some internals that made quite enthralling reading for me at the time: http://doc.cat-v.org/plan_9/4th_edition/papers/sam/
Re:Rob Pike interview by floren on Thursday April 30, 2020 @02:53PM (#23034624)
It's an interesting editor, especially the split between the editor itself and the graphical frontend. That split has helped me work on some very limited systems, thanks to `sam -r`.

Personally, I prefer acme; it's my daily driver editor.

Re:Rob Pike interview by yiyus on Thursday April 30, 2020 @12:51PM (#23033027)
If having worked in UNIX, Plan 9 and Inferno (and saying "having worked" is quite an understatement), having designed and implemented several programming languages (Alef, Squeak, Limbo, Sawzall, Go, ...), and having been an important part of Bell Labs and Google during their respective peaks is considered lack of experience in systems programming, what on earth would you consider as enough experience?
Re:Rob Pike interview by mav3rick on Thursday April 30, 2020 @01:56PM (#23033847)
Flame bait on HN
Re:Rob Pike interview by streb-lo on Thursday April 30, 2020 @12:42PM (#23032910)
> This exposed Rob Pike's lack of experience in the area

You don't write an UNIX derivative with a lack of system programming experience.

Re:Rob Pike interview by mseepgood on Friday May 01, 2020 @07:37AM (#23041060)
> AFAIK Brian Kernighan was never involved with the development of Go.

I think he meant Ken Thompson.

Re:Rob Pike interview by marcocampos on Thursday April 30, 2020 @01:53PM (#23033809)
Rob Pike is also the co-author of UTF-8.
Re:Rob Pike interview by nostrademons on Thursday April 30, 2020 @12:39PM (#23032864)
Go was always intended for writing the type of networked application servers that are common in Google's infrastructure. [I was at Google when it was released - I thought you were too?]

It's succeeded at basically the same niche that it was intended for. The difference, as another commenter points out, is Rob Pike's ignorance of how the world outside of Bell Labs & Google had changed. In the 80s you would've built networked microservices in C. In the 2010s you built them in Python or Node.JS. Hence if you have a new language that's a success in the microservice application-server market, it will end up cannibalizing Python and Node.JS, not C. Python cannibalized Java in the 2010s and late 00s, and Java cannibalized C in the 2000s and late 90s.

Go is still inferior to Python in prototyping, in web development, and in data-science. (I used it for the former 2 while still at Google, and decided it wasn't an upgrade.) But it's superior for production microservices, and that's an increasingly large market these days.

Re:Rob Pike interview by cletus on Thursday April 30, 2020 @01:28PM (#23033462)
> Go was always intended for writing the type of networked application servers that are common in Google's infrastructure. [I was at Google when it was released - I thought you were too?]

I was (2010-2017 to be exact) so I remember how this was communicated but internally and externally. This HN submission [1] to HN from 2011 reflects my recollection of that messaging that Go was a better C.

Even better, Rob in his own words [2]:

> I was asked a few weeks ago, "What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++.

> Go is still inferior to Python in prototyping, in web development, and in data-science

On the data science point, I certainly agree that nothing looks likely to displace numpy/scipy anytime soon. Python's much-maligned GIL does simplify C module extensions and, I believe, was a key contributor in Facebook choosing to move to Mercurial many years ago (long before my time).

I wrote a fairly significant internal app at Google in Python and essentially swore I'd never do it again. The way I like to put it is that I don't want to write unit tests for spelling mistakes. I haven't used Go for Web development but I'd already choose it over Python just for static typing.

As an aside, I found the protobuf integration in Python to be basically terrible. Perhaps it's improved in the last 7+ years though.

[1]: https://news.ycombinator.com/item?id=2535206

[2]: https://commandcenter.blogspot.com/2012/06/less-is-exponenti...

Re:Rob Pike interview by harikb on Thursday April 30, 2020 @12:27PM (#23032706)
> garbage collection made any systems language a nonstarter.

Unless you want to bucket all systsme programming in to one bucket, I will say this

#1 If your goal is to make the most efficient and fast code (garbage collected or not), it is not clear gc-less languages are always better. Sometimes, not free-ing the memory at the first possible time will actually be good for you overall.

#2 If you are writing anything with serious mem usage in Go, you will optimize for allocations using sync.Pool or some other form of reuse. I am sure well written C++ code would have to do the same tricks. reduce >> reuse >> recycle. Both GC and free() are recyclers. Sure, one could argue GC could provide more control.

I 100% agree there are cases C/C++ or Rust would be better for 20% of the trickier situation, but let us not base it all on the presence of garbage collector.

Heck, some of my Java code works faster than even my Go code. I don't blame Java for having a garbage collector.

Re:Rob Pike interview by cletus on Thursday April 30, 2020 @12:52PM (#23033041)
> #1 If your goal is to make the most efficient and fast code (garbage collected or not), it is not clear gc-less languages are always better. Sometimes, not free-ing the memory at the first possible time will actually be good for you overall.

Which is why languages like C++ let you write and use your own allocators. There are lots of reasons to do this (eg word alignment).

And while I agree that it's certainly possible that delayed freeing may be beneficial I'm not convinced it's a problem in practice, at least when you compare it to how often common GC problems are (eg memory leaking (admittedly also a problem with manual allocation), out-of-control process memory growth and STW pauses).

#2 If you are writing anything with serious mem usage in Go, you will optimize for allocations using sync.Pool or some other form of reuse.

True, and I mentioned this in another comment: the idea that you can get around many GC issues by using object and memory pools.

> Heck, some of my Java code works faster than even my Go code.

Why should that be surprising? The JVM at this point has >25 years of engineering effort into it and (IMHO) it doesn't get half the credit it deserves from the devotees of the latest flavour of the month.

Re:Rob Pike interview by ori_b on Thursday April 30, 2020 @05:59PM (#23036687)
> Which is why languages like C++ let you write and use your own allocators. There are lots of reasons to do this (eg word alignment).

You're aware that the Go allocator is written in Go, right?

Re:Rob Pike interview by erik_seaberg on Thursday April 30, 2020 @07:12PM (#23037359)
Is there a way to write and use your own allocator, or is it off limits to everyone outside the language design team?
Re:Rob Pike interview by bakul on Thursday April 30, 2020 @01:50PM (#23033759)
> Go was originally envisioned as a systems programming language. It was often called "a better C". This exposed Rob Pike's lack of experience in the area (IMHO) because anyone who had done any systems programming at all knew that garbage collection made any systems language a nonstarter.

You don't know what you are talking about. Someone who has written operating systems, windowing systems, editors, many many tools & library functions, and well regarded books on programming doesn't exactly lack systems programming experience.

Re:Rob Pike interview by k__ on Thursday April 30, 2020 @12:06PM (#23032411)
"anyone who had done any systems programming at all knew that garbage collection made any systems language a nonstarter."

This is quite funny.

I remember when Go was released its creators were all like "GC is good enough now" and then Rust came around the corner blowing that whole premise out of the window.

Re:Rob Pike interview by zozbot234 on Thursday April 30, 2020 @12:13PM (#23032493)
Rust used to be a GC-based language too - very similar to Go in fact. They didn't abandon GC until sometime prior to the 1.0 release, well after Go first came out.
Re:Rob Pike interview by magila on Thursday April 30, 2020 @12:38PM (#23032851)
Early on Rust had optional GC boxing before it morphed into Rc/Arc, it never required GC of heap allocated objects like Go/Java/C# et al. Deterministic resource management has always been the default with Rust.
Re:Rob Pike interview by cletus on Thursday April 30, 2020 @12:16PM (#23032532)
I guess every language has its devotees. Go is no exception. My own personal experience with talking to more than a few of these people were that they tended to be a bit... naive and overly optimistic, which is fine, but often the lessons of history were ignored.

The way I like to put it is Go devotees operate under 2 rules:

1. Whatever your complaint about Go is, it's totally not a problem (eg stop-the-world GC pauses, a longstanding issue that any experienced Java engineer could commiserate at length about);

2. Even if it is a problem--which remember it is not--it's totally fixed in Go 1.(N+1) where 1.N is the current version.

Re:Rob Pike interview by throwaway894345 on Thursday April 30, 2020 @12:35PM (#23032817)
This comment is transparently trying to incite a flame war, but I'll try to take it on a more productive tangent.

> eg stop-the-world GC pauses, a longstanding issue that any experienced Java engineer could commiserate at length about

This is a really interesting example, because it shows the lack of nuance in the anti-GC position. By your logic, because Java's 100ms GC pause times have been problematic (and yes, I'm aware that Java's upcoming GC will boast significantly improved pause times and that it's theoretically possible to tune a Java GC for low pause times even if no one has managed it in production) Go's 5us pause times will be equally problematic. Because a pause is a pause, right--why should we muddy the waters with considerations like "duration"?

Single- or double-digit microsecond pause times completely change the conventional wisdom about the kinds of applications GC is suitable for. There are still lots of hard real time applications that Go's GC won't be suited for, but there are many soft real time applications for which Go would be fine (or at least the issues will be libraries or support for target architecture/platform and not GC).

Re:Rob Pike interview by cletus on Thursday April 30, 2020 @01:01PM (#23033159)
> This is a really interesting example, because it shows the lack of nuance in the anti-GC position.

I wouldn't call my position strictly anti-GC. I would simply say that GC isn't the panacea it's made out to be and it is at least in part a false economy for at least three reasons:

1. You may need to tune your VM/GC parameters (as you mention). There's a cost to this;

2. GC can make it harder to identify memory leaks (which are still a problem through, for example, dangling references). I've worked on C++ systems where we instrumented many things including process size, which was basically just a flat line. As soon as it wasn't, you knew there was a problem. And this was for a server that read about ~6GB/second off a NIC.

3. Crashing a program due to accessing unallocated memory tends to give a more immediate signal of a problem, which is more often than not better for development.

Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @03:20AM (#23039788)
My experience at CERN ATLAS HLT means that those C++ processes would also have a highly tuned custom multithreaded memory allocator, malloc() and new aren't even in the game to start with, and most likely one is doing a custom protocol at IP level.
Re:Rob Pike interview by zeroc8 on Saturday May 02, 2020 @03:04AM (#23049946)
Well, my personal experience with C++ developers is, that they are a bit ...naive and overly optimistic, when it comes to taking a look at the real world, with real deadlines. "I just write my own half assed string class" comes to mind... As if they are developing in a vacuum, with no competition out there. This really pisses me off.
Re:Rob Pike interview by wbl on Thursday April 30, 2020 @12:26PM (#23032692)
Pauseless concurrent collectors have existed for decades.
Re:Rob Pike interview by rakoo on Thursday April 30, 2020 @12:35PM (#23032813)
> it was (and is, IMHO) a better Python

And in my opinion, it is a better Java. It succeeds in the niche where Java is used today: big softwares, shared by numbers of teams, working on different timezones and in different languages, and with varying degrees of skill.

Go is so stubborn it takes the fun out of programming and ironically that's a good thing: when code can't be tied to anything personal, it is much more easily shared with anyone who works on it. I have found that writing Go itself is definitely tedious, sometimes boring, and the fun is not there; _however_, fun is had when you have a working binary that is statically compiled, reasonably devoid of bugs and surprisingly performant. You take joy in actually using pieces of software, not in fine-tuning your formatting rules.

The language itself is boring, but it's the same boring for everyone and it happens to be working well so you tend to focus more on the solution than on the intricacies. This, IMO, is the success of Go

Re:Rob Pike interview by pjmlp on Thursday April 30, 2020 @05:04PM (#23036112)
Better Java 1.0, yes.

Better Java 14, definitely not.

Re:Rob Pike interview by rakoo on Thursday April 30, 2020 @08:14PM (#23037803)
Better as a tool, not as a language. By being uninteresting it removes focus on itself so we can better focus on what also matters: designing, measuring, documenting, fixing what is not code nor software
Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @01:32AM (#23039396)
Java has been doing that for 25 years, still don't see how it is better than Java.

I stop copy pasting code and using code generators around 15 years ago.

Re:Rob Pike interview by jtakkala on Thursday April 30, 2020 @12:28PM (#23032728)
> Go was originally envisioned as a systems programming language. It was often called "a better C". This exposed Rob Pike's lack of experience in the area (IMHO) because anyone who had done any systems programming at all knew that garbage collection made any systems language a nonstarter.

I've said this before, but even back in early 2014 Rob Pike had said that he regretted the term "systems programming" because people misunderstood him to mean it as a language for writing operating systems, when what he meant was a language for writing servers, although that later evolved to cloud infrastructure.

He answers this at 6:50 here, https://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Pa...

Re:Rob Pike interview by mgummelt on Thursday April 30, 2020 @12:29PM (#23032742)
> This exposed Rob Pike's lack of experience in the area (IMHO) because anyone who had done any systems programming at all knew that garbage collection made any systems language a nonstarter.

What exactly do you mean by systems programming? Many successful databases (Cassandra, Kafka, ElasticSearch) are built on the JVM.

Re:Rob Pike interview by rsj_hn on Thursday April 30, 2020 @01:03PM (#23033170)
Many people consider "systems programming" to be close to the hardware stuff that is not visible by users. Userland code would generally not fall into this category, with the weird proviso that some OSs put a lot of GUI code into the kernel (cough windows cough). In this traditional classification, a database is considered an "app". The "find" command is an app. People log in and use the DB and the find command. The Bash shell would be an app. If a user is using it, it's an app.

If it is not user visible but exists to manage app access to hardware resources, it's a system. So a memory management system would not be an app. Neither would power management or IO or a scheduler. But these systems might have administrative apps that admins login and use (like Microsoft's "Control Panel" app -- to control settings for the system code. Similarly some apps might have their own memory management system. But the principle still applies.

I understand there is definition creep as more and more layers sit between the user and the hardware, so todays application code might, in some cases, be viewed as tomorrow's system code, but this is the original meaning.

Re:Rob Pike interview by cletus on Thursday April 30, 2020 @12:38PM (#23032850)
I guess "systems programming" is an ambiguous term here like I personally wouldn't call something "systems programming" just because it's server-side.

What I mean is things that are basically kernel-level or embedded.

Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @03:22AM (#23039805)
So given embedded soft real time bare metal Java AOT compilers, Java gets to be a systems language as well. :)

https://www.ptc.com/en/products/developer-tools/perc

As does Go actually,

https://www.f-secure.com/en/consulting/foundry/usb-armory

https://labs.f-secure.com/blog/tamago/

Re:Rob Pike interview by blablabla123 on Thursday April 30, 2020 @12:23PM (#23032651)
> I have huge respect for Rob Pike but there's a bit of revisionist history going on here.

> Go was originally envisioned as a systems programming language.

Already with the release of Go 1 it was quite clear that Go has its best fit as a Server language. I don't think the usage of a language can really be planned. But looking at the previous works of the language authors, it's clear that they worked on solutions for distributed systems.

Also I think like 10 years ago people would have written stuff in C++ that today nobody would even remotely consider writing in it.

Re:Rob Pike interview by mgummelt on Thursday April 30, 2020 @12:37PM (#23032833)
> Already with the release of Go 1 it was quite clear that Go has its best fit as a Server language.

CLIs as well. Before Go, how did you build a native CLI in a garbage collected language?

Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @03:26AM (#23039832)
I don't know, by using one that had support for AOT compilers?

Something like Java, .NET, OCaml, Haskell, D, Scheme, Common Lisp?

Yes, it isn't a typo regarding Java and .NET, there are AOT compilers for them since around 2000.

Re:Rob Pike interview by microtherion on Thursday April 30, 2020 @02:32PM (#23034364)
> garbage collection made any systems language a nonstarter

There are a significant number of systems that demonstrate otherwise: LISP machines, SmallTalk, Oberon.

Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @03:27AM (#23039840)
Re:Rob Pike interview by empath75 on Thursday April 30, 2020 @12:01PM (#23032332)
> Kubernetes? Etcd? I think those could've been written in anything.

Kubernetes was originally written in java and was transpiled to go.

Re:Rob Pike interview by pier25 on Thursday April 30, 2020 @12:21PM (#23032610)
> it was (and is, IMHO) a better Python

Also a better NodeJS and PHP.

Re:Rob Pike interview by derefr on Thursday April 30, 2020 @12:41PM (#23032900)
"Systems programming" isn't limited to OS kernels. I'd call, say, the Coreutils programs "systems programming." But it'd make perfect sense to implement those (or things like them) in Go†. And that's the niche I see a lot of modern Go software addressing, too: simple new OS-packagable CLI utilities, able to be written with less gotchas than if they were written in C.

† I say this because we already have an alternative to GNU Coreutils for memory-constrained embedded systems, in the form of Busybox. If Coreutils had to "serve two masters"—be both powerful at scale on big multi-core systems, and functional on tiny embedded boxes—then Go would make less sense. (Rust would be pretty good for that, though. See e.g. ripgrep.)

Re:Rob Pike interview by pacala on Thursday April 30, 2020 @12:17PM (#23032555)
There is 'kernel device driver' kind of systems, and there is 'kubernetes module' kind of systems. Most of the modern infrastructure work happens for the latter use-case. GC is a very reasonable choice, provided you know what you're doing.
Re:Rob Pike interview by ddevault on Thursday April 30, 2020 @12:23PM (#23032649)
I agree that the term "systems programming" is getting stretched a bit thin. Maybe we need a new term for the k8s variety - I propose "infrastructure programming".
Re:Rob Pike interview by seneca on Thursday April 30, 2020 @12:15PM (#23032520)
A couple of nitpicks.

> More to the point, users of [Kubernetes] don't really use Go as a result, right?

Yeah, they do actually. The vast majority of tooling in the Kubernetes space is also written in Go. I don't know about etcd.

> The small one is the lack of IDE support. You don't need to write an IDE. You just need to have sufficient integration into Jetbrains IDEs (at a minimum).

I might be missing what you're saying here, but Goland has been around for a decent while now, and the full IntelliJ plugin has as well. Before that, Atom or vi with some plugs I've since forgotten the name of worked well enough.

I agree with your overall points though, especially on dependency management.

Re:Rob Pike interview by cletus on Thursday April 30, 2020 @12:24PM (#23032666)
> I might be missing what you're saying here, but Goland has been around for a decent while now, and the full IntelliJ plugin has as well.

Right. That's true now (and, like you say, has been for some times) but was not the case for years. I was responding to this point in the interview talking about initial development, not the current state of the world, just to clarify.

Re:Rob Pike interview by seneca on Thursday April 30, 2020 @12:34PM (#23032801)
Yep, that makes more sense. I was a vimgo user before Goland was available, and I found it to be good enough, but it definitely wasn't something that would attract new users.
Re:Rob Pike interview by acdha on Thursday April 30, 2020 @12:34PM (#23032795)
I’m not sure whether this is the same level of big problem but I wish that they’d taken C’s other major failure more seriously and required error handling. Every Go-based tool that I use has at some point failed because an error was ignored. That necessarily doesn’t mean exceptions — simply having the compiler fail like it does for an unused import for every case where an error is assigned but not subsequently accessed would be sufficient.
Re:Rob Pike interview by kyrra on Thursday April 30, 2020 @12:24PM (#23032660)
My take on the "systems programming" comment Rob made, it wasn't meant as "kernel" level systems programming, but more server-side systems. When he started working on Go, it was done out of his annoyance with C++ on the very large project he worked on at Google.
Re:Rob Pike interview by richm31415 on Thursday April 30, 2020 @12:27PM (#23032697)
> The small one is the lack of IDE support. You don't need to write an IDE. You just need to have sufficient integration into Jetbrains IDEs (at a minimum).

Visual Studio Code with the Go extension is very good.

Re:Rob Pike interview by riazrizvi on Thursday April 30, 2020 @12:23PM (#23032640)
> anyone who had done any systems programming at all knew that garbage collection made any systems language a nonstarter

Very interesting, can you elaborate with an example?

Re:Rob Pike interview by cletus on Thursday April 30, 2020 @12:35PM (#23032808)
So I wanted to find a good source for this and interestingly came across this article from 2011, titled "Go to C: Could Go Replace C?" [1] (HN submission [2]) and this point came up even then [3].

I also found there are subsets of Go aimed at filling this use case because of the GC issue [4] (eg Emgo [5], TinyGo [6]).

The Fuchsia Language Policy [7] also points to this. Fun fact: the networking stack in Fuchsia was written in Go because of Dave Crawshaw, who was (and I assume still is) a big Go advocate. I got into an argument with him once about stop-the-world GC pauses in Go. Anyway, the Fuchsia project has largely been unhappy with this ever since because there is an overhead to using Go that essentially you can't get rid of. Using memory and object pools can solve many but not all problems. And at some point I suspect they'll replace the networking stack with something not written in Go.

[1]: http://www-cs-students.stanford.edu/~blynn/c2go/

[2]: https://news.ycombinator.com/item?id=2535206

[3]: https://news.ycombinator.com/item?id=2535386

[4]: https://github.com/golang/go/issues/29147

[5]: https://github.com/ziutek/emgo

[6]: https://github.com/tinygo-org/tinygo

[7]: https://www.reddit.com/r/golang/comments/f92nkc/golang_is_no...

Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @03:29AM (#23039853)
F-Secure's TamaGo supports full Go on bare metal, though.

https://www.f-secure.com/en/consulting/foundry/usb-armory

Re:Rob Pike interview by riazrizvi on Thursday April 30, 2020 @12:54PM (#23033059)
So there's some conflict, but mainly the problem is that GC is a critical problem in real-time systems that cannot have performance interrupts. Languages for these applications need to be able to bypass GC.
Re:Rob Pike interview by dehrmann on Thursday April 30, 2020 @12:33PM (#23032779)
> It attracted Python refugees

Honest question: other than parallelism and performance, what are the main reasons someone would switch from Python to Go?

Re:Rob Pike interview by nostrademons on Thursday April 30, 2020 @12:46PM (#23032982)
Single deployment binary, static typing, gofmt, and takes "there should be one and only one obvious way to do it" even farther than Python. It's very easy for new team members to ramp up on a Go codebase - formatting is standardized, libraries are standardized, and the language encourages very simple readable constructs (at the expense of brevity and abstraction, sometimes). That makes it attractive for companies in their growth stage, where you're working in teams but still have constraints on fast execution (CPU) and fast execution (developer velocity).

IMHO Go is still inferior to Python for solo-developer projects.

Re:Rob Pike interview by cletus on Thursday April 30, 2020 @01:06PM (#23033205)
100% this.

My personal view is that dynamically typed languages are largely falling out of favour with Javascript being the one glaring exception (and even there if I were starting a project today I'd use Typescript).

On the single deployment binary issue, let me just underline that point with one word: virtualenv.

Re:Rob Pike interview by guggle on Saturday May 02, 2020 @05:44AM (#23050604)
> On the single deployment binary issue, let me just underline that point with one word: virtualenv.

can you expand ?

Re:Rob Pike interview by guggle on Saturday May 02, 2020 @05:30AM (#23050547)
I'm a python user and parallelism and performance are not the reason I tried Golang because I had no poblem with these for my use cases. However, it solves the only problem I have with Python which is deployement/distribution: basically your server can be a single binary. Best of all, you can target whatever platform with ease. You don't have to worry about your client having the right python or the needed dependencies and this comes with no effort on your part.

Given that the language is relatively easy to grasp and that the standard library covers all the basic needs of a server application, that alone is a huge win.

Python still has more and better libraries for certain tasks though.

Re:Rob Pike interview by zomglings on Thursday April 30, 2020 @12:44PM (#23032939)
I haven't switched from Python to Go, but I program heavily in both languages and can offer an additional point here:

Go makes it easy to produce binaries for any target platform that execute without requiring a working Go installation.

This ease of packaging makes Go my default language when I'm writing developer tooling - for example, if I know that team-mates are going to have to run tools that I write but I don't want to make assumptions about their development environments.

There is one caveat: This only works well if you avoid platform-specific functionality (e.g. syscall package) and CGO.

Re:Rob Pike interview by Lunrtick on Thursday April 30, 2020 @12:42PM (#23032916)
I think a major one is simply the easy of deployment - one self serving binary is quite refreshing after dealing with wsgi etc.

I suppose the static analysis is quite cool too...

Re:Rob Pike interview by mgummelt on Thursday April 30, 2020 @12:39PM (#23032865)
static types, native builds, cross-platform builds
Re:Rob Pike interview by _ph_ on Thursday April 30, 2020 @04:04PM (#23035458)
You just need to have sufficient integration into Jetbrains IDEs (at a minimum).

Are you aware that Jetbrains makes an IDE for Go, called GoLand?

Re:Rob Pike interview by jrockway on Thursday April 30, 2020 @12:46PM (#23032973)
> The small one is the lack of IDE support. You don't need to write an IDE. You just need to have sufficient integration into Jetbrains IDEs (at a minimum).

Jetbrains wrote their own Go IDE, goland. The rest of us use an LSP client that talks to gopls. I have used that for about a year and it does everything that I would want an IDE to do; accurate context-sensitive completion, an easy way to peek at signatures and documentation, jump to definition, accurate renames, import organization/cleaning, etc. I am continually surprised at how good a job it does when I'm 8 nested protos deep and it can still complete struct keys and values (i.e. you can type "&Foo{ B" and it will complete it to "&Foo{ Bar: &Bar{}").

> The first big problem--and it still is a problem--is the dependency management, in that there wasn't a solution to this out of the gate (unlike, say, Rust and Crate). Like I was shocked the first time I saw import 'github.com/some_random_user/...' I dare you to go look at any even moderately sized Go project and unravel the levels of dependencies (including repeated dependencies, which may or may not impact binary size, I'm not sure).

I am pretty happy with go's approach to dependency management in the Go module era. You can tell the Internet "a little duplication is better than a little dependency," which Go does, but they will do it anyway. I like that I have tools that can just vendor all my dependencies (mostly so that CI builds can be completely stateless and free from network communication), and that every module I use is declared in go.mod file that the toolchain itself keeps tidy and accurate. The mechanics of an upgrade are a breeze -- find the module and update the version number next to it. If I want to edit some module I depend on, I can just use gohack and it checks out the source code in a convenient location and edits go.mod to make go pick up that version of the code instead of the Internet's version. And, you can at least figure out why you have a certain dependency with "go mod why". Finally, I love that "go doc xxx.Foo" is aware of what modules my module uses, so that I always get the right symbol. I would kill for "typescript doc xxx" or "clang doc yyy". (Seems like other people prefer 80 browser tabs with random websites loaded to do the same thing. I like my command-line, or at least some IDE integration.)

I have used other approaches to dependency management and they haven't made me as happy as Go's. npm is slow and fills my entire screen with garbage, only to eventually inform me that "module A depends on module B which depends on module C which has a SEVERE SECURITY VULNERABILITY!!!!!!! and there's nothing you can do except whine on Github!" I like Bazel's WORKSPACE approach, allowing me to specify the exact sha256 of the compiler toolchain I want to use, and every version of every transitive dependency. Somehow I feel like nobody is that serious about dependency provenance, though, and they invent a lot of clever workarounds to avoid maintaining that file. But at least you can be correct and in control if you want to. (With go projects, the biggest problem I've had is keeping protoc, protoc-gen-go, and the Go proto library in sync. Go doesn't handle non-Go things, and that really sucks. You have manually manage that stuff, and people mess it up. Or use Bazel, which I've tried and came to the conclusion that nobody else has ever done.)

So all in all, I think Go's IDE support and dependency management meet my needs. I dare say I think they're great! All of this stuff is relatively recent, though, so there are probably a lot of people stuck with their code in ~/go/src/github.com/me/my-app that manually run "goimports" from time to time. That sucks. But there are better tools available!

Re:Rob Pike interview by cletus on Thursday April 30, 2020 @01:14PM (#23033301)
Hey, Rockway, how are you?

Yeah, I should clarify: I was responding to Rob's point in the interview where he was talking about tooling and IDE integration from the outset rather than the current state of the world.

As for Jetbrains writing their own IDE... well, yes and no. Sure there's a separate product from a user perspective but IntelliJ has had a Go plugin for several years. You'll probably find Goland (just like all the other little-IntelliJs like AppCode, PyCharm and RubyMine) are little more than stripped down versions of IntelliJ's code base with a different default set of plugins. My point is that Goland wasn't a "new IDE from scratch" level of investment by Jetbrains and that a third-party plugin could've been largely equivalent.

Re:Rob Pike interview by jrockway on Thursday April 30, 2020 @01:52PM (#23033783)
Good! Still technically alive anyway.

You're right that go didn't have amazing tooling from day 1, but the tools it did have were enough for me to change my workflow. I never cared about autoformatting (too many knobs to turn) before gofmt, and now I can't live without autoformatters.

Coming from a dynamic language background, I also never really got tools that claimed to provide completion to work, so I ignored them for most of my career. I worked on a Java project at Google and Emacs worked fine. Now there is LSP, and I first tried it with gopls, and it worked perfectly. Now I can't live without it, and try to avoid having to work in languages that don't have a good LSP implementation. (I am also very annoyed by the multitude of C/C++ projects whose crazy bespoke build systems manage to make clangd not work. That's the reality of tools coming along late; sometimes it's too late to have an impact because people have gotten by without the tool and are happy to continue with that.)

I have also used a little Goland. At my last job, we replaced a lot of PHP and Expect scripts with Go programs, and it was quite the journey to keep people happy with their existing IDEs. (Everyone had the Jetbrains you-get-everything pack, so at least Goland was free.) Goland is really a from-scratch implementation of editor support for Go. They had no other choice... but it makes different decisions from the open source tools which is quite the pain point. (I remember it importing opentracing-go as a plain "github.com/whatever/opentracing-go" and let things in the file refer to that as opentracing.Whatever. goimports wrote it more explicitly as 'opentracing "github.com/whatever/opentracing-go"'. I still don't know how that works, but apparently it did, and so diffs would always oscillate between the two until we convinced Goland to just run goimports.

What I like about go's tool support is that it's done a good job of adding features for people that want them, and letting those people use the tools without upstream dependencies knowing about those tools. I started using go modules before it was particularly popular in the community, and it didn't cause much trouble. (People sure liked to force push to their version branches, though, causing go.sum checks to fail. And people would always blame the Go team for that, unfortunately.)

I have a hunch that not many people are using gopls, but it works perfectly on codebases where I know the authors never used it. That is a pretty big deal and is better than what a lot of other languages do. "We have this new thing... restructure your codebase to try it out." It's nice for new codebases, but even nicer when you don't have to do that.

So all in all, I am very satisfied with the tooling situation.