frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Faking keyword arguments to functions in C++

https://nibblestew.blogspot.com/2026/06/faking-keyword-arguments-to-functions.html
17•ibobev•2d ago

Comments

kccqzy•1h ago
That's a C99 feature, designated initializer. Hardly modern. Yes it was ported to C++ relatively late, but it happened in C++20.
manwe150•56m ago
Wouldn’t c99 also make you name the type there (looking sort of like a cast), further straying from being just kwargs? I thought this was a c++ deduction feature for it to bind the initializer to whether method could take that list
rwmj•24m ago
Don't C++ designated initializers require you to initialize in struct order? That makes them kind of annoying to use.
seeknotfind•54m ago
If you're calling this across translation units, the calling convention will come with a performance penalty, but boy have we come full circle since pre-ANSI C required you to pass args as a struct. Much love - wish the language required struct and arg list to be the same thing. You can send a list of em and it'll work with algebraic data types for batching calls. The dream. CPU doesn't play nice though since structs aren't register shaped, but maybe they could be in a future calling convention.
DaiPlusPlus•43m ago
To me, “keyword arguments” means actual language keywords being used as arguments, like “minute” or “hour” in T-SQL’s DATEDIFF, for example: `SELECT DATEDIFF( hour, NOW(), someDateCol )`.

…but I think the author meant “named arguments”, like we have in C#, Swift, and Objective-C.

akoboldfrying•33m ago
Reminds me of an idea I had years ago, for implementing "named binary operator syntax" in C++ so that stuff like the following would work:

    int x = 5 <xor> 3; // x = 6
The basic trick was to notice that this is really parsed as:

    int x = ((5 < xor) > 3);
which you could implement with (roughly):

    struct XorType1 { ... } xor;

    struct XorType2 {
      int left;
      XorType2(int left) : left(left) {}
      int operator>(int right) const {
        return left ^ right;
      }
    };

    XorType2 operator<(int left, XorType1 const& ignored) {
      return XorType2(left);
    }
But I sat on this for a while and later discovered someone else had already come up with it :-/

EDIT: Thanks commenter hawkice for fixing my XOR arithmetic!

hawkice•31m ago
This couldn't possibly matter, but 5 xor 3 is 6.
akoboldfrying•9m ago
Lol, thanks! Fixed.
gettingoverit•28m ago
Yeah, I've first seen it over 15 years ago. Usually you use operator of the same priority as you'd like, and also #define xor &xor_i& to get all that detail out of sight.

Nobody ever gets credit for fixing problems that never happened (2001) [pdf]

https://web.mit.edu/nelsonr/www/Repenning=Sterman_CMR_su01_.pdf
193•sam_bristow•3h ago•69 comments

Claude Fable is relentlessly proactive

https://simonwillison.net/2026/Jun/11/fable-is-relentlessly-proactive/
192•lumpa•3h ago•154 comments

Show HN: Homebrew 6.0.0

https://brew.sh/2026/06/11/homebrew-6.0.0/
1050•mikemcquaid•14h ago•244 comments

Show HN: FablePool – pool money behind a prompt, and Fable builds it in public

https://fablepool.com
295•matthewbarras•6h ago•172 comments

If you are asking for human attention, demonstrate human effort

https://tombedor.dev/human-attention-and-human-effort/
369•jjfoooo4•5h ago•114 comments

MiMo Code is now released and open-source

https://mimo.xiaomi.com/mimocode
441•apeters•13h ago•253 comments

Anthropic apologizes for invisible Claude Fable guardrails

https://www.theverge.com/ai-artificial-intelligence/948280/anthropic-claude-fable-invisible-disti...
344•rarisma•16h ago•344 comments

Petition to Withdraw Canada's Bill C-22

https://www.ourcommons.ca/petitions/en/Petition/Sign/e-7416
387•hmokiguess•12h ago•134 comments

A jacket that harvests drinking water from the air

https://news.utexas.edu/2026/06/11/this-jacket-pulls-drinking-water-from-thin-air/
63•ilreb•5h ago•38 comments

Ear Training Practice

https://tonedear.com/
182•mattbit•3d ago•91 comments

Software is made between commits

https://zed.dev/blog/introducing-deltadb
223•jeremy_k•11h ago•166 comments

macOS 27 Beta breaks the ability to boot Asahi Linux

https://www.phoronix.com/news/macOS-27-Beta-Breaks-Asahi
262•josephcsible•2d ago•112 comments

A greyscale iPhone setup that works in everyday life

https://www.fabianhemmert.com/opinions/a-greyscale-iphone-setup-that-works-in-everyday-life
73•hemmert•21h ago•42 comments

Emacs appearances in pop culture

https://ianyepan.github.io/posts/emacs-in-pop-culture/
280•ggcr•1d ago•80 comments

The RCE that AMD wouldn't fix

https://mrbruh.com/amd2/
242•MrBruh•12h ago•105 comments

Lines of code got a better publicist

https://curlewis.co.nz/posts/lines-of-code-got-a-better-publicist/
372•RyeCombinator•15h ago•255 comments

Claude Fable 5: mid-tier results on coding tasks

https://www.endorlabs.com/learn/claude-fable-5-mythos-grade-hype
259•bugvader•12h ago•116 comments

Developer gets Half-Life running at 30 FPS on a Nokia N95

https://www.tomshardware.com/video-games/handheld-gaming/developer-gets-half-life-running-at-30-f...
233•ljf•3d ago•76 comments

Reading for pleasure is sharply down among schoolkids, report shows

https://www.nbcnews.com/data-graphics/kids-reading-less-lower-levels-department-education-study-r...
105•freejoe76•1d ago•124 comments

Faking keyword arguments to functions in C++

https://nibblestew.blogspot.com/2026/06/faking-keyword-arguments-to-functions.html
17•ibobev•2d ago•11 comments

WikiLambda the Ultimate

https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost/2026-05-22/Recent_research
7•Antibabelic•10h ago•2 comments

How a new DSL may survive in the era of LLMs

https://www.williamcotton.com/articles/how-a-new-dsl-survives-in-the-era-of-llms
23•williamcotton•13h ago•7 comments

Show HN: Boo – Screen-style terminal multiplexer built on libghostty

https://github.com/coder/boo
60•kylecarbs•7h ago•20 comments

Waymo Premier

https://waymo.com/blog/2026/06/waymo-premier/
168•boulos•11h ago•420 comments

Making a vintage LLM from scratch

https://crlf.link/log/entries/260525-1/
32•croqaz•19h ago•4 comments

FPS.cob: A first person shooter in COBOL

https://github.com/icitry/FPS.cob
110•MBCook•12h ago•63 comments

Apple didn't revolutionize power supplies; new transistors did (2012)

https://www.righto.com/2012/02/apple-didnt-revolutionize-power.html
101•geerlingguy•10h ago•8 comments

Removing 'um' from a recording is harder than it sounds

https://doug.sh/posts/erm-a-local-cli-that-strips-ums-uhs-and-erms-from-speech/
28•dougcalobrisi•3h ago•9 comments

Open Reproduction of DeepSeek-R1

https://github.com/huggingface/open-r1
209•yogthos•14h ago•17 comments

MTG Bench: Testing how well LLMs can play Magic

https://mtgautodeck.com/articles/mtg-bench/
34•CallumFerg•12h ago•20 comments