frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

C constructs that still don't work in C++

https://lospino.so/blog/c-constructs-that-still-dont-work-in-cpp/
13•jalospinoso•3d ago

Comments

jalospinoso•3d ago
I wrote this after repeatedly seeing experienced C programmers hit the same sharp edges while moving into modern C++ codebases.

Many of these differences are intentional and defensible from the C++ side. But some are still surprising because they invalidate patterns that were historically common, performant, or idiomatic in C.

The interesting part to me isn’t "C vs C++," but where the languages diverged philosophically: object lifetime vs raw storage, stronger type systems, implicit conversions, ABI and optimization assumptions, and the boundary between "portable" and "works on my compiler."

I’d also be curious which C constructs people still genuinely miss in modern C++. For me, restrict is still near the top of the list.

hgs3•29m ago
Not sure if you're aware, but defer is proposed for C2Y [1]. It's already available in Clang behind a compiler flag. It is interesting how the languages continue to diverge.

[1] https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3734.pdf

pjmlp•25m ago
Because the communities aren't the same.

C++ is 1990's Typescript for C++, while C folks still think is a portable Assembly instead of designed to an abstract machine model.

As such C++ community embraces high level abstractions and type systems improvements, whereas C wants to still code as targeting classical hardware.

pjmlp•27m ago
I appreciate that restrict isn't there, because it is yet another UB source, programmer knows not to do errors kind of attitude, and secondly no one seems to care enough to write a language proposal for it.
AdieuToLogic•49m ago
From the article:

  In 2019 I wrote a short survey of C constructs that do not 
  work in C++. The point was not that C is sloppy or that C++ 
  is superior. The point was that C++ is not a superset of C, 
  and that C programmers crossing the border should know 
  where the checkpoints are.
C++ was a superset of C 30-ish years ago. Now, as the author correctly identifies, it is not as both have taken different evolutionary paths.
pjmlp•30m ago
Already in C++98 there were differences.

?: has another execution priority.

Implicit cast scenarios are reduced in C++.

mjs01•30m ago
Some unmentioned incompatibilities I've encountered that makes a C header not directly usable in C++:

- C `_Atomic(T)` and C++ `std::atomic<T>`. C++23 has C compatible header `stdatomic.h` that defines `_Atomic(T)`, but it's still problematic

- C `_Noreturn/noreturn` and C++ `[[noreturn]]`. C23 `[[noreturn]]` makes them compatible

- C inline and C++ inline are different. Good news is their `static inline` are the same

- C has anonymous struct. C++ doesn't. Both have anonymous union though

dhruv3006•26m ago
> restrict: a C promise, not a C++ contract

This takes the cake.

The Eternal Sloptember

https://geohot.github.io//blog/jekyll/update/2026/05/24/the-eternal-sloptember.html
124•razin•1h ago•51 comments

Show HN: Audiomass – a free, open-source multitrack audio editor for the web

https://audiomass.co/?multitrack=1
261•pantelisk•13h ago•54 comments

DeepSeek reasonix, DeepSeek native coding agent with high caching and low cost

https://esengine.github.io/DeepSeek-Reasonix/
496•Alifatisk•16h ago•209 comments

Migrating from Go to Rust

https://corrode.dev/learn/migration-guides/go-to-rust/
182•jabits•10h ago•183 comments

Bug 1950764: Work Around Crash on Intel Raptor Lake CPU

https://phabricator.services.mozilla.com/D301917
40•luu•2d ago•17 comments

A fundamental principle of aeronautical engineering has been overturned

https://www.wired.com/story/a-fundamental-principle-of-aeronautical-engineering-has-been-overturned/
115•littlexsparkee•10h ago•63 comments

White Rabbit – sub-nanosecond synchronization for large distributed systems

https://ohwr.org/projects/white-rabbit/
43•michaelsbradley•1d ago•12 comments

C constructs that still don't work in C++

https://lospino.so/blog/c-constructs-that-still-dont-work-in-cpp/
18•jalospinoso•3d ago•9 comments

