Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Create digital product stores in minutes and start earning your first dollars(freshlimepay.com)
    1comments
  2. PEP 823 – None-aware access operators(python.org)
    discuss
  3. ForgeMT: Multi-tenant platform for self-hosted GitHub Actions runners on AWS(github.com/cisco-open)
    discuss
  4. Unfinished Work in Package Security(nesbitt.io)
    discuss
  5. Landing the Plane(theengineeringmanager.substack.com)
    discuss
  6. Package Manager Threat Model, Revisited(nesbitt.io)
    discuss
  7. Uswds is dead. Long live USWDS(matthenry.fyi)
    discuss
  8. Reading Books(herman.bearblog.dev)
    discuss
  9. Google's Intrinsic open-sources its infrastructure for intelligent robots(siliconangle.com)
    discuss
  10. MongoDB Sharding: Manage a Sharded Cluster Visually(visualeaf.com)
    discuss
  11. Hedge-fund manager built his firm to be powered by AI agents(cnbc.com)
    discuss
  12. Dual Photography (2005) [pdf](ucsb.edu)
    discuss
  13. I built 13 small Apify Actors this month, mostly AI-grounded(apify.com)
    discuss
  14. Pushgate(pushgate.dev)
    discuss
  15. What Happened in Austin(freerange.city)
    discuss
  16. Devin Fusion: the first multi-model coding agent on the Pareto frontier(twitter.com/artificialanlys)
    1comments
  17. What Capital Never Told You About Rent(humansontheloop.com)
    discuss
  18. Show HN: Grading a golf bag from club specs alone, no launch monitor(fitmygolfclubs.com)
    discuss
  19. A Summer of AI Optimization(twitter.com/lemire)
    discuss
  20. Show HN: Builder – An open-source alternative to Lovable, Replit, and v0(github.com/heyputer)
    discuss
  21. Some say AI is ALREADY CONSCIOUS. My response is(youtube.com)
    discuss
  22. Loophole in new EU labelling will let fossil-fuelled data-centres pass as green(euobserver.com)
    discuss
  23. ImAlive – A privacy-first safety timer and digital legacy vault(imalive.app)
    discuss
  24. Show HN: Warble – Share voice notes in your social media feeds(getwarble.com)
    discuss
  25. Show HN: Relay – a self-hosted LLM gateway with smart routing and request pacing(github.com/anchorshell)
    discuss
  26. Lazydraw: Terminal ASCII editor for drawing diagrams and sketches(github.com/mpospirit)
    discuss
  27. Qobuz multiplatform client cease-and-desisted by Qobuz(github.com/vicrodh)
    discuss
  28. JRR Tolkien on 'the most tragic moment' in The Lord of the Rings(bbc.com)
    2comments
  29. Flock's Gunfire Alerts Raise a New Fourth Amendment Question(reason.com)
    discuss
  30. Applying zigzag algebra in abstract algebra to improve LLM training(zenodo.org)
    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