Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Replacing the old battery on rechargeable bike lights (jvns.ca)
    3comments
  2. In an $80 Motel Room, a Discovery to Shed Light on the Origins of Life (nytimes.com)
    5comments
  3. Flip Fluid on Flip Dots (mitxela.com)
    14comments
  4. OpenAI Feared "Optics" of what might appear on Hacker News (authorsguild.org)
    401comments
  5. Does Georgism work? Five years later (astralcodexten.com)
    319comments
  6. Fakecloud: Local AWS cloud emulator for integration tests (fakecloud.dev)
    9comments
  7. "As a Language Model": Chat Template Switches LLM Self-Referential Voice (arxiv.org)
    75comments
  8. Go Concurrency Distilled (antonz.org)
    128comments
  9. Finally, A True Blue Rose Exists (sciencenews.org)
    19comments
  10. PipePipe: NewPipe hard fork implementing SponsorBlock (github.com/infinityloop1308)
    247comments
  11. The internet discovers TLA+. Now what? (reasonable.io)
    34comments
  12. DeepSeek Elastic Compute (DSec) (arxiv.org)
    93comments
  13. Show HN: Reladraw – A diagram language where you decide where to place things (github.com/reladraw)
    92comments
  14. Rusty thoughts on "Parse, don't validate" (thegreenplace.net)
    5comments
  15. Show HN: A CC0 museum of retro 3D tricks you can paste into a page (3d-retro.com)
    2comments
  16. ASML says it sold 'absolutely nothing' in Europe in 2026 (tomshardware.com)
    750comments
  17. Biology might not be quantum, but its math is quantumlike (quantamagazine.org)
    35comments
  18. A searchable library of forgotten public-domain film clips from 1915 onward (movingimagearchive.com)
    26comments
  19. Fifteen years later, the Apple Cards origin story (lexontech.org)
    109comments
  20. Exploding variance of means of exponentials: least-squares to the rescue (francisbach.com)
    —discuss
  21. An agent used DNS to reach an external chatbot (alignment.openai.com)
    130comments
  22. How I changed teaching after AI managed to do all my homework assignments (thelastsoftwareengineer.substack.com)
    230comments
  23. Meta Blocks President Lula's Facebook Page, Campaign Ads 2 Weeks from Election (reddit.com)
    234comments
  24. Drawgent: Coding agent on a live Excalidraw canvas (tangled.org/yanndegat.tngl.sh)
    44comments
  25. Promising discoveries about the potential for life on one of Saturn’s icy moons (fu-berlin.de)
    46comments
  26. How to keep enjoying programming in a world of LLMs (haskell.org)
    301comments
  27. Turning GLM-5.3-Flash into a Jev-like decision model (privatemode.ai)
    50comments
  28. What is the size of Yemen? (2024) (theborys.substack.com)
    72comments
  29. Reverse-engineering the Intel 8087's tangent algorithm: more than CORDIC (righto.com)
    11comments
  30. Teaching a World Model to Play Pokemon (nostalgia.dev)
    18comments

Rusty thoughts on "Parse, don't validate"

21 pointsby 5h agoeli.thegreenplace.net
5 comments
45m agoHN ↗

Good article on Rust's strengths with types. If you like this, you may be curious how you might build your own parse capabilities. I like the Rust crates Winnow and Nom, and also the Rust traits From and Into.

18m agoHN ↗

Nonempty type wrappers are a stark reminder that we are missing out on refinement types.

4m agoHN ↗

I was thinking about its implementation, too, and ended up deciding that it was probably a performance optimization.

`Vec<T>` stores all data on the heap, so getting anything out of it involves a pointer deref and possibly also an array bounds check. This `NonEmpty<T>` type keeps the first element of the list in a location that supports some low-level optimization that might make a significant difference when accessing the first element is much more common than accessing subsequent elements.

2m agoHN ↗

Rust has a proposal for this, in the form of pattern types. It's on nightly, but quite far from being ready for prime time.

12m agoHN ↗

This is great. Alexis King actually stated that, had she known how popular “Parse, Don’t Validate” had been, she would have written it in a language more widely used than Haskell.