frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

C++26: The Oxford Variadic Comma

https://www.sandordargo.com/blog/2026/03/11/cpp26-oxford-variadic-comma
53•ingve•4d ago

Comments

mFixman•1h ago
I used to slay with this in code golfing competitions from TopCoder, where you had to implement a function to solve a particular problem, thanks to C pointer maths and the gcc generally putting function arguments in order in the stack.

Turns out, these two are equivalent in practice (but UB in the C++ standard):

    double solve(double a, double b, double c, double d) {
      return a + b + c + d;
    }

    double solve(double a ...) {
      return a + 1[&a] + 2[&a] + 3[&a];
    }
camel-cdr•1h ago
K&R syntax is -1 char, if you are in C:

    double solve(double a,double b,double c,double d){return a+b+c+d;}
    double solve(double a...){return a+1[&a]+2[&a]+3[&a];}
    double solve(a,b,c,d)double a,c,b,d;{return a+b+c+d;}
mananaysiempre•40m ago
> Turns out, these two are equivalent in practice

Not in the x86-64 SysV ABI they aren’t. The arguments will be passed in registers (yes, even the variadic ones), so how your compiler will interpret 1[&a] is anybody’s guess. (For me, x86_64-unknown-linux-gnu-g++ -O2 yields, essentially, return a+a+a+a; which is certainly an interpretation. I’m also getting strange results from i686-unknown-linux-gnu-g++ -O2, but my x87 assembly is rusty enough that I don’t really get what’s going on there.)

advael•1h ago
This seems pretty good to me just on the level of trying to read C as someone using C++. Parameter packs and variadic templates are easily the most confusing syntax in C++ and cleaning it up is... very welcome
jkaplowitz•1h ago
Hats off for using "..." in your comment immediately after a valid identifier word and with no comma in between, given the topic of the article.
advael•18m ago
Hats off for noticing. Not to be taken for granted in an increasingly skimming-oriented world
lasgawe•1h ago
learned something new. thanks for the article.
throwaway2027•1h ago
C++ got too complicated after C++23 I went back to C.
Conscat•43m ago
No offense intended to your perspective, but I do find it a little amusing that C++23, which was generally considered a disappointingly small update due to COVID complications, was the breaking point in complexity.
FartyMcFarter•41m ago
You can always restrict yourself to a subset of C++ that takes advantage of RAII (resource handling is extremely painful in C), and get performance benefits like move semantics, without the insanely complex stuff.

I love C, but C++ has worthwhile advantages even if you heavily restrict which features you use.

jjgreen•25m ago
C is the new vinyl.
staplung•1h ago
Of course since the old syntax is merely deprecated and not removed, going forward you now have to know the old, bad form and the new, good form in order to read code. Backwards compatibility is a strength but also a one-way complexity ratchet.

At least they managed to kill `auto_ptr`.

Conscat•44m ago
PyCuda 2024, used fairly often in certain industries, still contains `auto_ptr` ;-;
zlfn•1h ago
C++ seems to be constantly getting complicated. If the major version were to change, there wouldn't be any need for backward compatibility with the existing code, and it would have been okay to delete that syntax while creating an automatic formatter.
dnmc•1h ago
Are you suggesting we move to C++++?
zlfn•58m ago
It's already there. It's called C#
HackerThemAll•40m ago
Well, C# also has its quirks already. Like the crippled finalizers which are never to be used. If the IDisposable interface had been correctly designed, finalizers could become be the "public void Dispose(void)". Or the manual passing of Task in case of async methods, which is... kinda smelly.
m-schuetz•32m ago
Personally I like C+. Picking the nice parts of C++, but skipping all the nonsense. I just wish C++ hadn't deliberately screwed up designated initializers with mandatory ordering. The C version of it that allows out-of-order assignments is clearly superior.
HackerThemAll•43m ago
Yes, but no. I learned C++ in '90s when it was C with classes and some other noise added by Stroustrup. During the some 25 years that followed it had became a mess that's insanely hard to work with. I'm not going back to this language. I prefer plain C or Rust, leaning towards Rust when I fully comprehend the lifetime and borrow checker. Or when I have the luxury of having a GCed runtime, then the .NET with its easiest C# language with wonderful abundance of great libraries is the best choice. Nobody was ever fired for using .NET (for right purposes).

Let your Coding Agent debug the browser session with Chrome DevTools MCP

https://developer.chrome.com/blog/chrome-devtools-mcp-debug-your-browser-session
31•xnx•38m ago•5 comments

What makes Intel Optane stand out (2023)

https://blog.zuthof.nl/2023/06/02/what-makes-intel-optane-stand-out/
120•walterbell•4h ago•94 comments

Separating the Wayland compositor and window manager

