Earlier quoted context omitted.
> it's not possible for human beings to write correct C code, measured over time I don't disagree [1], but remember that Rust can be unsafe too. Async is not a panacea, and it's confusing. And the `unsafe` escape hatch is still unsafe. > you have a professional obligation to use a higher-level language, with stronger guarantees Oh? So we have professional obligations now? For FOSS? News to me. I don't get paid for my…
Ask any experienced C developer and they'd all say "I write excellent C compared to all C programmers out there."
Two types of C programmers
151–160 of 225 posts
Re: Two types of C programmers
#152Earlier quoted context omitted.
What you mean to say is you have no shot at correct C, and so the language scares you, and you believe since you can't do it nobody does. It's true that the community at large writes lots of bugs. But that doesn't mean some people aren't productive with the language and write a relatively low number of bugs. There are some projects with better track records at this than others.
no, that is not what i mean to say at scale, it is not possible for humans to hand-write C programs that are free of segmentation fault class errors this is not controversial or in any way arguable
Re: Two types of C programmers
#153Earlier quoted context omitted.
C is not aligned with modern hardware and optimizing compilers are severely hampered by things like undeclared pointer aliasing.
so then, add a declarator or two to solve the problem, don't just throw the baby out with the bathwater. The population of C programmers who understand how C works is the population of people who can understand how hardware works. The reverse has never been true, hardware designers have never understood software, and academic software experts have spent too much time babysitting college freshman who can't code and sp…
Re: Two types of C programmers
#154Earlier quoted context omitted.
we don't have standard ABIs for either C or C++; we have conventions.
Counterpoint: https://wiki.osdev.org/System_V_ABI The System V ABI is closer to being a standard than some official standards are. C++ gets odd with name mangling, but the platform's C ABI is typically the tune every other language must dance to for its FFI.
https://en.wikipedia.org/wiki/IBM_i
https://os.mbed.com/docs/mbed-os/v6.16/apis/platform.html
Not every OS is written in C, thus the platform ABI isn't always C.
Re: Two types of C programmers
#155Earlier quoted context omitted.
Good points. I like C, I think simplicity and hardware alignment make it very useful. Simplicity wins in the end.
C is not aligned with modern hardware and optimizing compilers are severely hampered by things like undeclared pointer aliasing.
Which language is?
I mean, if you're going to parrot this line, surely you have an example of a language that is more closely aligned to hardware than C, right?
I see this line repeated in every HN thread about C. It's not a new sentiment, but it is mostly wrong because the implication is that there exists some other popular language that actually aligns with the hardware better than C does.
Re: Two types of C programmers
#156Earlier quoted context omitted.
> yet they miss that for Plan 9 and Inferno, they also decided to go with automatic memory management languages And which of these three operating systems won?
Operating systems don't "win" because they make the best technical choices ... or even because they are best for their users.
Re: Two types of C programmers
#157Re: Two types of C programmers
#158Earlier quoted context omitted.
> it's not possible for human beings to write correct C code It's not possible for human beings to write correct code. The hardest bug I ever found in a C program, one that took cumulative weeks of work until a tractable reproduction was found, came down to a ‘ Yes, different languages have different levels of expressiveness, and can preclude or expose different kinds of errors. You'll never have a stray pointer in P…
obviously yes yet c code is inarguably more error-prone than basically any other language
Of course, the errors that do get through might be more severe in C than in python, but not always.
After all, the most expensive and destructive RCE ever was in a piece of Java software.
Re: Two types of C programmers
#159Earlier quoted context omitted.
it's not possible for human beings to write correct C code, measured over time this is not a controversial statement, it's the clear conclusion from any evaluation of available evidence it's fine that you like messing with assembler, but you can't do that safely -- if the programs you write don't need to be correct then carry on, but if they do need to be correct, then you have a professional obligation to use a high…
Oh wow, someone should alert the Linux kernel maintainers. Do you want to tell them that it’s impossible to write correct C code? And the rust compiler team, too. After all, if nobody can write safe assembly then whatever they’re doing is either unsafe or magically gets the computer to understand rust directly. Or are they relying on LLVM for their code generation? I forget what language that’s written in, but nothin…
Re: Two types of C programmers
#160Earlier quoted context omitted.
it's not possible for human beings to write correct C code, measured over time this is not a controversial statement, it's the clear conclusion from any evaluation of available evidence it's fine that you like messing with assembler, but you can't do that safely -- if the programs you write don't need to be correct then carry on, but if they do need to be correct, then you have a professional obligation to use a high…
And yet C code runs the world. You might be right in theory but in practice C is the most successful programming language in history. At work we routinely deploy million+ lines of C in production running large international airlines and airports. And it works.
In early 1980's it was only running Bell Lab's world and a couple of universities that got hold of the source tapes.