Sujet : Re: question about linker
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 06. Dec 2024, 13:28:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <viuqkf$2a0aq$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
User-Agent : Mozilla Thunderbird
On 05/12/2024 14:45, Janis Papanagnou wrote:
On 05.12.2024 12:54, Bart wrote:
That's not going to happen, and it they are casual users of their
compilers, they WILL write semicolons in the wrong place with no errors
reported. Until it bites.
Semicolons, really, are not the problem - AFAIR, in *none* of
the languages I was engaged with.
Not for me either, but for different reasons.
The first few languages I wrote substantial code in (before I started doing my stuff) didn't use semicolons. (That is, Fortran, assembly and a machine-oriented language. Assembly did use semicolons for comments; that was no problem!)
My languages require notional semicolon separators but generally you don't need to write them in source code.
In a 37Kloc codebase in my syntax, I counted 67 semicolons. Mainly in the odd place I wrote multiple statements on one line.
In a 39Kloc C codebase, there were 21,500 semicolons.
This is generated C, so some of those may be following labels! 2000, actually, which still leaves 19,500; a lot of semicolons.
On a preprocessed sql.c test (to remove comments) there were 53,000 semicolons in 85,000 lines.
So in C, they are a very big deal, occuring on every other line. The lines that don't have one, tend to end in {, or contain only }.
Another interesting statistic: 98.5% of semicolons in generated code, and 94.5% of those in the sql test, coincident with end-of-line.