frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

The Future of CSS

https://www.joshwcomeau.com/css/interop-2027/
316•soheilpro•6h ago•120 comments

Show HN: SimCity, but with Permits

https://permit.petercai.com/
765•pcai•13h ago•364 comments

Muse exposes users' personal and business secrets when they share conversations

https://arstechnica.com/security/2026/10/meta-muse-exposes-users-personal-and-business-secrets-wh...
133•gumby•7h ago•45 comments

Upcoming critical PHP security release (CVE-2026-109618 / -109619)

https://news-web.php.net/php.announce/509
648•xd•12h ago•242 comments

Voxtral 3

https://mistral.ai/news/voxtral-3/
641•ilreb•16h ago•164 comments

Feds suspect ransom negotiator ran ShinyHunters extortion site

https://krebsonsecurity.com/2026/10/feds-suspect-ransom-negotiator-ran-shinyhunters-extortion-site/
188•Bender•10h ago•80 comments

In Hilbert space, all things are quantumly possible

https://www.quantamagazine.org/in-hilbert-space-all-things-are-quantumly-possible-20260826/
84•unprovable•6h ago•40 comments

eMudhra intermediate CA compromise

https://emudhra.we-have-a-problem.com/
898•galadran•18h ago•388 comments

Good type against all odds

https://unsung.aresluna.org/good-type-against-all-odds/
109•firloop•6h ago•10 comments

Composite objects and C++26 the std:polymorphic type

https://mariusbancila.ro/blog/2026/10/18/composite-objects-and-cpp26-the-stdpolymorphic-type/
18•jandeboevrie•2d ago•14 comments

The Other Epidemic: Trying to get off benzodiazepines

https://www.thebeliever.net/the-other-epidemic/
173•gaplong•9h ago•128 comments

ZX Spectrum Next Laptop

https://www.dorchester3d.com/printing/blog/2020/11/zx-spectrum-next-laptop-version-2
62•utopcell•2d ago•7 comments

Battlezone Online: BZFlag in the Browser

https://github.com/timriker/bzo
25•indigodaddy•3h ago•16 comments

Setting Up SSH Keys on macOS with Touch ID

https://nmattia.com/posts/2026-10-19-setting-up-ssh-keys-touch-id/
37•civilchaos•4h ago•26 comments

The Decoherence Trap

https://maevyn.codes/decoherence
9•cassianoleal•1d ago•0 comments

Google open-sources TorchTPU, a native PyTorch back end for TPUs

https://github.com/google-pytorch/torch_tpu
330•ilreb•15h ago•74 comments

Four Years with Decker

https://beyondloom.com/blog/fouryearsdecker.html
28•ibobev•20h ago•3 comments

Using Claude to reduce the attack surface of code

https://www.anthropic.com/research/attack-surface-reduction
29•dnw•4h ago•7 comments

What shall I teach my son?

https://stevekrouse.com/ends
377•Curiositry•15h ago•451 comments

SlopCodeBench 10/2026 – Opus 5.5, Astra wins overall, xhigh considered harmful

https://github.com/humanlayer/advanced-context-engineering-for-coding-agents/blob/main/benchmarki...
247•dhorthy•5d ago•94 comments

Pillowfort Is Closing

https://www.pillowfort.social/posts/8413273
36•BrenBarn•3h ago•20 comments

C# now beats Rust on WASM size

https://github.com/zion-sati/NetWasm
36•sumnole•5h ago•8 comments

Borrow Checking Zero-Cost Cyclic Mutability

https://antelang.org/blog/safe_cyclic_mutability/
29•jfecher•1d ago•2 comments

Apple broke an essential presentation feature of iPads

https://teddysvoronos.com/2026-10-19-apple-broke-an-essential-presentation-feature-of-ipads/
549•evanb•20h ago•272 comments

DeepInfer: High-performance inference framework for DeepSeek models

https://github.com/deepseek-ai/DeepInfer
2237•ggcr•23h ago•854 comments

Ofcom concedes defeat in 4chan case

https://prestonbyrne.com/2026/10/20/ofcom-concedes-defeat/
379•iamnothere•17h ago•291 comments

Sixteen years after Deepwater Horizon, deep sea life shows few signs of recovery

https://e360.yale.edu/digest/deepwater-horizon-deep-sea-recovery
260•speckx•16h ago•154 comments

Tsrs: A Port of TypeScript to Rust

https://blog.cloudflare.com/typescript-rust-port/
402•hnisjafx40•19h ago•195 comments

To Make, or to Buy: The Economics of Decision Models

https://pncnmnp.github.io/blogs/economics-decision-models.html
43•pncnmnp•2d ago•2 comments

Advanced coding in low-resource programming languages

https://openai.com/index/low-resource-programming-languages/
71•sumnole•14h ago•79 comments
Open in hackernews

Composite objects and C++26 the std:polymorphic type

