Path: csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: New and improved version of cdecl Date: Mon, 27 Oct 2025 13:48:23 -0700 Organization: None to speak of Lines: 65 Message-ID: <87cy68136w.fsf@example.invalid> References: <87bjlyobts.fsf@example.invalid> <10dbvqs$12d0f$1@dont-email.me> <10dd0fj$1jbcv$1@dont-email.me> <87jz0l2pal.fsf@example.invalid> <10dei5s$28h93$1@dont-email.me> <8734792h4y.fsf@example.invalid> <10dfusd$2k0q4$1@dont-email.me> <10dgdc7$2of3m$1@dont-email.me> <10dghp5$2q30g$1@dont-email.me> <10dias4$37h93$1@dont-email.me> <10dih4v$3ano2$1@dont-email.me> <10dipo6$3dtld$1@dont-email.me> <10dldp9$2igd$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 27 Oct 2025 20:48:24 +0000 (UTC) Injection-Info: dont-email.me; posting-host="d0da762879077c0b8c76f50e723778d0"; logging-data="1247403"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//oYItMn49HvYGJmSAGIYI" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:n21AXIXMAekgeotudRgIKP9fO14= sha1:iOVQbHYYTWvBSSwf2dUeWhmM5GE= Xref: csiph.com comp.lang.c:394821 bart writes: > On 25/10/2025 16:18, David Brown wrote: [...] >> And I'd love to hear your plan for "fixing" the syntax of C - noting >> that changing the syntax of C means getting the C standards >> committee to accept your suggestions, getting at least all major C >> compilers to support them, and getting the millions of C programmers >> to use them. > > I have posted such proposals in the past (probably before 2010). > > I can't remember the exact details, but I think it is possible to > superimpose LTR type syntax on top of the existing language. [...] If I understand correctly (you haven't been entirely clear about it), your proposal is to create a new friendlier declaration syntax for C, and have a new version of C support both the existing syntax and your new syntax. So in your hypothetical future C, one might have: int *const *p1; p1: pointer to const pointer to int; in the same program. I haven't seen a *concrete* proposal. If I thought the whole thing were a good idea, I'd encourage you to write one. In my personal opinion, C's declaration syntax, cleverly based on a somewhat loose "declaration follows use" principle, is a not entirely successful experiment that has caught on extraordinarily well, probably due to C's other advantages as a systems programming language. I would have preferred a different syntax **if** it had been used in the original C **instead of** the current syntax. I do not think C's syntax is any kind of "joke", as you do. It's entirely consistent and well defined. All else being equal, I would prefer a C-like language with clear left-to-right declaration syntax to C as it's currently defined. But all else is not at all equal. And I think that a future C that supports *both* the existing syntax and your new syntax would be far worse than C as it is now. Programmers would have to learn both. Existing code would not be updated. Most new code, written by experienced C programmers, would continue to use the old syntax. Your plan to deprecate the existing syntax would fail. And that's why it will never happen. The ISO C committee would never consider this kind of radical change, even if it were shoehorned into the syntax in a way that somehow doesn't break existing code. You have spent years complaining here about C's syntax (to people who are not in a position to do anything about it). If you had spent half that time learning how it works, you'd be a world-class expert by now, and you could teach others how to use it rather than deliberately confusing them with contrived examples. You can of course create your own language with a cleaner syntax. Apparently you've done so, but not in a way that's useful to most of us -- not that you're obligated to make it useful to anyone else. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */