Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Human brain is two separate organs, Stanford Medicine-led research finds(stanford.edu ↗)
    47comments
  2. If math is more than proof, we need to better celebrate the rest of it(terrytao.wordpress.com ↗)
    23comments
  3. GPT-6 Astra Solves a WWI German Radio Cipher(prinzai.com ↗)
    27comments
  4. San Francisco Onion Futures Company(onionfutures.com ↗)
    59comments
  5. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    388comments
  6. Typesafe-computer-use drives a Mac toward a goal for 1/50th of a cent per step(github.com/awlevin ↗)
    34comments
  7. Science Is Open Software(jepedersen.dk ↗)
    31comments
  8. SDCC – Small Device C Compiler(sourceforge.net ↗)
    15comments
  9. Cloudflare Quick Tunnels(cloudflare.com ↗)
    275comments
  10. You can run Git on object storage if you re-make packfiles(tigrisdata.com ↗)
    10comments
  11. Why building a Rust LSP is hard(rust-glancer.github.io ↗)
    29comments
  12. Saving another 100TB of RAM(cloudflare.com ↗)
    67comments
  13. NASA-IBM Lunar Foundation open-Source Geospatial AI Model(usra.edu ↗)
    2comments
  14. How to Write with an LLM(sockpuppet.org ↗)
    320comments
  15. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    81comments
  16. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    99comments
  17. Ctenophores: Wonders of Biology(quantamagazine.org ↗)
    4comments
  18. Goroutine Leak Profiles(go.dev ↗)
    2comments
  19. OpenJev(openjev.com ↗)
    259comments
  20. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    88comments
  21. Veronese's Dogs(publicdomainreview.org ↗)
    discuss
  22. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    67comments
  23. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    12comments
  24. Stepfun Step 5 Preview (LLM): On AA Pareto frontier(artificialanalysis.ai ↗)
    2comments
  25. Minimal Phone 2(minimalcompany.com ↗)
    218comments
  26. The Farnese letter(simonklee.dk ↗)
    6comments
  27. Cyclomatic Complexity in C#(ndepend.com ↗)
    18comments
  28. The Case of Elias Thorne, Imaginary Man AI Chatbots Are Obsessed With(vice.com ↗)
    1comments
  29. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    54comments
  30. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    97comments

Goroutine Leak Profiles

27 pointsby 2d agogo.dev
2 comments
3h agoHN ↗

I'm coming predominately from other languages, so it took me a hot minute to figure out what the various bug were.

• channels are by default "unbuffered", in that a send needs a waiting recv to actually do the send, and blocks until such. The addition of the buffer prevents the block & permits the goroutine to progress (and eventually exit, and thus, not leak) … so long as the buffer is sufficiently large enough.

• channels do not, AFAICT, realize when the receiver is gone, and will block indefinitely even when there is no receiver. (It is the same "chan" object, I think, in both sender/receiver / there is no distinction. So, the single object is never GC'd.)

• goroutines are not GC'd. (& the code doesn't/can't hold like, a reference or a handle to a goroutine / there is no "join" primitive.)

2h agoHN ↗

(2) has a bit more nuance to it: you can close channels… but the langage is designed for that to only be ok on single senders, a receiver can gracefully handle a closed channel (an iteration will just stop, a receive can use the 2-valued form to get the information), a sender will always straight up panic. Aka go channels are designed for fan-out.

And not closing channels is also considered idiomatic, per a tour of go:

Channels aren't like files; you don't usually need to close them.