I spent 50 hours drawing a line graph

https://www.dougmacdowell.com/50-hours-to-draw-some-lines.html
477•dougdude3339•3d ago•82 comments

Memory has grown to nearly two-thirds of AI chip component costs

https://epoch.ai/data-insights/ai-chip-component-cost-shares
344•intelkishan•12h ago•362 comments

Constraint Decay: The Fragility of LLM Agents in Back End Code Generation

https://arxiv.org/abs/2605.06445
201•wek•16h ago•107 comments

Microsoft open-sources “the earliest DOS source code discovered to date”

https://arstechnica.com/gadgets/2026/04/microsoft-open-sources-the-earliest-dos-source-code-disco...
453•DamnInteresting•1d ago•155 comments

Scientists solve 200-year-old puzzle of how tobacco plants make nicotine

https://www.york.ac.uk/news-and-events/news/2026/research/200-year-old-puzzle-tobacco-plants-nico...
67•sohkamyung•2d ago•20 comments

Build Adafruit projects right from Firefox

https://www.firefox.com/en-US/landing/adafruit/
142•mch82•3d ago•46 comments

Using HTTP/2 Cleartext for a server in Go 1.24

https://www.clarityboss.com/blog/go-http2-cleartext-h2c-cloud-run
73•dan_sbl•5d ago•6 comments

Mastering Dyalog APL

https://mastering.dyalog.com/README.html
133•tosh•17h ago•36 comments

Didgeridoo playing as alternative treatment for obstructive sleep apnea(2006)

https://pmc.ncbi.nlm.nih.gov/articles/PMC1360393/
5•kelseyfrog•2d ago•0 comments

Greg Brockman interview [video]

https://fs.blog/knowledge-project-podcast/greg-brockman/
190•prakashqwerty•20h ago•194 comments

Noroboto: Lying Fonts and Mitigation in Rust

https://tritium.legal/blog/noroboto
65•piker•2d ago•28 comments

Scammers are abusing an internal Microsoft account to send spam links

https://techcrunch.com/2026/05/21/scammers-are-abusing-an-internal-microsoft-account-to-send-spam/
278•spike021•1d ago•152 comments

Perceptual Image Codec: What Matters in Practical Learned Image Compression

https://apple.github.io/ml-pico/
107•ksec•17h ago•33 comments

Getting an old Computer online with Android Ethernet tethering

https://82mhz.net/posts/2026/05/getting-an-old-computer-online-with-android-ethernet-tethering/
48•speckx•3d ago•18 comments

Childhood Computing

https://susam.net/childhood-computing.html
180•blenderob•17h ago•92 comments

Why is Vivado 2026.1 dropping Linux support for free tier?

https://adaptivesupport.amd.com/s/question/0D5Pd00001YQLdMKAX/why-is-vivado-20261-dropping-linux-...
311•zdw•1d ago•187 comments

Building Pi with Pi

https://lucumr.pocoo.org/2026/5/24/pi-oss/
47•mplanchard•11h ago•12 comments

CBP Directive 3340-049B: Border Search of Electronic Devices

https://www.cbp.gov/document/directives/cbp-directive-no-3340-049b-border-search-electronic-devices
136•Ember_Wipe•10h ago•92 comments

DeepSeek makes the V4 Pro price discount permanent

https://api-docs.deepseek.com/quick_start/pricing
562•Tiberium•2d ago•506 comments

Companies Are Just a Graph of Algorithms

https://danielmiessler.com/blog/companies-graph-of-algorithms
7•samuel246•1h ago•0 comments

Flick (YC F25) Is Hiring Front End Engineer to Build Figma for AI Filmmaking

https://www.ycombinator.com/companies/flick/jobs/Tdu6FH6-senior-frontend-engineer
1•rayruiwang•12h ago

I keep bouncing off the Scheme language

https://www.sicpers.info/2026/05/i-keep-bouncing-off-the-scheme-language/
140•ingve•2d ago•59 comments