News for hackers. Stuff that matters.
Re:The C Bounded Model Checker: Criminally Underused by WalterBright on Tuesday January 30, 2024 @06:52PM (#39197722)
Thank you for the explanation.

I agree that if one isn't going to enhance C, one is going to have to resort to these tools.

C gets new features now and then. Why not add something incredibly useful, like the slice proposal? Instead, C23 got enhanced with the crazy Unicode identifiers. Richard Cattermole has been adding them to D's C support, requiring 6000 lines of code!!

https://github.com/dlang/dmd/pull/15307

The entire C parser is 6000 lines of code:

https://github.com/dlang/dmd/blob/master/compiler/src/dmd/cp...

Re:The C Bounded Model Checker: Criminally Underused by nanolith on Tuesday January 30, 2024 @07:25PM (#39198017)
Yeah... I'm not too happy with some of the choices made in C18 and C23. One of the reasons why I chose to standardize my C SAX-like parser on C18 for now was to avoid the Unicode complexity. There's also a widening feature gap between modern C and modern C++ that makes interop harder.
Re:The C Bounded Model Checker: Criminally Underused by lifthrasiir on Tuesday January 30, 2024 @11:56PM (#39200112)
> Richard Cattermole has been adding them to D's C support, requiring 6000 lines of code!!

I wondered if you were implementing a normalization (which is complicated), but that doesn't seem the case? I have read the PR and it's clear that it solves multiple issues at once: no start-continue distinction (bug), a code generator, the table itself (which is just an inefficiently formatted block of data). 6000 lines of code just for Unicode identifiers are simply an exaggeration.

Re:The C Bounded Model Checker: Criminally Underused by WalterBright on Wednesday January 31, 2024 @02:37AM (#39201116)
There are different ways to count lines. I included in the C parser count the comment lines.

6000 is also a round number, I did that deliberately to imply the number was not exact.

Re:The C Bounded Model Checker: Criminally Underused by lifthrasiir on Wednesday January 31, 2024 @03:56AM (#39201580)
A new generated code alone is 4000 lines long [1]. The actual code added is just 2000 lines, and some are used to pay debts, I mean, to make a proper code generator. It is debatable whether that generator should count in the number of lines, since you can always write a generator in a simpler scripting language (for example, Rust uses Python to generate the `unicode-xid` crate). In any case however it is far less complex and, in my opinion, much smaller than the entire C parser proper.

[1] https://github.com/dlang/dmd/pull/15307/files#diff-3677bcc89...

Re:The C Bounded Model Checker: Criminally Underused by mhh__ on Wednesday January 31, 2024 @05:56PM (#39210602)
Most big PRs are only big because pull requests are a fundamentally bad model for doing work that's already been planned.
Re:The C Bounded Model Checker: Criminally Underused by rurban on Wednesday January 31, 2024 @01:52AM (#39200810)
> C23 got enhanced with the crazy Unicode identifiers.

Actually, this spec security bug was added with C11. But nobody really added it, until gcc decided that this new "feature" needs to be supported around C23 time. C23 tried to mitigate that mess by disallowing non-identifiable normalization variants, but still does not care about Unicode security guidelines.