Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Show HN: ScopeTrail – audit receipts for multi-hop agent delegation(github.com/scopetrail)
    discuss
  2. Coulomb's law remains tricky to test at home(chillphysicsenjoyer.substack.com)
    discuss
  3. Show HN: Gemma 3 4B as a typed decision function in Rust (47 ms/decision)(github.com/zozo123)
    discuss
  4. The American Prison Experiment: A History of Good Intentions and Bad Results(reason.com)
    discuss
  5. Create digital product stores in minutes and start earning your first dollars(freshlimepay.com)
    1comments
  6. PEP 823 – None-aware access operators(python.org)
    discuss
  7. ForgeMT: Multi-tenant platform for self-hosted GitHub Actions runners on AWS(github.com/cisco-open)
    discuss
  8. Unfinished Work in Package Security(nesbitt.io)
    discuss
  9. Landing the Plane(theengineeringmanager.substack.com)
    discuss
  10. Package Manager Threat Model, Revisited(nesbitt.io)
    discuss
  11. USWDS is dead. Long live USWDS(matthenry.fyi)
    discuss
  12. Reading Books(herman.bearblog.dev)
    discuss
  13. Google's Intrinsic open-sources its infrastructure for intelligent robots(siliconangle.com)
    discuss
  14. MongoDB Sharding: Manage a Sharded Cluster Visually(visualeaf.com)
    discuss
  15. Hedge-fund manager built his firm to be powered by AI agents(cnbc.com)
    discuss
  16. Dual Photography (2005) [pdf](ucsb.edu)
    discuss
  17. I built 13 small Apify Actors this month, mostly AI-grounded(apify.com)
    discuss
  18. Pushgate(pushgate.dev)
    discuss
  19. What Happened in Austin(freerange.city)
    discuss
  20. Devin Fusion: the first multi-model coding agent on the Pareto frontier(twitter.com/artificialanlys)
    1comments
  21. What Capital Never Told You About Rent(humansontheloop.com)
    discuss
  22. Show HN: Grading a golf bag from club specs alone, no launch monitor(fitmygolfclubs.com)
    discuss
  23. A Summer of AI Optimization(twitter.com/lemire)
    discuss
  24. Show HN: Builder – An open-source alternative to Lovable, Replit, and v0(github.com/heyputer)
    discuss
  25. Some say AI is ALREADY CONSCIOUS. My response is(youtube.com)
    discuss
  26. Loophole in new EU labelling will let fossil-fuelled data-centres pass as green(euobserver.com)
    discuss
  27. ImAlive – A privacy-first safety timer and digital legacy vault(imalive.app)
    discuss
  28. Show HN: Warble – Share voice notes in your social media feeds(getwarble.com)
    discuss
  29. Show HN: Relay – a self-hosted LLM gateway with smart routing and request pacing(github.com/anchorshell)
    discuss
  30. Lazydraw: Terminal ASCII editor for drawing diagrams and sketches(github.com/mpospirit)
    discuss

Type Punning in C and C++

29 pointsby 1h agoblog.pwkf.org
11 comments
1h agoHN ↗

Does reinterpret_cast works in c++ for this?

48m agoHN ↗

The C vs C++ distinction here is genuinely treacherous

What's so genuine about this?

31m agoHN ↗

Despite the fact they're two different languages, people are often taught as though it's basically just a subset relationship and then they carry this through into the actual software they write.

Because neither of these are memory safe languages, you are required to ensure you've made no mistakes or else anything might happen.

24m agoHN ↗

It continues with

and most blog posts on the topic get it wrong.

This smells like Claudism/LLMish.

15m agoHN ↗

The example included below "Why C and C++ Differ" is UB in both C and C++ (and says nothing about "why" C & C++ differ). The article isn't overall wrong but that bit is just...

(Feels a bit like LLM junk, but honestly not sure.)

8m agoHN ↗

A pointer cast worked fine at -O0 and silently broke at -O2.

Feels like LLM to me. I looked at some of the rest of the article and... pretty much certain now.

11m agoHN ↗

Is it necessary to use the lowest possible font weight?

3m agoHN ↗

I just watched video[0] that argues if you can consteval something, then it must be free of UB, which seems compelling, at least for these lower level helpers.

Unfortunately, it seems memcpy is not constexpr, so cannot be used like this, but std::bit_cast actually works[1] as constexpr, so I think in C++ that would now be the most preferred use. It won't allow the union either.

[0] https://www.youtube.com/watch?v=-LAXqqqX274 [1] https://godbolt.org/z/xGzjTMGvv