frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Go has added Valgrind support

https://go-review.googlesource.com/c/go/+/674077
131•cirelli94•3h ago

Comments

defraudbah•1h ago
looks very promising, one of the biggest issue in golang for me is profiling and constant memory leaks/pressure. Not sure if there is an alternative of what people use now
felixge•1h ago
I'd love to hear more! What kind of profiling issues are you running into? I'm assuming the inuse memory profiles are sometimes not good enough to track down leaks since they only show the allocation stack traces? Have you tried goref [1]?. What kind of memory pressure issues are you dealing with?

[1] https://github.com/cloudwego/goref

Disclaimer: I work on continuous profiling for Datadog and contribute to the profiling features in the runtime.

pjmlp•54m ago
Ideally, they would have learnt from other languages, and offered explicit control over what goes into the stack instead of relying into escape analysis alone.

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.

johncolanduoni•11m ago
I sometimes dream of a GCed language with a non-escaping pointer type. However to make it really useful (i.e. let you put it inside other non-escaping structs) you need something on the scale of the Rust borrow checker, which means adding a lot of complexity.
Thaxll•45m ago
pprof is pretty good, what do you need?
0x696C6961•39m ago
How are you getting "constant memory leaks" in a GC'd language?
sim7c00•31m ago
it's not hard. GC lets shit leak until it decided to clean it up...

do you think they will enable Valgrind if there's no leaks?

johncolanduoni•15m ago
Golang has a feature that I love in general but that makes it very easy to keep unintended allocations around. If you have a struct with a simple int field, and you store that somewhere as an *int, the entire struct and anything it points to will be kept alive. This is super useful for short-lived pointers, and super dangerous for long-lived pointers.

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).

aleksi•7m ago
> If you have a struct with a simple int field, and you store that somewhere as an *int, the entire struct and anything it points to will be kept alive.

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 the example: https://pkg.go.dev/runtime#KeepAlive

dijit•12m ago
There’s ways, GC isn’t perfect.

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.

giancarlostoro•6m ago
Interesting, I always thought of slices as stand-alone, I wonder if its the same in Python?
throwaw12•11m ago
there are many ways:

    - you can create deadlocks
    - spawn goroutines while not making sure they have proper exit criteria
    - use slices of large objects in memory and pass them around (e.g. read files in a loop and pass only slice from whole buffer)
    - and so on
amelius•1h ago
It only works if every package tests with it.

Otherwise the relevant warnings get swamped by a huge amount by irrelevant warnings.

This is why running Valgrind on Python code does not work.

jzwinck•16m ago
If that were true it would also apply to C and C++. I have used Valgrind with Python + Boost C++ hybrid programs and it worked fine after spending an hour making a suppressions file.
giancarlostoro•9m ago
> it worked fine after spending an hour making a suppressions file.

So you are confirming the problem, but treating it as if ignoring it is the solution for all?

pjmlp•1h ago
> Instead of adding the Valgrind headers to the tree, and using cgo to call the various Valgrind client request macros, we just add an assembly function which emits the necessary instructions to trigger client requests.

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.

giancarlostoro•10m ago
I am still curious, had they not gone this route, and avoided the other two routes mentioned, what could they have done to make this process as simple as the rest of Go tends to be, and nearly as performant? I guess this is an ongoing question to be solved at a future date.
0x696C6961•1h ago
This is only useful for cgo correct?
kevincox•9m ago
I presume it is also useful if you are using the unsafe APIs as well to mess with pointers and do raw memory reads.
pbd•43m ago
Nothing says 'mature ecosystem' like finally getting debugging tools that C developers have had since the Clinton administration. Next up: maybe Go will discover gdb integration and we can debug like it's 1999.
preisschild•27m ago
And yet it's mature enough to be used for highly critical software such as Kubernetes...
worksonmine•25m ago
> Next up: maybe Go will discover gdb integration and we can debug like it's 1999

That's already possible and documented[1]. I don't understand if you're sarcastic though, what's wrong with GDB? I use it in vim :termdebug and I wish all languages had native support for it.

[1]: https://go.dev/doc/gdb

alias_neo•17m ago
C is also half a century old. Perhaps Valgrind wasn't a high priority because the newer language also has newer tools?

Nothing wrong with adding tried and tested tools later if people want them.

Did you have a need for Valgrind in Go that wasn't served by any other tools until now?

Go has added Valgrind support

https://go-review.googlesource.com/c/go/+/674077
136•cirelli94•3h ago•26 comments

Structured Outputs in LLMs

https://parthsareen.com/blog.html#sampling.md
36•SamLeBarbare•2h ago•7 comments

Indoor surfaces act as sponges for harmful chemicals

https://news.uci.edu/2025/09/22/indoor-surfaces-act-as-massive-sponges-for-harmful-chemicals-uc-i...
36•XzetaU8•3h ago•10 comments