https://mariusbancila.ro/blog/2026/10/18/composite-objects-and-cpp26-the-stdpolymorphic-type/
18•jandeboevrie•2d ago

Comments

usrnm•1h ago
15 years ago I would've been happy reading about all these cool new things coming to C++, nowadays I'm happy I don't use it anymore and don't need to relearn everything again. Am I getting old?
ho_schi•47m ago
I need default security with a #secure and #insescure.

Not adding more stuff. So I get security, legacy compatibility and the existing flexibility.

nananana9•43m ago
We've been doing this for 50 years, you don't need a class hierarchy for your event struct.

  enum EventType {
      EVENT_NONE,
      EVENT_TEMPERATURE_READING,
      EVENT_SMOKE_DETECTED,
      EVENT_CARBON_MONOXIDE_DETECTED,
  };
  struct Event {
      EventType type;
      union {
          TemperatureDeadingData temperature_reading;
          SmokeDetectedData smoke_detected;
          CarbonMonoxideDetected carbon_monoxide_detected
      } data;
  };

  std::vector<Event> events;
quietbritishjim•38m ago
That doesn't work if you are writing a library where users of the library are able to implement their own event types.

Even for a self-contained code base, it's a pain compared to a type that just works with any current or future derived class.

nananana9•28m ago
It does.

  enum EventType {
     ...,
     EVENT_USER_START = 0xF0000000,
  };
  struct UserEventData { uint8 placeholder[64]; }
  struct Event {
     EventType type;
     union {
         UserEventData user;
     };
  }
That aside, have you ever felt the need to implement your own Win32 event, or SDL event, or X11 event, or epoll_event, or a custom DOM event or whatever?

If you're writing a good library, give the user the data they need, and let them handle it however they wish, don't force them int your framework.

Panzerschrek•31m ago
Typical C approach. In C++ this should be done with std::variant instead. It has the exact same binary layout, but is type-safe (compared to union usage).
adev_•27m ago
What you wrote there is just an unsafe way to do std::variant. This has nothing to do with what the blog post is about.

The blog is about Open polymorphism. Where the list of compatible Object can be extended dynamically (Which is handy for some type of error report for instance).

You can do that since forever in C++ (Since the first support for inheritance), the only thing std::polymorphism brings is the ability to do it without dynamic allocations, emplacement new or lifetime problems.

nananana9
Panzerschrek•33m ago
Does std::polymorphic require passed types to be copyable?
aw1621107•22m ago
Looks like it depends on the specific operation(s) you want to perform [0]. For instance, constructing a std::polymorphic<T> from an object of type T or derived from T requires that that object is copy-constructible (among other requirements), but copy-assigning one std::polymorphic<T> to another only requires that T is complete.

[0]: https://eel.is/c++draft/polymorphic

quietbritishjim•28m ago
I followed the link near the start to the article about std::indirect<T>, which you can use instead of std::unique_ptr<T> for the pImpl idiom: [1]

> Never null: it always holds a value, except in the moved-from state (but features a member function called valueless_after_move() that lets you check the state)

Ugh, what a mess. Surely the whole point of using this rather than unique_ptr is to avoid such a trap! A safe move constructor isn't possible here because you'd either have to re-init your moved-from object, or do element-wise move (with `MyClass(MyClass&& other): impl(std::in_place, *other.impl) {}`) but those would stop your move constructor being noexcept. It would've been much more useful to make the move constructor of indirect be deleted, which is what people typically did with a pImpl-based classes in the past.

[1] https://mariusbancila.ro/blog/2026/07/23/the-pimpl-idiom-and...

•
25m ago
> This has nothing to do with what the blog post is about.

It's an alternative way to solve the problem presented, which trivially allows you to make a std::vector<Event> (the whole point the article is building up to).

> the only thing std::polymorphism brings is the ability to do it without dynamic allocations, emplacement new or lifetime problems.

Which the version I showed has none of.

adev_•20m ago
> it's an alternative way to solve the problem presented

No it's not and you apparently did not understand the concept behind it (or more likely, do not want to understand the concept behind it).

Your solution is not an implementation of Open Polymorphism, it is just a poor man implementation of std::variant.

> Which the version I showed has none of.

Because it is not the same thing like explain by my previous comment and in around 5 other comments around mine soon I guess.

But you are entirely free to grunt around and continue to imply that C++ committee people are implementing something useless (Which they are not, this is useful).

nananana9•9m ago
My point is that you don't need open polymorphism for the example given, and if you give me another example, I can show you why you don't need it there either -- because you do in fact never need it. It's an XY problem over the set X.

If a programmer is reaching for a library, they want it to solve a concrete task. Nobody wants to subclass your Event type, if I have to do it, you've failed at your job.

fooker•20m ago
When this piece of code exists in a library, it makes it pretty much impossible to extend by the user of the library.