Go Has Added Valgrind Support
Posted4 months agoActive3 months ago
go-review.googlesource.comTechstoryHigh profile
excitedpositive
Debate
40/100
GoValgrindMemory ProfilingDebugging
Key topics
Go
Valgrind
Memory Profiling
Debugging
The Go language has added support for Valgrind, a memory debugging tool, which has generated excitement and discussion among developers about its potential uses and limitations.
Snapshot generated from the HN discussion
Discussion Activity
Very active discussionFirst comment
2h
Peak period
123
Day 1
Avg / period
28.2
Comment distribution141 data points
Loading chart...
Based on 141 loaded comments
Key moments
- 01Story posted
Sep 23, 2025 at 5:26 AM EDT
4 months ago
Step 01 - 02First comment
Sep 23, 2025 at 7:17 AM EDT
2h after posting
Step 02 - 03Peak activity
123 comments in Day 1
Hottest window of the conversation
Step 03 - 04Latest activity
Oct 2, 2025 at 3:25 AM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45344708Type: storyLast synced: 11/22/2025, 11:00:32 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
[1] https://github.com/cloudwego/goref
Disclaimer: I work on continuous profiling for Datadog and contribute to the profiling features in the runtime.
I think in many cases you'd want the reference chains.
The GC could certainly keep track of those, but at the expense of making things slower. My colleagues Nick and Daniel prototyped this at some point [1].
Alternatively the tracing of reference chains can be done on heap dumps, but it requires maintaining a partial replica of the GC in user space, see goref [2] for that approach.
So it's not entirely trivial, but rest assured that it's definitely being considered by the Go project. You can see some discussions related to it here [3].
Disclaimer: I contribute to the Go runtime as part of my job at Datadog. I can't speak on behalf of the Go team.
[1] https://go-review.googlesource.com/c/go/+/552736
[2] https://github.com/cloudwego/goref/blob/main/docs/principle....
[3] https://github.com/golang/go/issues/57175
usually I go with pprof, like basic stuff and it helps. I would NOT say memory leak is the biggest or most common issue I see, however as time goes and services become more complicated what I often see in the metrics is how RAM gets eaten and does not get freed as time goes, so the app eats more and more memory as time goes and only restart helps.
It's hard to call it memory leak in "original meaning of memory leak" but the memory does not get cleaned up because the choices I made and I want to understand how to make it better.
Thanks for the tool!
Also, are you running the code in a container? In K8s?
As it is, the only way to currently handle that is with " -gcflags -m=3" or using something like VSCode Go plugin, via "ui.codelenses" and "ui.diagnostic.annotations" configurations.
So you only go down into the complexity of affine types, linear types, effects, formal proofs, dependent types, if really needed, after spending time reasoning with a profiler.
Now, this does not need to be so complex, since languages like Interlisp-D and Cedar at Xerox, that many GC languages have offered value types and explicit stack allocation.
That alone is already good enough for most scenarios, provided people actually spend some time thinking about how to design their data structures instead of placing everything into the heap.
I fixed a leak recently because of misuse of a slice with code like
slice = append(slice[1:], newElement)
I only figured it out by looking at the pprof heap endpoint output and noticed there were multiple duplicate entries.
do you think they will enable Valgrind if there's no leaks?
uninitialized memory, illegal writes, etc... There's a lot of good stuff that could be discovered.
sorry, i guess when i say leaks i mean a bit more broad stuff :'). my own words are a bit leaky hah
still doesnt mean i am wrong. GC doesnt clean up memory when its released but when it wants to, effectively offering opportunities to get that data after a program dont need it anymore. until some point in time u can usually not specify, just hint at.
that in light of things like bad memory ordering between threads etc..can have nasty bugs... (raii has similar bugs but since its more determenistic you can program your way around lot of it more easily and reliably)
Most other widely used GCed languages don’t allow the use of arbitrary interior pointers (though most GCs can actually handle them at the register level).
While Go allows interior pointers, I don't think what you say is true. runtime.KeepAlive was added exactly to prevent GC from collecting the struct when only a field pointer is stored. Take a look at this blog post, for example: https://victoriametrics.com/blog/go-runtime-finalizer-keepal...
A common one I see fairly often is opening a big file, creating a “new slice” on a subset of the file and then using the “new slice” and expecting the old large object to be dropped.
Except, the “new slice” is just a reference into the larger slice, so its never marked unused.
Of course, the language could also be changed to make 2-arg slice operations trim the capacity by default, which might not be a bad idea anyway.
It can happen when your variables have too long a lifespan, or when you have a cache where the entries are not properly evicted.
In addition, Valgrind is actually a complete toolsuite, not just a memory leak detector. Among these tools is "massif", a memory profiler, so you will have a graph of memory use over time and it can tell you from where these allocations come from.
Not, if your language is fully GCed you can have a debug GC that does the job more efficiently than Valgrind on this task, but I don't know if it is the case for Go.
In Java heap fragmentation is usually considered a separate issue but I understand go has a non-moving garbage collector so you can lose memory due to pathological allocations that overly fragment memory and require constantly allocating new pages. I could be wrong about this since I don't know a lot about go, but heap fragmentation can cause troubles for long running programs with certain types of memory allocation.
Beside that, applications can leak memory by stuffing things into a collection (map or list) and then not cleaning it up despite becoming "stale". The references are live from the perspective of the garbage collector but are dead from the application perspective. Weak references exist to solve this problem when you expose an API that stores something but won't be able to know when something goes out of scope. I wouldn't consider this to be common, but if you are building a framework or any kind of platform code you might need to reach for this at some point. Some crazy folks also intern every string they encounter "for performance reasons" and that can obviously lead to what less crazy folk would consider a memory leak. Other folk stick a cache around every client and might not tune the cache parameters leading to unnecessary memory pressure...
In Go, never launch a goroutine that you don't know exactly how it will be cleaned up.
Otherwise the relevant warnings get swamped by a huge amount by irrelevant warnings.
This is why running Valgrind on Python code does not work.
So you are confirming the problem, but treating it as if ignoring it is the solution for all?
Trust me, it does not work.
I've had success with this approach.
I have never tried asking an LLM to do this-but it seems like the kind of problem with which an LLM might have some success, even if only partial success.
Valgrind(-memcheck) is an extremely important tool in memory-unsafe languages.
Love that they have taken this route, this is the way bootstraped toolchains should be, minimal building blocks and everything else on the language itself.
Assembly isn't that hard, those of us that grown around 8 bit home computers were writing Z80 and 6502 Assembly aged 10 - 12 years old, while having fun cracking games and setting the roots of Demoscene.
Also, assembly is complex because each instruction is very simple.
Don't try to write "good" go and it becomes easy too.
I would rather see clearly defined, readable, documented code that isnt optimal... than good code lacking any of those traits.
And good code often isnt clearly defined, it often isn't reader friendly and it often lacks documentation (this bit is fixable but ends up needing a lot more of it).
Bad code that works isnt bad.
Exactly, plus one gets to understand what JIT and AOT toolchains are actually generating.
"ever built something big in LEGO? Yeah? Yeah."
Finally. I found my people.
But maybe others will find a way to use it. Who knows?
Having said that, it saved my ass a lot of times, and I’m very grateful that it exists.
(I think it was possible to use on openmp if you compiled your compiler with special options)
Also, strictly speaking all Go programs are multithreaded. The inability to spawn a single-threaded Go program is actually a huge issue in some system tools like container runtimes and requires truly awful hacks to work around. (Before you ask, GOMAXPROCS=1 doesn't work.)
From a quick glance, it seems that Go is now registering the stacks and emitting stack change commands on every goroutine context switch. This is most likely enough to make Valgrind happy with Go's scheduler.
Memcheck (the main tool) has shortcomings (very slow, does not detect all kinds of errors). Its strongest point is that it does not need an instrumented build. That can be particularly important if you have issues in 3rd party libraries that you can't build. Its other strong point is that it checks for both addressability and initialisedness at the same time.
My favourite feature is using GDB with Valgrind+vgdb. That allows you to see what memory is addressable and/or initialised from within GDB.
Apple have been making big changes that keep breaking things and Valgrind has not kept up. Louis Brunner has done an amazing job more or less single handedly managed to keep the basic flow working.
I'd be interested to know why Valgrind vs the Clang AddressSanitizer and MemorySaniziter. These normally find more types of errors (like use-after-return) and I find it significantly faster than Valgrind.
(Valgrind using a CPU emulator allows for a lot of interesting things, such as also emulating cache behavior and whatnot; it may be slow and have other drawbacks -- it has to be updated every time the instruction set adds a new instruction for instance -- but it's able to do things that aren't usually possible otherwise precisely because it has a CPU emulator!)
I'm not sure if this will work though, will it @bracewel?
We're hoping that there are also a bunch of other interesting side-effects of enabling the usage of Valgrind for Go, in particular seeing how we can use it to track how the runtime handles memory (hopefully correctly!)
edit: also strong disclaimer that this support is still somewhat experimental. I am not 100% confident we are properly instrumenting everything, and it's likely there are still some errant warnings that don't fully make sense.
But I wonder why its not trivial to throw a bunch of different inputs at your cyphering functions and measure that the execution times are all within an epsilon tolerance?
I mean, you want to show constant time of your crypto functions, why not just directly measure the time under lots of inputs? (and maybe background Garbage Collection and OS noise) and see how constant they are directly?
Also some CPUs have a counter for conditional branches (that the rr debuger leverages), and you could sample that before and after and make sure the number of conditional branches does not change between decrypts -- as that AGL post mentions branching being the same is important for constant time.
Finally, it would also seem trivial to track the first 10 decrypts, take their maximum time add a small extra few nanoseconds tolerance, and pad every following decrypt with a few nanoseconds (executing noops) to force constant time when it is varying.
And you could add an assert that anything over that established upper bound crashes the program since it is violating the constant time property. I suppose the real difficulty is if the OS deschedules your execution and throws off your timing check...
My guess is because the GC introduces pauses and therefor nondetermism in measuring the time anything takes.
Don't get me wrong, I love Valgrind, and have been using it extensively in my past life as a C developer. Though the fact that Go needs Valgrind feels like a failure of the language or the ecosystem. I've been doing Rust for ~6 years now, and haven't had to reach for Valgrind even once (I think a team member may have use it once).
I realize that's probably because of cgo, and maybe it's in-fact a step forward, but I can help but feel like it is a step backwards.
I also seldom need something like this in Java, .NET or node, until a dependency makes it otherwise.
I guess maybe the failure is not the addition of it (as it's useful for people writing the bindings), but rather how happy everyone on the thread is (which means it's more useful than it should be due to a failure with the ecosystem).
More likely Go users are just happy in general. The Rust users always come across as being incredibly grumpy for some reason, which may be why that happiness — or what would be considered normalcy in any other venue — seems to stand out so much in comparison.
> We link against [...] OpenSSL
Which is kind of funny as Valgrind support was added specifically for the crypto package to help test tricky constant-time cases. You think that the failure of the ecosystem is that Go has built high-quality crypto support in rather than relying on the Heartbleed library instead...? That is certainly an interesting take.
Also, I had no idea it was added because of constant time crypto that was shared after I wrote my top level comment.
Which I can relate to, when doing stuff that is Windows only , I rather make use of C++/CLI than getting P/Invoke declarations correctly.
I guess there's also callgrind that may be useful for Gophers.
In fairness, the next Rust discussion a few pages deep does mention Go, but in the context of:
1. Someone claiming that GC languages are inherently slow, where it was pointed out that it doesn't have to be that way, using Go as an example. It wasn't said in comparison with Rust.
2. A couple of instances of the same above behaviour; extolling the virtues of Rust and randomly deriding Go. As strange as the above behaviour is, at least Go was already introduced into the discussion. In these mentioned cases Go came from completely out in left field, having absolutely nothing to do with the original article or having any relation to the thread, only showing up seemingly because someone felt the need to put it down.
At least that's why I wrote that original comment.
Why do you say that? The original Go announcement made it abundantly clear that it was intended to be like a dynamically-typed language, but faster. It is probably more like Python than Ruby, as it clearly took a lot of ideas from Python, but most seem to consider those languages to be in the same hemisphere anyway.
Beyond maybe producing complied binaries, which is really just an implementation detail, not a hard feature of the language, what is really comparable with Rust?
Go is certainly a higher-level language than C, but to say it's at all similar to Python or Ruby is nonsensical.
Just like Ruby. Just like pretty much every language people actually use.
> value semantics and pointers
Value semantics are one of the tricks it uses to satisfy the "but faster" part. It is decidedly its own language. But it only supports value semantics, so this is more like Ruby, which only supports reference semantics. Rust supports both value and reference semantics, so it is clearly a very different beast.
> and an `unsafe` package for performing low-level operations on those pointers
The Ruby standard library also includes a package for this.
> And in practice Go and Rust have found use in a lot of the exact same systems programming and network programming domains, as replacement languages for C.
Maybe in some cases, but the data is abundantly clear that Go was most adopted by those who were previously using Ruby and Python. The Go team did think at one point that it might attract C++ programmers, but they quickly found out that wasn't the case. It was never widely adopted in that arena. Whereas I think it is safe to say that many C++ programmers would consider Rust. Which makes sense as Rust is intended to play in the same ballpark as C++. Go was explicitly intended to be a 'faster Python'.
> but to say it's at all similar to Python or Ruby is nonsensical.
Go is most similar to Go, but on the spectrum is way closer to Python and Ruby than it is Rust. It bears almost no resemblance to Rust. Hell, even the "Rustacians'" complaint about Go is that it is nothing like Rust.
Here is Rob Pike blog post about instead of getting C and C++ developers, they got the dynamic language folks.
https://commandcenter.blogspot.com/2012/06/less-is-exponenti...
> And in practice Go and Rust have found use in a lot of the exact same systems programming and network programming domains, as replacement languages for C.
To which was already followed up with:
> the data is abundantly clear that Go was most adopted by those who were previously using Ruby and Python.
Nice of you to say the exact same thing again, I guess, but it would be more effective if it were correctly positioned in the thread. I know, it can be difficult to track down the right correct reply button. Especially when in a rush to post something that just repeats what is already there.
FWIW, I suspect the entire container ecosystem would not have gone with Go if it wasn't for Docker picking Go mostly based on the "systems language" label. (If only they knew how painful it would be...)
To be clear, I use both and like them for different reasons. But in my experience I agree that Go and Rust are far closer brethren than Go and Python. A lot of the design nexus in Go was to take C and try to improve it with a handful of pared down ideas from Java -- this leads to a similar path as the C++-oriented design nexus for Rust. Early Rust even had green threads like Go. They are obviously very different languages in other respects but it's not particularly suprising that people would compare them given their history.
Your later comments about lots of Go users coming from Python is not particularly surprising and I don't think actually helps your point -- they wanted to improve performance so they switched to a compiled language that handles multithreading well. I would argue they moved to Go precisely because it isn't like Python. If Go didn't exist they would've picked a different language (probably Rust, C++, or any number of languages in the same niche). Maybe if there was a "Python-but-fast" language that they all switched to you would have a point, but Go is not that language.
Still is, but it was also made abundantly clear at the time that those systems were things like network servers specifically. It was even later noted that the team was somewhat surprised that people found uses elsewhere. I do recognize this confused the Rust crowd, who bizarrely think that sum types are known as enums, and think that systems are programs that run on raw hardware (think kernels, embedded software, etc.). But nobody else randomly redefines every word they come across.
In the standard nomenclature, systems are the "opposite" of scripts. Scripts being programs that carry out a single task and then exit upon completion, as opposed to a long-running program that continually carries out (possibly a variety of) tasks. If Go isn't a systems programming language then we can conclude that it is a scripting language. But I've never heard of anyone calling it a scripting language... As far as I can tell, the world generally agrees that Go is a systems language.
And yes, this is where I would agree that Rust and Go are more similar, both being geared towards building systems (although not necessary the same type of systems). Python and Ruby are decidedly geared more towards scripting tasks. But, of course, that doesn't mean you can't build scripts in Go and Rust and systems in Python and Ruby. People were definitely trying to write systems in Python in Ruby.
> I suspect the entire container ecosystem would not have gone with Go if it wasn't for Docker picking Go mostly based on the "systems language" label.
Makes sense. The container ecosystem (Docker, Kubernetes, etc.) was originally built as (and for) network servers — the exact niche Go was designed for. I think you make a good point that they've grown to be so much more, to the point that the network bits are hardly even relevant, but if we could erase these tools and the term "systems language" from memory and start over to solve primarily for the pain points associated with running network servers again, I'm not sure you've made a good case that they wouldn't still land on Go. I get why you say that in hindsight, but these projects didn't have hindsight when they were being first created.
> A lot of the design nexus in Go was to take C and try to improve it with a handful of pared down ideas from Java
That runs counter to the claims of the Go team, who explicitly stated that their goal was to make a fast 'dynamically-typed' language. Obviously they introduced a type system so that the compiler could optimize on known primitive types, so it is not truly dynamically-typed, but it is also obvious that the type system doesn't extend beyond what is necessary for the sake of performance and what was necessary to maintain a dynamically-typed 'feel' around that, much to the chagrin of type theorists.
You are quite right that it does share a lot of commonality with C — they were conceived by the same guy, after all! But, given the goal of being "faster" that makes sense. Modern CPUs are literally designed for C. I'm not sure where Java fits. Limbo I can see. Is that what you meant? Java and Limbo were both created at the same time. Perhaps you've somehow managed to conflate them because of that? A lot of people do suggest that Go and Rust are oft considered similar simply because they were created around the same time.
The Java team did warn the Go team to not to screw up implementing generics like they did. Maybe that's where you got Java in your mind? But the warning was heeded. The generics design Go got is quite different. Or maybe you are thinking of Kubernetes originally being written in Java and being criticized for carrying many of those Java-isms into the Go rewrite?
> they wanted to improve performance so they switched to a compiled language that handles multithreading well.
...while, most importantly, sticking to something that was familiar. Perhaps you have already forgotten, but they also evaluated Rust at the time. "It is too hard to learn", they concluded. A bit overdramatic, sure, but when you read between the lines there was a valid point in there — that Rust wasn't like the tools that were commonly used before it.
Go was. The only somewhat unique thing it brought to the table was goroutines, but even that was simply taking what people were already doing with libraries in Ruby and Python (Twisted, EventMachine, etc.) and formalizing it as part of the language. It wasn't a different way of thinking, just syntax sugar.
And this is why I ultimately conclude that Go is more like Python and Ruby than it is Rust. More so Python, granted. Ruby's message passing model leads to some different conventions. Put the code for a Python program and a Go program side by side, squint slightly, and you aren't apt to be able to even see a difference. Especially if that Python program actually sticks to the Zen of Python. Put a Python program beside a Rust program and they are going to be completely different animals.
So, the original comparison was Go and Ruby, not Go and Python. As mentioned, Go is less like Ruby than it is like Python. To establish Go is more like Ruby we are operating on the premise that Python is more like Ruby than it is Rust, which I posited was the prevailing view. But maybe you disagree and that is where the contention lies? If that’s the case, why do you see Python as being more like Rust than Ruby?
I was not a Rust developer in 2013 and I still had the same impression. I think that most C developers (which is what I was primarily at the time) would interpret "systems language" to mean "loosely equivalent to C or C++" in that you have a lot of low-level control over what your program does (which usually means you can write operating systems with it, though I don't think that's necessarily a requirement). Go does not fit that bill.
To be honest, I've always felt the Go folks redefined the word and not the other way around. Are web servers very important? Of course, but a programming language intended primarily for performant web servers is not a "systems language". Maybe this usage of the term is a Google-ism that escaped containment. You can probably find comments from me throughout the 2010s bemoaning this (mis)use of the word.
Funnily enough, Russ Cox himself said in 2014 that he "slightly regrets" calling Go a systems programming language because it leads to confusion[1]. There was another panel talk from a long time ago (sadly, I can't find a video of the talk at the moment) where another Go language developer said that a systems programming language is a language that has pointers and allows typecasting of pointers (more specifically, one where you can create a memory allocator) which always seemed like a very low bar to me.
[1]: https://youtu.be/ZQR32nTVF_4?t=408
> Makes sense. The container ecosystem (Docker, Kubernetes, etc.) was originally built as (and for) network servers — the exact niche Go was designed for.
I don't think that's at all accurate. Docker originally needed to do a heck of a lot of core system operations, which it turns out are very annoying to do in Go (I maintain runc, which inherited most of this code -- it's really not fun). Yes, Docker has a HTTP API, but I don't think of it is as being primarily a network server. And whether the process you run is a web server is not incredibly relevant -- most of the heavy lifting for containers is done by the kernel once you've set everything up.
(Of course the first versions of Docker just used LXC so it was slightly less painful but once they started developing libcontainer -- which is around the time I started working on Docker -- the real pain-points with Go started emerging.)
> The Java team did warn the Go team to not to screw up implementing generics like they did. Maybe that's where you got Java in your mind? But the warning was heeded. The generics design Go got is quite different. Or maybe you are thinking of Kubernetes originally being written in Java and being criticized for carrying many of those Java-isms into the Go rewrite?
This is from more than a decade ago now, but I remember that the Russ Cox in particular had a talk about Go's interfaces and my impression of the talk was that he made several references to Java and that they were trying to find a better model than Java's inheritance system while still solving the same problems. Maybe I'm overstating the impact it had (and maybe it was more a case of talk being tailored to a particular audience) but my impression was that interfaces were an attempt to solve something that Java folks wanted but without all of the issues the Java design has. Generics came much later and I think that everyone was unhappy with the result (though thankfully they have slowly become more erognomic, even if in my experience they are still only really useful for utility functions).
I never got the impression that Python was an explicit source of design ideas for Go. Yes, they were all Google people and so all of them were very familiar with Python use in production, but I just don't see it. Maybe you could argue the "batteries included" thing is Python-esque but that's about it.
Also Borg (Google's internal predecessor to Kubernetes) was written in C++[2], not Java. Kubernetes was also always written in Go (again, because Go had become the "container language" due to Docker).
[2]: https://dl.acm.org/doi/pdf/10.1145/2741948.2741964 "All components of Borg are written in C++."
>Perhaps you have already forgotten, but they also evaluated Rust at the time. "It is too hard to learn", they concluded.
Who is "they"? For the Docker example, my memory is that they later said they looked at Rust at the time but it wasn't 1.0 yet in 2012 and so it was a moot point. I think the only other language they seriously considered was C++ and they decided Go would be easier.
> And this is why I ultimately conclude that Go is more like Python and Ruby than it is Rust. More so Python, granted. Ruby's message passing model leads to some different conventions. Put the code for a Python program and a Go program side by side, squint slightly, and you aren't apt to be able to even see a difference. Especially if that Python program actually sticks to the Zen of Python. Put a Python program beside a Rust program and they are going to be completely different animals.
Well, I agree that Go is more like Python than Rust is like Python (though Rust has better support for some of the functional things in Python than Go and there are small things like format strings that are also very similar, but on the whole I would generally agree). But that is an entirely separate question as to why Go and Rust are often compared to one another. In my experience the comparison is not focused on surface-level syntax but is instead about what purpose it serves (this is like the difference between comparing bats, birds, and flying fish to comparing barnacles and shrimp).
That being said, the fact that it is basically impossible to stop the GC from closing the underlying file descriptor of an *os.File (necessitating dup(2) when you're working with libraries that don't like that) is very Python-esque (no, runtime.SetFinalizer doesn't work). You would be surprised with how many times I've run in this issue...
And that would be a fair interpretation. Before Go, Rust, and the like arrived on the scene C and C++ were about the only languages you'd use to write said long-running programs. You could maybe also throw Java in there, but safe to say it was a pretty short list. Most everyone else was focused on scripting workloads there for the longest time. I might even suggest that Go was the very language that broke us out of that loop, ushering in the new era of systems languages.
> Funnily enough, Russ Cox himself said in 2014 that he "slightly regrets" calling Go a systems programming language because it leads to confusion[1].
Stands to reason. Nobody wants to introduce confusion (maybe Pike, who is a language purist). Alternative interpretations obviously exist. Still, it's not clear what else to call it unless we want to settle on Go being a scripting language. But I don't think either of us consider Go as being a scripting language, do we?
> I don't think of it is as being primarily a network server.
In hindsight, as was said. But we're talking about day one. No project has the full vision at the onset. Software is built up, piece by piece, with next steps determined as you go. There may have been some glimmer of understanding of needing to interface with the system at a low level that Go is not well suited for, but "oooh shiny networking abilities"...
> but is instead about what purpose it serves
Well, we know for certain that the only intended purpose for Go was network services. Obviously people have found other uses for it in the wild, but it was always made clear that it was built for a purpose. So, which languages do you think are more in line with building network services? Those that became famous because of Django and Rails, or those that became famous for Torvalds not wanting it in the Linux kernel?
I'm glad you now agree that Go and Rust have enough similarities to be grouped together in this discussion. ;)
> There may have been some glimmer of understanding of needing to interface with the system at a low level that Go is not well suited for, but "oooh shiny networking abilities"...
I mean, that's just not how Docker was developed at all. I was there (okay, maybe not at the very start but I was involved in the project when it was still very young).
The honest answer is that they didn't foresee how annoying it would be to deal with those things in Go, not that they didn't expect to have to do those things. For one thing, their internal version of Docker at dotCloud was written in Python and so they had a good idea of the kinds of things they will need to do in the rewrite. Lots of lessons were learned over the past decade, you can't just retroactively apply modern maxims like that (i.e., "well, obviously we now know that Go isn't good at X so when they started using it obviously they didn't really plan to use it for X" isn't particularly convincing, especially to people who actually lived through it).
(But none of this is particularly relevant to the original point IMHO.)
I'm glad you finally got around to reading the thread. ;) They've been grouped on the same spectrum since the beginning. For example, "Go is most similar to Go, but on the spectrum is way closer to Python and Ruby than it is Rust."
> The honest answer is that they didn't foresee how annoying it would be to deal with those things in Go
I'm sure it was underestimated — developers tend to be optimistic — but certainly when the creators are explicitly telling you that it is a 'dynamically-typed' language intended for writing network services you're going to understand that you're in for a least a bit of a bumpy ride if you try use it for something that would traditionally have been written in C. No need to look back retroactively. Go was originally announced that way.
Regardless, what is curious, though, is that it wasn't recognized as annoying very quickly at the onset. This does suggest, like before, that work began in the places Go excels and once the other stuff came 'round the sunk costs starting sinking in. You were there, so feel free to tell us the whole story, but you'd think the ship would have been abandoned pretty quickly if the "hard parts" were where things started. It is not like the team didn't already give up on another language.
> (But none of this is particularly relevant to the original point IMHO.)
Or is it? I mean, if Go were just like Rust then wouldn't you say those annoying aspects of Docker wouldn't be annoying anymore? That was my read from earlier. But since Go is more like Python and Ruby...
Which is sad because I like the language and find it useful. But a part of the community does a disservice with comments like your parent comment. It's often on the cusp of calling people who code in Go "stupid". But I digress.
When I used it before I was working on a Rust modules that was loaded in by nginx. This was before there were official or even community bindings to nginx.... so there was a lot of opportunity for mistakes.
The older I get the more I value commit messages. It's too easy to just leave a message like "adding valgrind support", which isn't very useful to future readers doing archaeology.
This isn't so much about leaks. The most important thing that this will enable is correct analysis of uninitialised memory. Without annotation memory that gets recycled will not be correctly poisoned. I imagine that it will also be useful for the other tools (except cachegrind and callgrind).
6 more comments available on Hacker News