https://isaacfreund.com/blog/river-window-management/
114•dpassens•4h ago•46 comments

In Memoriam: John W. Addison, my PhD advisor

https://billwadge.com/2026/03/15/in-memoriam-john-w-addison-jr-my-phd-advisor/
39•herodotus•4h ago•4 comments

C++26: The Oxford Variadic Comma

https://www.sandordargo.com/blog/2026/03/11/cpp26-oxford-variadic-comma
53•ingve•4d ago•19 comments

Glassworm Is Back: A New Wave of Invisible Unicode Attacks Hits Repositories

https://www.aikido.dev/blog/glassworm-returns-unicode-attack-github-npm-vscode
142•robinhouston•6h ago•77 comments

Learning athletic humanoid tennis skills from imperfect human motion data

https://zzk273.github.io/LATENT/
60•danielmorozoff•4h ago•6 comments

Bus travel from Lima to Rio de Janeiro

https://kenschutte.com/lima-to-rio-by-bus/
23•ks2048•4d ago•2 comments

A Visual Introduction to Machine Learning (2015)

https://r2d3.us/visual-intro-to-machine-learning-part-1/
268•vismit2000•9h ago•24 comments

Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300

https://firthemouse.github.io/
39•FirTheMouse•4h ago•7 comments

LLM Architecture Gallery

https://sebastianraschka.com/llm-architecture-gallery/
26•tzury•3h ago•1 comments

Rack-mount hydroponics

https://sa.lj.am/rack-mount-hydroponics/
317•cdrnsf•15h ago•85 comments

Show HN: Signet – Autonomous wildfire tracking from satellite and weather data

https://signet.watch
92•mapldx•7h ago•27 comments

Hollywood Enters Oscars Weekend in Existential Crisis

https://www.theculturenewspaper.com/hollywood-enters-oscars-weekend-in-existential-crisis/
73•RickJWagner•7h ago•226 comments

Show HN: What if your synthesizer was powered by APL (or a dumb K clone)?

https://octetta.github.io/k-synth/
55•octetta•6h ago•27 comments

Grandparents are glued to their phones, families are worried [video]

https://www.bbc.com/reel/video/p0n61dg3/grandparents-are-glued-to-their-phones-families-are-worried
114•tartoran•2h ago•66 comments

Autoresearch Hub

http://autoresearchhub.com/
6•EvgeniyZh•1d ago•2 comments

Kniterate Notes

https://soup.agnescameron.info//2026/03/07/kniterate-notes.html
44•surprisetalk•5d ago•10 comments

IBM, sonic delay lines, and the history of the 80×24 display (2019)

https://www.righto.com/2019/11/ibm-sonic-delay-lines-and-history-of.html
60•rbanffy•8h ago•15 comments

How kernel anti-cheats work

https://s4dbrd.github.io/posts/how-kernel-anti-cheats-work/
321•davikr•19h ago•277 comments

$96 3D-printed rocket that recalculates its mid-air trajectory using a $5 sensor

https://github.com/novatic14/MANPADS-System-Launcher-and-Rocket
322•ZacnyLos•9h ago•299 comments

Generating All 32-Bit Primes (Part I)

https://hnlyman.github.io/pages/prime32_I.html
64•hnlyman•8h ago•20 comments

The 100 hour gap between a vibecoded prototype and a working product

https://kanfa.macbudkowski.com/vibecoding-cryptosaurus
188•kiwieater•7h ago•247 comments

A most elegant TCP hole punching algorithm

https://robertsdotpm.github.io/cryptography/tcp_hole_punching.html
195•Uptrenda•16h ago•78 comments

Why Mathematica does not simplify sinh(arccosh(x))

https://www.johndcook.com/blog/2026/03/10/sinh-arccosh/
130•ibobev•4d ago•49 comments

Allow me to get to know you, mistakes and all

https://sebi.io/posts/2026-03-14-allow-me-to-get-to-know-you-mistakes-and-all/
283•sebi_io•21h ago•140 comments

Treasure hunter freed from jail after refusing to turn over shipwreck gold

https://www.bbc.com/news/articles/cg4g7kn99q3o
156•tartoran•17h ago•215 comments

UMD Scientists Create 'Smart Underwear' to Measure Human Flatulence

https://cbmg.umd.edu/news-events/news/brantley-hall-umd-scientists-create-smart-underwear-measure...
70•ohjeez•4h ago•43 comments

Human Organ Atlas

https://www.science.org/doi/10.1126/sciadv.adz2240
67•bookofjoe•3d ago•4 comments

Zipp 2001 Restoration

https://robot-daycare.com/posts/zipp-2001-restoration-part-1/
21•o4c•4d ago•1 comments