Nine Things I Learned in Ninety Years

http://edwardpackard.com/wp-content/uploads/2025/09/Nine-Things-I-Learned-in-Ninety-Years.pdf
485•coderintherye•9h ago•195 comments

The YAML Document from Hell

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell
55•agvxov•3h ago•26 comments

Zoxide: A Better CD Command

https://github.com/ajeetdsouza/zoxide
179•gasull•7h ago•99 comments

Zinc (YC W14) Is Hiring a Senior Back End Engineer (NYC)

https://app.dover.com/apply/Zinc/4d32fdb9-c3e6-4f84-a4a2-12c80018fe8f/?rs=76643084
1•FriedPickles•42m ago

Altoids by the Fistful

https://www.scottsmitelli.com/articles/altoids-by-the-fistful/
113•todsacerdoti•6h ago•53 comments

Processing Strings 109x Faster Than Nvidia on H100

https://ashvardanian.com/posts/stringwars-on-gpus/
45•ashvardanian•3d ago•0 comments

Qwen3-Omni: Native Omni AI model for text, image and video

https://github.com/QwenLM/Qwen3-Omni
502•meetpateltech•18h ago•125 comments

Cache of Devices Capable of Crashing Cell Network Is Found Near U.N

https://www.nytimes.com/2025/09/23/us/politics/secret-service-sim-cards-servers-un.html
48•adriand•1h ago•18 comments

Hyb Error: A Hybrid Metric Combining Absolute and Relative Errors

https://arxiv.org/abs/2403.07492
6•ncruces•2h ago•0 comments

Delete FROM users WHERE location = 'Iran';

https://gist.github.com/avestura/ce2aa6e55dad783b1aba946161d5fef4
632•avestura•7h ago•468 comments

Fall Foliage Map 2025

https://www.explorefall.com/fall-foliage-map
191•rappatic•12h ago•24 comments

I built a dual RTX 3090 rig for local AI in 2025 (and lessons learned)

https://www.llamabuilds.ai/build/portable-25l-nvlinked-dual-3090-llm-rig
75•tensorlibb•4d ago•61 comments

Show HN: Run Qwen3-Next-80B on 8GB GPU at 1tok/2s throughput

https://github.com/Mega4alik/ollm
13•anuarsh•3d ago•1 comments

Compiling a Functional Language to LLVM (2023)

https://danieljharvey.github.io/posts/2023-02-08-llvm-compiler-part-1.html
22•PaulHoule•2d ago•0 comments

Walking Michigan City (Indiana)

https://walkingtheworld.substack.com/p/walking-michigan-city-indiana
27•Michelangelo11•1h ago•2 comments

Gamebooks and graph theory (2019)

https://notes.atomutek.org/gamebooks-and-graph-theory.html
49•guardienaveugle•8h ago•2 comments

Themis (European Reusable Rocket) is assembled on launch pad

https://phys.org/news/2025-09-themis-pad-fully.html
88•theamk•3d ago•74 comments

Cap'n Web: a new RPC system for browsers and web servers

https://blog.cloudflare.com/capnweb-javascript-rpc-library/
573•jgrahamc•23h ago•240 comments

I'm spoiled by Apple Silicon but still love Framework

https://simonhartcher.com/posts/2025-09-22-why-im-spoiled-by-apple-silicon-but-still-love-framework/
350•deevus•23h ago•462 comments

Paper2Agent: Stanford Reimagining Research Papers as Interactive AI Agents

https://arxiv.org/abs/2509.06917
124•Gaishan•14h ago•29 comments

Why haven't local-first apps become popular?

https://marcobambini.substack.com/p/why-local-first-apps-havent-become
445•marcobambini•23h ago•439 comments

Based C++

https://github.com/SheafificationOfG/based-cpp
80•phamtrongthang•3d ago•30 comments

The Beginner's Textbook for Fully Homomorphic Encryption

https://arxiv.org/abs/2503.05136
221•Qision•1d ago•38 comments

Kevo app shutdown

https://www.kwikset.com/support/answers/what-does-the-kevo-app-shutdown-mean-to-my-kevo-door-lock
106•asperous•14h ago•91 comments

Is a movie prop the ultimate laptop bag?

https://blog.jgc.org/2025/09/is-movie-prop-ultimate-laptop-bag.html
230•jgrahamc•1d ago•233 comments

The Common Pile v0.1: An 8TB Dataset of Public Domain and Openly Licensed Text

https://arxiv.org/abs/2506.05209
47•djoldman•4d ago•10 comments

Germicidal UV could make airborne diseases as rare as those carried by water

https://www.worksinprogress.news/p/how-to-clean-the-air
88•venkii•14h ago•51 comments