Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c    |    Meh, in C you gotta define EVERYTHING    |    243,242 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 241,519 of 243,242    |
|    bart to David Brown    |
|    Re: New and improved version of cdecl    |
|    27 Oct 25 11:22:03    |
      From: bc@freeuk.com              On 27/10/2025 09:44, David Brown wrote:       > On 26/10/2025 16:12, bart wrote:       >> On 25/10/2025 16:18, David Brown wrote:       >>> On 25/10/2025 14:51, bart wrote:       >>>       >>>> This is another matter. The CDECL docs talk about C and C++ type       >>>> declarations being 'gibberish'.       >>>>       >>>> What do you feel about that, and the *need* for such a substantial       >>>> tool to help understand or write such declarations?       >>>>       >>>> I would rather have put some effort into fixing the syntax so that       >>>> such tools are not necessary!       >>       >>> 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).       >>       >       > No, you have not.       >       > What you have proposed is a different way to write types in       > declarations, in a different language. That's fine if you are making a       > different language. (For the record, I like some of your suggestions,       > and dislike others - my own choice for an "ideal" syntax would be       > different from both your syntax and C's.)       >       > I asked you if you had a plan for /fixing/ the syntax of /C/. You don't.       >       > As an analogy, suppose I invited you - as an architect and builder - to       > see my house, and you said you didn't like the layout of the rooms, the       > kitchen was too small, and you thought the cellar was pointless       > complexity. I ask you if you can give me a plan to fix it, and you       > respond by telling me your own house is nicer.              Where did I say anything about my own house?              I added a scheme for LTR type declarations such as you find in many       other languages (where do you think I copied mine from?).              I had to use 'ref' instead of '*' to avoid grammar ambiguities since in       C, '*' can also start an expression.              Your analogy is poor, but I would set up additional kitchen facilities       in another room, or in an extension. (My brother did exactly this.)              If my scheme was actually added and become popular, the old one could       eventually be deprecated.              And yes it does 'fix' it by not requiring the use of tools like CDECL       when writing new code: type-specs are already in LTR, more English-like       form.              CDECL might still be needed for decoding gibberish in legacy code, or       where you have to maintain such code in the same style.               > - my own choice for an "ideal" syntax would be        > different from both your syntax and C's.)        >              It sounds like it would also be different from CDECL. Perhaps you should       contact the author to tell him what he's doing wrong!              BTW on an old compiler for my language, I had a bit of fun by       implementation those ideas I mentioned for making syntax CDECL-like. So       this was legal code:               pointer to function(int, int) returning real fnptr              What's missing is having the variable name on the left (I added that as       an experiment - allowing it on left OR right - in a different version!)              However it is too long-winded and verbose; it adds too much clutter and       is too much typing. When displaying diags, the compiler represents that       type like this:               ref proc(i64 $1,i64 $2)r64              which is close to the normal syntax.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca