News for hackers. Stuff that matters.
Re:Nvidia Security Team: “What if we just stopped using C?” by docandrew on Monday November 07, 2022 @10:22AM (#33506928)
C is like asbestos. It was fine at what it did, good performance, but the safety problems outweigh them. The difference is that we _stopped using asbestos_ because it was unsafe. It’s still around but being replaced during renovations, and no new installations use it.

For whatever reason with C there’s this huge emotional component to it. Safer alternatives exist. You’d rightfully laugh at a contractor who suggested asbestos is fine, if you make sure to use only highly-skilled installers who patch up the drywall so that no fibers can escape. But with C we say that all the time, and the CVEs keep piling up.

Re:Nvidia Security Team: “What if we just stopped using C?” by georgeecollins on Monday November 07, 2022 @10:38AM (#33507167)
That's a great analogy. I like C, and when people resist it I worry about their programming skills. That may not be fair, but sometimes the complexity of C / C++ is a version of complexity you will see in a big application.Sometimes the complexity is needless, confusing, dangerous-- insert what you hate here.

But really Rust seems to have the qualities I like about C and less problems. Also, all the reasons I used to have for wanting to be "close to the metal" are getting abstracted away in hardware. I think the only remaining reasons to use C is the huge existing code base.

Re:Nvidia Security Team: “What if we just stopped using C?” by 3a2d29 on Monday November 07, 2022 @10:42AM (#33507229)
Although the article is about Ada, which is technically more memory safe than rust.
Re:Nvidia Security Team: “What if we just stopped using C?” by tmtvl on Monday November 07, 2022 @05:41PM (#33513571)
I'd like to see the Ada guys, and especially the SPARK guys, talk about Rust the way Rust people talk about C. That said, I'm just gonna add ACL2 to my Common Lisp toolbox and then I too will have the power of theorem proving.
Re:Nvidia Security Team: “What if we just stopped using C?” by flohofwoe on Monday November 07, 2022 @10:44AM (#33507276)
A couple of points from somebody who enthusiastically writes new C code every day:

> ...the complexity of C / C++

In this case, please don't throw C and C++ into the same bucket, C++ is vastly more complex than C.

> Rust seems to have the qualities I like about C

...a subset of Rust has those qualities, but the whole of Rust has the same problems as C++: overboarding complexity both in the language and stdlib.

To lure C users over to a memory-safe language, we need a programming language that just adds the comptime memory-safety features to a 'small language' like C, but none of the higher level features (which only serve to split the language community into different tribes - which is also the biggest problem of C++).

Finally: yes, C is not memory safe, but when 'language-level memory safety' is essential for security, then there's something fundamentally wrong with the sandbox the compiled C code runs in.

Re:Nvidia Security Team: “What if we just stopped using C?” by danenania on Monday November 07, 2022 @11:29AM (#33508000)
“...when 'language-level memory safety' is essential for security, then there's something fundamentally wrong with the sandbox the compiled C code runs in.”

Doesn’t the problem then just become what do you write the sandbox in? If you have security-critical code that can’t be sandboxed, because it is the sandbox, then it seems that language-level safety is your only remaining defense?

Re:Nvidia Security Team: “What if we just stopped using C?” by flohofwoe on Monday November 07, 2022 @11:32AM (#33508044)
Yes, it definitely makes a lot of sense to write the sandbox in a memory safe language like Rust. Not even the most die hard C fan would argue against that ;)
Re:Nvidia Security Team: “What if we just stopped using C?” by AmpsterMan on Monday November 07, 2022 @11:06AM (#33507641)
I actually find that Go has the qualities of C that I like. Namely, simpler language constructs and no classes.
Re:Nvidia Security Team: “What if we just stopped using C?” by adgjlsfhk1 on Monday November 07, 2022 @12:43PM (#33509242)
Even if a C program is sandboxed, lots of programs handle sensitive data that memory errors can leak. For a simple example, even in a sandbox, a memory error could pretty easily lead to being able to grab another user's password out of memory.
Re:Nvidia Security Team: “What if we just stopped using C?” by raxxorraxor on Tuesday November 08, 2022 @05:20AM (#33517733)
I am not yet convinced that Rust is a sufficient answer to C. Its constraints do solve some issues, but I am not really convinced. Also personally dislike the self-identification of Rust users. Rustafarian? Seriously?

You probably get accustomed to it, but I am not sure if I want to yet. Not deep enough into compilers to know why variables cannot be implicitly mutable or not. Probably a compiler necessity to enact its borrowing rules. But ultimately the compiler should make my life easier. Only ever using one thread or process does solve several common locking issues.

In that regard C string handling will probably let more people move away from it than its security flaws.

It will probably end up like always. There are some applications where some languages shine. And the simplicity of C has merits, otherwise another language would have taken its place. Of course C still has a lot of momentum and perhaps another language would do better in the specific use case.

Re:Nvidia Security Team: “What if we just stopped using C?” by nickm12 on Tuesday November 08, 2022 @07:31AM (#33518349)
Rust users are called Rustaceans.
Re:Nvidia Security Team: “What if we just stopped using C?” by raxxorraxor on Tuesday November 08, 2022 @01:35PM (#33522525)
Heh, right. I believe I like to stay with that point anyway.
Re:Nvidia Security Team: “What if we just stopped using C?” by nspattak on Monday November 07, 2022 @10:39AM (#33507178)
In my opinion, the problem is that we failed to create some additional layers on top of C. an extended std lib with data structs and algorithms as well as a style/practices for everyday use (ie non compiler writers).

i adore C, it was my first language and i still like its simplicity very much. Still, I have come to believe that only strictly vetted licensed people should be allowed to use it :)

Re:Nvidia Security Team: “What if we just stopped using C?” by pclmulqdq on Monday November 07, 2022 @11:17AM (#33507790)
There are an incredibly large number of analysis tools for C to check things like memory safety. It doesn't look like they are always used in important code, though.

A lot of memory safety CVEs come down to "we wrote a static analyzer and found a latent memory bug here."

Re:Nvidia Security Team: “What if we just stopped using C?” by timbit42 on Monday November 07, 2022 @11:22AM (#33507878)
Maybe a language with the checking by default in the compiler would be a good idea, like Ada or SPARK.
Re:Nvidia Security Team: “What if we just stopped using C?” by ilyt on Monday November 07, 2022 @11:21AM (#33507865)
That doesn't stop bugs, that just makes them less likely. VS making them impossible on accident
Re:Nvidia Security Team: “What if we just stopped using C?” by sokoloff on Monday November 07, 2022 @10:32AM (#33507083)
There are still industrial uses of asbestos today, because for some applications, there isn't a ready drop-in replacement. Uses where safer drop-in replacements were possible (shingles, automotive friction materials, flooring, insulation) have gone away. That might be a good comparison against portable-assembly, aka C.
Re:Nvidia Security Team: “What if we just stopped using C?” by vanattab on Monday November 07, 2022 @10:52AM (#33507399)
Out of curiosity what are the modern uses for asbestos?
Re:Nvidia Security Team: “What if we just stopped using C?” by Agrue8u on Monday November 07, 2022 @10:55AM (#33507455)
Re:Nvidia Security Team: “What if we just stopped using C?” by blagie on Monday November 07, 2022 @10:53AM (#33507416)
I think the problem NVidia has is that it has a massive low-level high-performance computing infrastructure written in C. Things like WebGL are a thin veneer over it, which is terrifying.

Their use combines the proper use of C (low-level driver code) with the unsafe use (large-scale systems). They should absolutely stop using C. On the other hand, I think it's fine for my network driver.

Re:Nvidia Security Team: “What if we just stopped using C?” by paulmd on Monday November 07, 2022 @03:02PM (#33511558)
I was talking with someone in charge of coordinating WebGL rollout with various IHV driver teams and they said while AMD and NVIDIA were definitely annoyed at the work it was going to take, Intel was the one where the team reacted with sheer terror.

Maybe that speaks to some of the driver problems they're having now, if their house just wasn't in order beforehand.

Re:Nvidia Security Team: “What if we just stopped using C?” by blagie on Monday November 07, 2022 @05:17PM (#33513354)
The cynic in me says that Intel is the only vendor of the three who has thought about security before.

I am willing to bet that NVidia and AMD's GPU unit have floodgates of vulnerabilities along the lines of Spectre, which they simply never had to deal with before (not to mentions likely hundreds of more basic ones).

Re:Nvidia Security Team: “What if we just stopped using C?” by paulmd on Tuesday November 08, 2022 @11:35AM (#33520907)
> I am willing to bet that NVidia and AMD's GPU unit have floodgates of vulnerabilities along the lines of Spectre,

100%, I'm not anybody in particular but I've been saying this for years, as soon as I saw Spectre/Meltdown announced it's like "lol yeah I bet GPUs have zero hardening against that sort of thing". I hadn't thought of the connection between Meltdown and that person's comment but it's entirely possible the Intel team was deep in Meltdown at that moment when they got presented that lol.

Also Intel in particular seems to have uniquely tight ties between the iGPU and the CPU, since they come from a world where dGPUs didn't exist and the iGPU was only ever a ringbus away from memory or the CPU... it's apparently been a huge problem with the Xe/Arc drivers (there have been a couple patches where they produced 100x speedups by fixing operations that allocate memory in the wrong place, etc) since the GPU is suddenly no longer super close. It would not surprise me at all if AMD would be more secure because they're not working with an iGPU that's super tightly tied to the CPU like that.

https://www.pcworld.com/article/819397/intels-graphics-drive...

But yeah anyway I totally agree, multi-tenant or multi-privilege-level GPU is likely a shitshow, so in a way it's actually a blessing that heavy GPGPU compute never really took off. Because I bet you can totally do things like leak the desktop or your browser windows to malicious webGL or another tenant on a shared vGPU. We live in a world where clients are mostly running one GPGPU application at a time, plus the desktop.

(Although of course, it's always a little useless to speculate about the world going completely differently... if multi-tenant/multi-app GPGPU compute had taken off, more attention probably would have been paid to multi-user security/hardening.)

Re:Nvidia Security Team: “What if we just stopped using C?” by Workaccount2 on Monday November 07, 2022 @10:32AM (#33507096)
Forgive my ignorance, I'm a hobby embedded programmer at best, but aren't many programming languages built right on top of C? Is the whole lineage unsafe, or is it really just C?
Re:Nvidia Security Team: “What if we just stopped using C?” by AlotOfReading on Monday November 07, 2022 @10:41AM (#33507218)
Anything where a human is writing C is probably unsafe. Machine generated C can also be unsafe, but I'm unaware of an epidemic of systematic issues resulting from it the way we get with human C.
Re:Nvidia Security Team: “What if we just stopped using C?” by M4v3R on Monday November 07, 2022 @10:39AM (#33507177)
Not really. Many programming languages compile themselves nowadays (it's called bootstrapping) so there's no direct C lineage in them.
Re:Nvidia Security Team: “What if we just stopped using C?” by gnarbarian on Monday November 07, 2022 @10:39AM (#33507184)
yes. if the compiler was written in c and there is a bug in the compiler that language could be tainted.
Re:Nvidia Security Team: “What if we just stopped using C?” by pannSun on Monday November 07, 2022 @12:07PM (#33508659)
When people say "C is unsafe", what they mean is "it is too easy to create unintended vulnerabilities when writing C". The language won't catch your mistakes, and some of those mistakes are dangerous. "Safety" in this context means "language, compiler, or runtime features to prevent, catch, or mitigate mistakes made by human programmers".

So this doesn't actually affect things built on top of C. E.g. transpiling Rust to C won't make it any less safe because C is "unsafe" - Rust has its own safety features, that work regardless of compile target.

Or think of it this way - assembly language is even more unsafe than C, yet everything (including C) is built on top of that.

Re:Nvidia Security Team: “What if we just stopped using C?” by paulmd on Monday November 07, 2022 @02:58PM (#33511481)
Transpiling rust to C is still dangerous if you don't control the compiler on the other side - one of the many footguns with C is thinking that there is any "inherently safe" C code. There isn't, because tomorrow the optimizing compiler may optimize away your null checks or start optimizing away your variables due to aliasing, and this danger is ever-present because of the sweeping nature of "undefined behavior" in C.

C is safe if you are using a 1970s-style compilers that don't perform optimizations, or perform a limited and predictable subset. C that is passed through an optimizing compiler (which in the context of this comment is all modern compilers) can never be inherently safe unless you conform strictly to the "undefined behavior" spec which is impossible in practice.

In contrast transpiling (really this is just compiling) Rust to assembly should never be unsafe, because you know there is no additional transformation step. Or at least, unless the processor has an implementation flaw... which is, of course, the whole thing about Spectre/Meltdown.

C has far far too many things in the "unsafe behavior" categories that really should just be compiler errors. But like "implementation-dependent" behavior in general, this was seen as an advantage at the time, it makes it possible for low-power or esoteric hardware to be driven with C code. But in modern high-level software development contexts, this makes it a foot-howitzer to try and use.

Re:Nvidia Security Team: “What if we just stopped using C?” by pannSun on Monday November 07, 2022 @03:27PM (#33511905)
Thank you for the correction. I agree with everything you wrote, and should have known better and added a caveat regarding the difficulty of correctly divining the behavior of a C program, instead of assuming compiler writers are flawless omniscient beings.
Re:Nvidia Security Team: “What if we just stopped using C?” by Dylan16807 on Monday November 07, 2022 @03:47PM (#33512191)
Why don't you think it's possible to avoid undefined behavior in machine-emitted C?

Machine-emitted C can avoid most of the language, guarantee it won't incorrectly alias anything, and guarantee bounds are always checked.

Bugs are possible but you can make Rust->C bugs no more likely than Rust->assembly bugs.

Re:Nvidia Security Team: “What if we just stopped using C?” by myth_drannon on Monday November 07, 2022 @10:33AM (#33507104)
Ouch, that's a hurtful analogy. I was about to start playing with Turbo C on my 486, ordered K&R book...
Re:Nvidia Security Team: “What if we just stopped using C?” by smcl on Monday November 07, 2022 @10:50AM (#33507363)
I think it is a little bit melodramatic as an analogy. It's perfectly fine to tinker with C, to use it in personal projects, to use it where it's not possible to use something safer (some embedded system that Rust doesn't have a backend for) or if you want to contribute to an existing project like Linux, OpenBSD or CPython. Whereas it's really not a good idea to work with Asbestos under any circumstances.

But the message overall - that maybe we don’t need to instinctively reach for C for newbuild low-level programming anymore - is probably about right

Re:Nvidia Security Team: “What if we just stopped using C?” by docandrew on Monday November 07, 2022 @10:50AM (#33507370)
As long as it doesn’t have a modem you’re probably safe. Probably.
Re:Nvidia Security Team: “What if we just stopped using C?” by lelanthran on Monday November 07, 2022 @10:55AM (#33507458)
> Ouch, that's a hurtful analogy.

It's also wrong. A lot of the time the people making these types of comments about C are just plain bitter that their favourite $NEW_LANGUAGE is mostly a rounding error in terms of usage.

Re:Nvidia Security Team: “What if we just stopped using C?” by wiseowise on Monday November 07, 2022 @01:09PM (#33509637)
> A lot of the time the people making these types of comments about McDonald’s are just plain bitter that their favourite $3_STAR_MICHELIN_RESTAURANT is mostly a rounding error in terms of visitors.
Re:Nvidia Security Team: “What if we just stopped using C?” by lelanthran on Monday November 07, 2022 @02:07PM (#33510674)
> A lot of the time the people making these types of comments about McDonald’s are just plain bitter that their favourite $3_STAR_MICHELIN_RESTAURANT is mostly a rounding error in terms of visitors.

That's true too; what's your point?

Re:Nvidia Security Team: “What if we just stopped using C?” by Dylan16807 on Monday November 07, 2022 @03:51PM (#33512253)
The supposed bitterness doesn't actually make their criticism of McDonald's wrong.
Re:Nvidia Security Team: “What if we just stopped using C?” by mmis1000 on Monday November 07, 2022 @12:49PM (#33509331)
I guess you need to know it enough to know why people don't want them now.

Like, everyone knows typescript catches more human mistake that JavaScript. But you won't know why if you don't know JavaScript at first place.

Re:Nvidia Security Team: “What if we just stopped using C?” by Dylan16807 on Monday November 07, 2022 @03:53PM (#33512269)
Were you planning to write production software on your 486? I don't see why it should hurt you at all.

If there's a joke here I missed it, sorry.

Re:Nvidia Security Team: “What if we just stopped using C?” by spenczar5 on Monday November 07, 2022 @10:43AM (#33507250)
This is not a very useful analogy. It suggests that we should regulate C out of existence. But regulation was appropriate and effective for a particular reason with asbestos.

We stopped using asbestos because of the link between its manufacture/installation and lung cancer. It’s a clear case where government regulation helps deal with a market failure: asbestos is cheap and effective, so consumers like it, but nobody involved in asbestos transactions bears the cost of the lung cancers the industry causes.

Writing C doesn’t make underpaid programmer die early deaths. The issues with C are borne directly by the customers who are using C software. It’s not really a market failure of any kind.

Re:Nvidia Security Team: “What if we just stopped using C?” by 411111111111111 on Monday November 07, 2022 @11:07AM (#33507652)
> The issues with C are borne directly by the customers who are using C software. It’s not really a market failure of any kind.

While I agree that equating a programming language to a carcinogenic substance is inherently wrong, your argument is partially false too.

The cost is born by the costumers of the software, not the developers. In that sense, it's actually directly opposed to your point.

Re:Nvidia Security Team: “What if we just stopped using C?” by spenczar5 on Monday November 07, 2022 @11:19AM (#33507839)
Isn’t that what I said? I don’t see any difference.
Re:Nvidia Security Team: “What if we just stopped using C?” by 411111111111111 on Monday November 07, 2022 @11:31AM (#33508036)
If you did then I dont understand the point you're making with the given example.

with the language you've got

  * the creators of C
  * the developers writing software (tool/library/whatever) with C
  * the users which use this software 
If the software has a security issue, the cost will have to be born by the users, not the developers.

That makes it (imo) directly opposed to your argument, as its technically the same as with the carcinogenic substance

  * the creators of the substance dont get cancer
  * the contractors using it to build the house dont get cancer
  * the people that live in the house get cancer
Re:Nvidia Security Team: “What if we just stopped using C?” by littlestymaar on Monday November 07, 2022 @12:46PM (#33509280)
Asbestos is killing mostly the contractors instead of the users, which is breaks the analogy here. (That being said, any argument using the “market failure” concept is dubious from the beginning)
Re:Nvidia Security Team: “What if we just stopped using C?” by _hexley_ on Monday November 07, 2022 @12:54PM (#33509417)
I see where your confusion stems from. In the case of asbestos, it is the contractors using it to build the house who tend to experience adverse health effects, and not always the people who live there. Asbestos is harmless when it's inert in the wall, paint, etc. The danger is when you start doing construction / renovations and the dust is free floating.

So OP's point is correct. The two situations are not exactly analogous.

Re:Nvidia Security Team: “What if we just stopped using C?” by RoyTyrell on Monday November 07, 2022 @01:27PM (#33509954)
Well the creators of the substance (manufacturers who used asbestos in their products) and the contractors that installed the products did in fact also get cancer.

You're both a little bit wrong, and both want to be right, so seem to be ignoring the negative aspects of both your arguments.

C does not have a direct proven link to causing death or catastrophic disease like asbestos does, but any bugs due to language "allowing" the dev to shoot themselves in the foot is largely born by the users - at least initially.

Re:Nvidia Security Team: “What if we just stopped using C?” by spenczar5 on Monday November 07, 2022 @10:44PM (#33515674)
As others said - asbestos is really bad for asbestos miners, and pretty bad for installers. But it’s pretty much totally inert when installed - it doesn’t affect homeowners.
Re:Nvidia Security Team: “What if we just stopped using C?” by worthless-trash on Monday November 07, 2022 @06:39PM (#33514119)
> equating a programming language to a carcinogenic substance is inherently wrong,

I work with C and it kills me a little more each day, just like cigarettes. Its a pretty fair comparison.

Re:Nvidia Security Team: “What if we just stopped using C?” by docandrew on Monday November 07, 2022 @10:49AM (#33507346)
I don’t think the federal government should step in and regulate it, but why not some kind of professional or trade organization, like UL?

And really, I think your argument bolsters my case. Federal and state governments are freaking out about cybersecurity and protecting infrastructure and voting systems, so why shouldn’t they ban the use of software written in C in their acquisition process?

Re:Nvidia Security Team: “What if we just stopped using C?” by flohofwoe on Monday November 07, 2022 @10:56AM (#33507475)
Such regulations already exists, see for instance https://en.wikipedia.org/wiki/MISRA_C. Similar rules could be created for Rust (I would assume that this would have to be some sort of 'sane subset' of Rust, which for instance would forbid dynamic memory allocation alltogether).
Re:Nvidia Security Team: “What if we just stopped using C?” by topdancing on Monday November 07, 2022 @04:46PM (#33512992)
Or you could use https://en.m.wikipedia.org/wiki/SPARK_(programming_language) which is already a formal defined language and literally the thing discussed in the link right at the top.
Re:Nvidia Security Team: “What if we just stopped using C?” by mumblemumble on Monday November 07, 2022 @10:46AM (#33507311)
It's not an emotional component, it's just plain old network effects.

Unfortunately, a lot more switching cost is involved in getting embedded and systems programmers and platforms over to a new programming language, than is involved in getting construction contractors and industrial engineers to choose a different material.

Re:Nvidia Security Team: “What if we just stopped using C?” by mmis1000 on Monday November 07, 2022 @12:35PM (#33509122)
Lots of them just have their own toolchain and language subset. Make porting literally impossible. Because you don't know how the original one works.
Re:Nvidia Security Team: “What if we just stopped using C?” by bitL on Monday November 07, 2022 @10:51AM (#33507388)
I despise this security-first attitude. It just leads to so much mental fatigue everywhere and any step is a potential minefield. It's ruining programming.
Re:Nvidia Security Team: “What if we just stopped using C?” by ironmagma on Monday November 07, 2022 @10:54AM (#33507440)
> any step is a potential minefield

That's the exact problem with C. It's the tool, not the attitude, which is a problem.

Re:Nvidia Security Team: “What if we just stopped using C?” by flohofwoe on Monday November 07, 2022 @11:07AM (#33507647)
Securely containing untrusted user code so that it can't do any harm is ultimately the responsibility of the OS, or whatever sandbox the code is running in.

Language-level memory safety is useful for eliminating an important class of bugs, but if those bugs can be exploited to escape the sandbox, then that's the problem of the sandbox, not of the buggy program running in that sandbox. So please, by all means, write the sandbox itself in a memory safe language like Rust, but requiring the same for all code running inside the sandbox is nothing more than an admission of failure.

Re:Nvidia Security Team: “What if we just stopped using C?” by timbit42 on Monday November 07, 2022 @11:19AM (#33507831)
What if the sandbox, kernel, device drivers are written in C? Sounds like a good case against C for these uses.
Re:Nvidia Security Team: “What if we just stopped using C?” by flohofwoe on Monday November 07, 2022 @11:24AM (#33507916)
Yes, I fully agree! But such subtleties are usually overlooked by the 'C users are criminals' crowd ;)
Re:Nvidia Security Team: “What if we just stopped using C?” by ilyt on Monday November 07, 2022 @11:20AM (#33507846)
That's pretty limited way to look at it. You don't need to escape the sandbox to do harm.

You can have your app in perfect sandbox where nothing can escape then have a memory safety bug inside allowing user to get to the stuff of another user (because your sandboxed app talking with sandboxed database still have one set of credentials to do everything)

There is of course https://xkcd.com/1200/ for that.

And no "move that separation to DB" also isn't a solution.

Re:Nvidia Security Team: “What if we just stopped using C?” by flohofwoe on Monday November 07, 2022 @11:29AM (#33507991)
I agree, same with popular multiplayer games for instance which could be exploited by memory safety bugs in the network protocol implementation. But these are cases where just implementing a couple of critical modules either with a memory-safe language, or using code generation (or both) to reduce the amount of 'manual bugs' go a long way. AFAIK exploits almost always happen in places where data comes into the system, so those are the places to focus on.
Re:Nvidia Security Team: “What if we just stopped using C?” by Gigachad on Monday November 07, 2022 @06:54PM (#33514248)
Imagine any other engineering field complaining about safety being a mental drain.
Re:Nvidia Security Team: “What if we just stopped using C?” by lelanthran on Monday November 07, 2022 @10:52AM (#33507408)
> For whatever reason with C there’s this huge emotional component to it.

Frankly getting your knickers in a knot is emotional - the people using C are doing so for pragmatic reasons, not emotion.

I do see comments like yours a lot - there's an emotional attachment and/or ego attached to the comment, so the argument against is very vociferous and, honestly, ugly[1].

[1] C and asbestos have almost nothing in common in terms of negative impact on the world. Maybe people are still using C because hyperbole is simply not a persuasive argument.

Re:Nvidia Security Team: “What if we just stopped using C?” by zamalek on Monday November 07, 2022 @11:29AM (#33507998)
> I do see comments like yours a lot - there's an emotional attachment and/or ego attached to the comment

Could you explain how it's emotional? It comes across as a pretty logical analogy to me - the author isn't suggesting that they don't like C (which would be categorically emotional), they are comparing it to phasing out something unsafe in another industry.

Re:Nvidia Security Team: “What if we just stopped using C?” by ectospheno on Monday November 07, 2022 @11:36AM (#33508115)
A truth stated passionately doesn’t become false. A falsehood stated calmly doesn’t become true. This is at the heart of why emotion is always a logical fallacy.

Everyone would be better served by using and hearing it less. Focus on the actual argument.

Re:Nvidia Security Team: “What if we just stopped using C?” by zamalek on Monday November 07, 2022 @11:41AM (#33508221)
I am neurodivergent, so I may be missing something here. The argument seems pretty passionless. Excluding the assumption that C is unsafe, it contains purely facts.

Your reply doesn't point out the passionate component of it either, and doesn't answer my question.

Re:Nvidia Security Team: “What if we just stopped using C?” by ulfbert_inc on Monday November 07, 2022 @11:44AM (#33508262)
Analogy is not an argument.
Re:Nvidia Security Team: “What if we just stopped using C?” by nvrspyx on Monday November 07, 2022 @12:00PM (#33508556)
Sure it is, depending on the analogy and the purpose of the analogy. An analogy also isn't always fallacious. It needs to have a faulty extrapolated assumption from the comparison.

In this particular case, the argument is that C should be replaced with something safer for similar reasons that asbestos is replaced with something safer. However, one can certainly challenge the validity of this comparison and whether there's something faulty in it.

I don't feel one way or the other because I don't work with C or other low-level languages, but it's a bit absurd to say that an analogy isn't an argument. It absolutely can be if the argument within is clear, even if fallacious.

Re:Nvidia Security Team: “What if we just stopped using C?” by ulfbert_inc on Monday November 07, 2022 @12:12PM (#33508742)
Thanks for clarifying. I meant valid, non-fallacious argument.

More often than not I see analogies (ab)used as a tool to construct a straw man. This particular case demonstrates how analogy takes discussion away from merits and downsides of C to an emotionally charged subject of cancerogenic substances, as other commenters highlighted in this thread.

Re:Nvidia Security Team: “What if we just stopped using C?” by nvrspyx on Monday November 07, 2022 @12:45PM (#33509266)
Personally, I don't think it's the commenter's fault that some others have such strong emotions to the analogy that they're distracted from the point. There's no indication that the commenter was appealing to emotion and, as others have also pointed out, making a comparison to an "emotionally charged" subject does not nullify the validity of the comparison. In fact, it's fallacious to falsely invalidate the argument based on some cherry-picked, subjective, peripheral perspective like that. In my opinion, the appeal to emotion and the derailment of the discussion is from those doing so, not the original commenter.

It seemed like just a simple, general, easily-mappable analogy that most people would get, even non-programmer laymen, that emphasizes that unsafe should be replaced with safe. Any analogy of something unsafe can be seen as "emotionally charged" if someone was personally impacted by it.

Re:Nvidia Security Team: “What if we just stopped using C?” by zamalek on Monday November 07, 2022 @11:45AM (#33508280)
That still doesn't point out the emotion in the comment. Your reply here would work as a reply to the root comment, but doesn't address what I am asking at all. Where is the passion?
Re:Nvidia Security Team: “What if we just stopped using C?” by Jtsummers on Monday November 07, 2022 @11:48AM (#33508327)
Asbestos is an emotionally charged topic for many people, especially the many who have (primarily) older relatives who have died or are dying from cancers caused by it. The analogy is resting primarily on the appeal to that kind of emotion without actually establishing a strong logical similarity between C and asbestos.
Re:Nvidia Security Team: “What if we just stopped using C?” by macintux on Monday November 07, 2022 @11:58AM (#33508520)
> Asbestos is an emotionally charged topic for many people, especially the many who have (primarily) older relatives who have died or are dying from cancers caused by it.

I’ve not personally been impacted by this, but this seems reasonable.

> The analogy is resting primarily on the appeal to that kind of emotion

This seems like projection. It struck me as a perfectly legitimate analogy without any emotional correlation.

Re:Nvidia Security Team: “What if we just stopped using C?” by Jtsummers on Monday November 07, 2022 @12:04PM (#33508617)
I don't know, C isn't out there causing cancer and killing people left and right. It's hyperbolic to draw that comparison. Critical systems (especially post Therac-25) that are using C are already using a subset of C, static analysis tools, and comprehensive testing that raise the quality level of actual life-and-health-impacting C programs.

EDIT: Because someone will probably make a note of it: Therac-25 wasn't written in C, but the flaws in that system and others helped lead to a massive change in the way critical systems are developed and treated. I referenced it because it's one of the most notable failures in safety-critical software systems.

Re:Nvidia Security Team: “What if we just stopped using C?” by macintux on Monday November 07, 2022 @12:14PM (#33508773)
It’s fine to argue that the analogy is flawed (all of them are) or that it’s irrelevant, or simply wrong.

What this entire thread is about, however, is this highly charged response to what seemed like a straightforward analogy.

> Frankly getting your knickers in a knot is emotional - the people using C are doing so for pragmatic reasons, not emotion. > I do see comments like yours a lot - there's an emotional attachment and/or ego attached to the comment, so the argument against is very vociferous and, honestly, ugly[1].

Re:Nvidia Security Team: “What if we just stopped using C?” by zamalek on Monday November 07, 2022 @01:15PM (#33509735)
At the end of the day it seems as though an emotional argument occurred in the eye of the beholder. This only adds even more credibility to the root comment.

A failed experiment with the Socratic method on my part.

Re:Nvidia Security Team: “What if we just stopped using C?” by zamalek on Monday November 07, 2022 @11:52AM (#33508397)
That makes sense, thank you.
Re:Nvidia Security Team: “What if we just stopped using C?” by Gibbon1 on Monday November 07, 2022 @03:28PM (#33511926)
Also point out that there is nothing that can be done to fix asbestos. But C can be made safer. The three things that block that are

1 A culture that thinks API's need to always have a gotcha. See the inability to to field a safe string copy.

2 ISO commitee that thinks it's in charge of maintaining a historical artifact. Suggestions to change the language like Brights suggestions about passing arrays fail because the ISO committee thinks that's Heresy.

3 People that think C is hopeless. Usually these are people that had a bad time with it in school.

4 Idiots that think the only reason to use C is speed. Therefor any improved way of doing things that might be 10-20% slower than raw unsafe code is pointless.

Re:Nvidia Security Team: “What if we just stopped using C?” by rcarr on Monday November 07, 2022 @08:01PM (#33514728)
Where does this argument end? Are we banned from using analogies containing animals because someone out there has a relative who died from a bear/shark/bee sting? Are we banned from talking about cows in a debate with vegans because someone lost a loved one when they were out hiking and got caught up in a cattle stampede? Are we banned from mentioning cars because everyone knows someone who had a traumatic car injury? By this logic you either end up molly coddling the entire world into silence because everything is a possible traumatic trigger to somebody or you declare yourself the king of acceptable debate and only the topics you approve of are acceptable because you are the chosen one anointed by the heavens.
Re:Nvidia Security Team: “What if we just stopped using C?” by Jtsummers on Monday November 07, 2022 @10:32PM (#33515606)
What a bizarre comment.
Re:Nvidia Security Team: “What if we just stopped using C?” by rcarr on Tuesday November 08, 2022 @07:39AM (#33518398)
It’s a classic reductio ad absurdum which is bizarre by nature. It shows that silencing people for discussing things you personally find upsetting is a slippery slope that leads to absurd or undesirable endpoints.

https://en.m.wikipedia.org/wiki/Reductio_ad_absurdum

https://en.m.wikipedia.org/wiki/Slippery_slope

Re:Nvidia Security Team: “What if we just stopped using C?” by ulfbert_inc on Monday November 07, 2022 @11:49AM (#33508342)
Fine, but that leaves us with passionless non-argument. How is it helpful?
Re:Nvidia Security Team: “What if we just stopped using C?” by wiseowise on Monday November 07, 2022 @12:54PM (#33509422)
Unsafe C is a fact, there’s no need for an argument in their comment.
Re:Nvidia Security Team: “What if we just stopped using C?” by naasking on Monday November 07, 2022 @12:56PM (#33509433)
> Analogy is not an argument.

Just for sake of clarity, formal analogy is a valid, non-fallacious argument because it's based on parity of reasoning.

The original comment made a pretty good, arguably formal analogy between asbestos and C. The only way to dismiss the conclusion is if there were no alternative to asbestos, then you're kinda forced to use asbestos. This is the case for C in some contexts, like some microcontrollers that only come with C compilers. It's not generally true that we need C for much else though.

Re:Nvidia Security Team: “What if we just stopped using C?” by pjmlp on Tuesday November 08, 2022 @03:32AM (#33517128)
There is seldom a microcontroller that also doesn't have a Basic or Pascal compiler from https://www.mikroe.com, but naturally that is an additional cost that many would rather not care about.
Re:Nvidia Security Team: “What if we just stopped using C?” by IncRnd on Monday November 07, 2022 @01:16PM (#33509755)
> Analogy is not an argument.

"An analogical argument is an explicit representation of a form of analogical reasoning that cites accepted similarities between two systems to support the conclusion that some further similarity exists." [1]

[1] https://plato.stanford.edu/entries/reasoning-analogy/

Re:Nvidia Security Team: “What if we just stopped using C?” by lelanthran on Monday November 07, 2022 @02:03PM (#33510586)
> I am neurodivergent, so I may be missing something here.

Yes, you're missing the logic.

> Excluding the assumption that C is unsafe, it contains purely facts.

You think C is carcinogenic and mere exposure to it kills?

From a "purely facts" PoV, leaving all emotion aside, C runs, and has done so for a number of decades, life-critical systems, including munitions, weapons, life-support, industrial machinery and aviation.

It's only because you are married to your argument that you think comparing C to a fatal poison is "pure facts".

Re:Nvidia Security Team: “What if we just stopped using C?” by lukeck on Tuesday November 08, 2022 @03:51AM (#33517254)
I interpreted the original comment as saying that C is detrimental to the long term health of a piece of software in a similar way to how asbestos is detrimental to the long term health of humans.

I don’t think there was any suggestion made that C is detrimental to human health.

[dead]
Re:Nvidia Security Team: “What if we just stopped using C?” by zamalek on Monday November 07, 2022 @11:51AM (#33508376)
Sure, maybe the analogy isn't logical.

> It's also logical to kill young children with autism so they don't become a financial or emotional burden on their family or society as a whole. It turns out claiming something is logical isn't, itself, enough of a reason to do something and those doing so should endeavor to give more convincing arguments.

That's an analogy, and we are talking about a programming language - not humans.

Again, where is the passion in the original comment? I have asked for nothing more than that.

Re:Nvidia Security Team: “What if we just stopped using C?” by P5fRxh5kUvp2th on Monday November 07, 2022 @11:57AM (#33508476)
> That's an analogy, and we are talking about a programming language - not humans.

Is it your supposition that asbestos was banned for non-human reasons?

Or does this "logic" only work when convenient for your own defenses?

Re:Nvidia Security Team: “What if we just stopped using C?” by tryauuum on Monday November 07, 2022 @01:33PM (#33510051)
I hate all analogies with physical world, because the person tends to pick up the most emotional one. It's emotional because they picked the thing that makes my lungs bleed. C, with all its flaws, doesn't damage my physical health.

You call it a logical analogy, how an analogy can be logical?

EDIT: and I hate analogies because, since they suck, someone will try to come up with a better analogy. And now we have a thread where people compare C to asbestos, then they compare C to a fire in kitchen. Not a kind of thread I would like to be in.

Re:Nvidia Security Team: “What if we just stopped using C?” by rcarr on Monday November 07, 2022 @03:39PM (#33512076)
How can you hate all analogies with the physical would? How do you propose somebody learns something completely abstract without any physical counterpart whatsoever. How do intend to teach people something as simple as numbers without using your fingers or some other quantity of items in the world.

Vast quantities of language is built on analogy. Streaming, the internet, the World Wide Web, Starship. The word “cycle” comes from the Latin for “circle”. The list goes on.

I struggle to even comprehend how someone can hold this opinion. Have you ever tried instructing anyone in anything?

Re:Nvidia Security Team: “What if we just stopped using C?” by oska on Monday November 07, 2022 @06:19PM (#33513928)
> Vast quantities of language is built on analogy. Streaming, the internet, the World Wide Web, Starship.

These are metaphors, not analogies. [1]

The GP is cautioning against argument by analogy, not the use of metaphorical language. Problems and conceptual traps engendered by argument from analogy have been raised for thousands of years, indeed probably ever since formal discussion of language and reasoning have been recorded.

[1] https://prowritingaid.com/analogy-vs-metaphor

Re:Nvidia Security Team: “What if we just stopped using C?” by rcarr on Monday November 07, 2022 @07:38PM (#33514583)
Yes but the metaphorical name has obviously come about through a simile or analogy. Like a ship but in space going to stars. We can understand a cycle through looking at how we draw a circle etc. The words themselves are metaphors but when you explain them to a child for the first time you do it through similies and analogies. They’re intrinsically linked.

And I’m firmly in the camp that it is fine to use analogy in debate. Rarely do people claim when they make a comparison that it is a one to one mapping. Just that there are possible insights to be gleaned from the comparison which could potentially mean that we may be able to solve problems in one domain using similar solutions to the existing domain.

Take this quote for example:

> I hate all analogies with physical world, because the person tends to pick up the most emotional one. It's emotional because they picked the thing that makes my lungs bleed. C, with all its flaws, doesn't damage my physical health.

Obviously interpretation is subjective but this seems a huge misinterpretation of what OP was saying. To me, OP is clearly arguing that C code is damaging to the long term health of computer programs the same way asbestos exposure is damaging to long term human health and that we should consider replacing or retiring C code with modern alternatives like Rust the same way asbestos has been replaced with modern building materials. Saying that you don’t like the argument because bad C programs are nowhere near as damaging to physical health as asbestos seems like a bad faith interpretation of what OP was trying to say. I also think the criticiser may feel differently if he was hooked up to a life support machine that was known to have buggy c code but that’s by the by.

Hacker News seems to have gone really hellbent on this pedantic ‘this is fallacy x’, this is fallacy y’ stuff recently as if every comment is some kind of formal scientific paper. It’s really weird and I’m sure it never used to be like this. It’s sucks the joy and fun out of everything, I don’t know why people can’t just express interesting viewpoints here anymore like a normal conversation without the fallacy police showing up,

Re:Nvidia Security Team: “What if we just stopped using C?” by tryauuum on Tuesday November 08, 2022 @02:47AM (#33516876)
I'd rather prefer people saying "C has a long history of damaging security" and that's it, no asbestos here. Is a personal preference of mine. Less chances to misinterpret something.

At least it's not a "comparing Linux kernel to a car" situation I've also seen.

Re:Nvidia Security Team: “What if we just stopped using C?” by rcarr on Tuesday November 08, 2022 @07:24AM (#33518313)
I’ve never compared the Linux kernel to a car but I wouldn’t necessarily throw it out as a useful analogy for two reasons:

- 1: sometimes we have to learn simplified but faulty models in order to understand the more complex and more accurate models

- 2: Everyone sees the world in different ways. It is often through combining these different viewpoints (or analogies) that we arrive at something closer to the objective truth. This is eloquently illustrated in the [Blind men and an elephant parable](https://en.m.wikipedia.org/wiki/Blind_men_and_an_elephant). The moral of the parable isn’t that we should throw away all analogy because it can be misinterpreted. The moral is, as Wikipedia puts it:

> The parable has been used to illustrate a range of truths and fallacies; broadly, the parable implies that one's subjective experience can be true, but that such experience is inherently limited by its failure to account for other truths or a totality of truth. At various times the parable has provided insight into the relativism, opaqueness or inexpressible nature of truth, the behaviour of experts in fields of contradicting theories, the need for deeper understanding, and respect for different perspectives on the same object of observation.

Re:Nvidia Security Team: “What if we just stopped using C?” by lukeck on Tuesday November 08, 2022 @03:43AM (#33517202)
Analogies might not help you understand a perspective on a topic but they do help many, many people.
Re:Nvidia Security Team: “What if we just stopped using C?” by meltyness on Monday November 07, 2022 @11:24AM (#33507908)
You don't seem to address the "pragmatic reasons" expressly, so I'll go ahead and do it:

1. "Don't rewrite code" a fundamental precept of software that has been "engineered"

    - This is more about development lifecycles than something that contributes usefully to software quality in the long term. Corporations, and people haven't been treating these things like bridges or overpasses
2. Outsourcing is believed cheaper than the solution.

    - Again, paying low-wage junior SEs to patch uncovered bugs is obviously cheaper than proactively finding them all.
3. You can sell the New Coke too!

    - If you have a good rewrite, sell it at a fat markup, and keep selling the old crap too, it's not your risk.

    - Obviously don't rewrite unless your horrid monolithic source leaks, and you're certain that it's a problem, those disgruntled workers you wrongfully laid off know too much.
4. If your tech references are a security risk, sell those too!

    - Don't include pesky manuals where people can uncover issues with your development processes, outsource a minimum blackbox of guess work to Singapore and let that double as QA.

    - It's not a manual, it's 'training' -- supporting education of hopeful workers! Wow!
I won't name any names.
Re:Nvidia Security Team: “What if we just stopped using C?” by bpye on Monday November 07, 2022 @12:52PM (#33509381)
> Frankly getting your knickers in a knot is emotional - the people using C are doing so for pragmatic reasons, not emotion.

I think a lot of us using C would like to move away, but for whatever reason can’t. One example is that we hotpatch our binaries, but that sort of infrastructure doesn’t exist for Rust.

Beyond tooling issues, that certainly can be fixed, it’s also non trivial to move a large codebase to a safer language. Maybe incremental use of languages like Rust is still better?

Re:Nvidia Security Team: “What if we just stopped using C?” by delusional on Monday November 07, 2022 @11:02AM (#33507582)
Believing that all software security problems would be solved if we got rid of C is a bigger disease than C itself. I work in a fairly large (for my country) financial institution and the problems we deal with on a day to day basis are so far removed from buffer overflows that it's not even funny.

We still have software running in excel macros that control web browsers via COM. C is nothing compared to the attack surface of that.

Re:Nvidia Security Team: “What if we just stopped using C?” by mejutoco on Monday November 07, 2022 @11:22AM (#33507873)
OP is not claiming that it would reduce _all_ software security problems though, so this is a straw man (intentional or not).

Even the analogy holds up in this regard: using other materials instead of asbestos does not remove all the construction problems.

I think C has other things going for it (simplicity of the compiler), just wanted to point that out.

Re:Nvidia Security Team: “What if we just stopped using C?” by zamalek on Monday November 07, 2022 @11:35AM (#33508098)
> Believing that all software security problems would be solved if we got rid of C is a bigger disease than C itself.

Getting rid of a class of errors (correctness) allows you to focus more on other errors (logical). It could be argued that it could slightly reduce the likelihood of the latter.

Re:Nvidia Security Team: “What if we just stopped using C?” by P5fRxh5kUvp2th on Monday November 07, 2022 @11:49AM (#33508353)
Our industry went through this with the move to Java (and later .Net).

"It will solve memory leaks!"

...

"whoops, you can still leak memory in garbage collected languages, my bad everyone!".

Re:Nvidia Security Team: “What if we just stopped using C?” by adgjlsfhk1 on Monday November 07, 2022 @12:40PM (#33509192)
ditching C doesn't solve memory leaks but it does solve use after free. A memory leak is a performance problem that isn't generally exploitable. A use after free is almost always a security vulnerability.
Re:Nvidia Security Team: “What if we just stopped using C?” by P5fRxh5kUvp2th on Monday November 07, 2022 @02:55PM (#33511439)
quick, someone tell everyone locking up resources without releasing them isn't exploitable for bad actors.
Re:Nvidia Security Team: “What if we just stopped using C?” by worthless-trash on Monday November 07, 2022 @06:37PM (#33514098)
Memory leak is better than privesc in most cases of active exploitation.
Re:Nvidia Security Team: “What if we just stopped using C?” by ndriscoll on Monday November 07, 2022 @10:14PM (#33515518)
You can use resources after releasing them in pretty much any language. That's maybe not as dangerous as reinterpreting arbitrary memory, but then you can also use object pools for everything in C, which is what some very high performance code I used to work on did.
Re:Nvidia Security Team: “What if we just stopped using C?” by bcrosby95 on Monday November 07, 2022 @12:01PM (#33508571)
Both a paper cut and a gunshot wound bleed. It doesn't make them equal.
Re:Nvidia Security Team: “What if we just stopped using C?” by wiseowise on Monday November 07, 2022 @12:58PM (#33509480)
In C you leak memory because of all the land mines in the language. In Java/.Net you leak memory because you have flaw in your logic.
Re:Nvidia Security Team: “What if we just stopped using C?” by paulmd on Monday November 07, 2022 @02:38PM (#33511179)
Circular references and other things that tend to leak memory on GC languages aren't a logic flaw in the sense of your business logic being wrong, though.
Re:Nvidia Security Team: “What if we just stopped using C?” by scawf on Monday November 07, 2022 @03:52PM (#33512264)
Circular reference does not leak memory if your using a proper GC
Re:Nvidia Security Team: “What if we just stopped using C?” by donkeybeer on Monday November 07, 2022 @03:11PM (#33511691)
Memory errors are always logic errors in C. Freeing something that was already freed or accessing a buffer out of bounds and so on are pure logic errors.
Re:Nvidia Security Team: “What if we just stopped using C?” by pjmlp on Tuesday November 08, 2022 @03:34AM (#33517137)
Plenty of logic errors in the last 50 years, CVE appeciates it.
Re:Nvidia Security Team: “What if we just stopped using C?” by donkeybeer on Tuesday November 08, 2022 @04:54AM (#33517598)
But that person was trying to say memory errors are some kind of special "magical" error, which is simply wrong. Memory errors are merely logical errors. There is nothing "special" or "mysterious" about them.
Re:Nvidia Security Team: “What if we just stopped using C?” by pjmlp on Tuesday November 08, 2022 @05:57AM (#33517924)
Given the common meme as nasal dragons for UB, there is certainly some magic creatures associated with them.
Re:Nvidia Security Team: “What if we just stopped using C?” by hardware2win on Monday November 07, 2022 @01:11PM (#33509681)
I dont remember single mem leak in my half decade .net career

which speaks how rare they are

Re:Nvidia Security Team: “What if we just stopped using C?” by P5fRxh5kUvp2th on Monday November 07, 2022 @02:58PM (#33511490)
.net 1.0 was 20 years ago, you've been working in it for 5 years, roughly 25% of its lifetime.
Re:Nvidia Security Team: “What if we just stopped using C?” by hardware2win on Monday November 07, 2022 @03:39PM (#33512073)
We're evaluating techs by their state decade(s) ago here or what?
Re:Nvidia Security Team: “What if we just stopped using C?” by P5fRxh5kUvp2th on Monday November 07, 2022 @03:44PM (#33512149)
judgment is not the only reason for conversation, I strongly suggest you read back over the conversation from the beginning and endeavor to understand the context with which responses are made.

I also suggest you say 5 years instead of "half-a-decade", most of us see through that and it's off-putting.

Re:Nvidia Security Team: “What if we just stopped using C?” by zamalek on Monday November 07, 2022 @04:26PM (#33512738)
I have worked with .Net, in a hobby capacity, since beta. I have worked with it professionally since 2007.

I have seen two instances of rooted memory:

- WPF. The implicit GC root path introduced by events. We were easily able to track this down due to the information that the GC holds in memory[1] (fixing it was not so easy).

- A leak in managed C++ (non-pure, i.e. native code). We had to use the normal tools to track this down, not a 5 minute diagnosis.

At the end of the day GC'd languages can have (and usually do) richer tooling surrounding memory usage. They are better in this regard even during a failure state.

[1]: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/so...

Re:Nvidia Security Team: “What if we just stopped using C?” by P5fRxh5kUvp2th on Monday November 07, 2022 @07:19PM (#33514451)
Lets loop back to the original point.

Getting rid of C won't get rid of security problems anymore than moving to java and .net got rid of needing to think about memory leaks.

Those that think otherwise are ignorant of history, or choosing to ignore it.

And it gets worse when you consider resource exhaustion, not just memory. There are entire mechanisms in .net and java whose sole purpose in life is to try and deal with resource exhaustion because the GC only deals with 1 aspect of that resource exhaustion (memory leaks).

---

For those of us who watched that transition, it's obvious it won't work out the way people are claiming.

Re:Nvidia Security Team: “What if we just stopped using C?” by zamalek on Monday November 07, 2022 @02:02PM (#33510576)
From my comment, emphasis added:

> it could slightly reduce

Re:Nvidia Security Team: “What if we just stopped using C?” by raxxorraxor on Tuesday November 08, 2022 @03:10AM (#33516988)
I had to move part of the Code to C for different reason (imaging device) and used that code in a .net application. But allocating unmanaged memory on .nets heap led to memory fragmentation and while overall there was enough memory available, you ran into allocation errors since unmanaged memory needed to be allocated in one successive block. Usually doesn't happen, but if you have large objects like high resolution images in memory, you can quickly run into problems. And to my knowledge there was no way to check if there was enough successive memory available.

Had to wait on a patch for .net... not a problem anymore today, although I don't know the details how they solved the problem.

Re:Nvidia Security Team: “What if we just stopped using C?” by lelanthran on Tuesday November 08, 2022 @03:47AM (#33517234)
> Getting rid of a class of errors (correctness) allows you to focus more on other errors (logical).

I think you mean "memory safety", not "correctness".

Correctness is a much harder target to hit and requires a good deal of time.

Re:Nvidia Security Team: “What if we just stopped using C?” by docandrew on Monday November 07, 2022 @11:09AM (#33507677)
Ok, but why are the Excel macros so risky? It’s often because the underlying software or OS was written in C/C++.
Re:Nvidia Security Team: “What if we just stopped using C?” by delusional on Monday November 07, 2022 @11:17AM (#33507803)
What? No it isn't. It's because the users think they're opening a document to look at some data and suddenly it's an executable transferring money via their bank account.

And that's all working as designed. Someone built it like that. There's no bug anywhere in that chain, just as extremely rickety system with no affordances for human intervention. No separation of what is trusted and what is not.

Re:Nvidia Security Team: “What if we just stopped using C?” by Jtsummers on Monday November 07, 2022 @11:30AM (#33508010)
Excel macros are risky because they offer a kind of privilege escalation. Most Excel built-in functions (that is, what you write into the cells) have limited reach. They impact that cell and (by reference) other cells, but not the underlying filesystem and other things. Even looking at the database ones, I'm not seeing a single function that writes to the DB but plenty that read from it, that's "safe" in that it would be very hard to abuse these kinds of things to screw with other systems or the host system. But macros can run arbitrary code and access whatever the user can access in a way most Excel functions cannot and can trigger arbitrary effects. The equivalent of `rm -r ~/` is not possible in straight Excel, but is feasible with a macro. C and C++ have nothing to do with that, it's the underlying privilege model that permits it.

There's a good case to be made for using better languages than C and C++ for large classes of software. Don't weaken it by making absurd claims.

Re:Nvidia Security Team: “What if we just stopped using C?” by docandrew on Monday November 07, 2022 @11:38AM (#33508149)
Broken security model/sandboxing aside (which is inexcusable), the use of C/C++ expands the attack surface - there are some excel exploits though that take advantage of C vulns like buffer overflows: https://www.exploit-db.com/exploits/18087
Re:Nvidia Security Team: “What if we just stopped using C?” by P5fRxh5kUvp2th on Monday November 07, 2022 @11:51AM (#33508391)
> There's a good case to be made for using better languages than C and C++ for large classes of software. Don't weaken it by making absurd claims.

And this idea can be applied to so many things.

Seriously, very often things have enough downsides that you don't need to exaggerate things that are not downsides. You're actually weakening your side by doing so because if people cannot trust even that bit of honesty, why would they trust anything you say?

be trustworthy is the first rule in convincing others.

Re:Nvidia Security Team: “What if we just stopped using C?” by snicker7 on Monday November 07, 2022 @11:17AM (#33507786)
You can be socially engineered to open a mallacious excel.
Re:Nvidia Security Team: “What if we just stopped using C?” by wizofaus on Monday November 07, 2022 @01:46PM (#33510268)
Did you see the claim "70% of all security bugs are related to memory safety"? Which isn't to say 70% of successful exploitation of said bugs resulted in genuine harm, but low-level vulnerabilities in widely used system-level software (network stacks etc.) can potentially have devastating effects in the way an excel macro is unlikely to.
Re:Nvidia Security Team: “What if we just stopped using C?” by delusional on Monday November 07, 2022 @04:56PM (#33513116)
What I'm trying to get at here is that security is not just "bugs". Nowhere in the excel macro hell that is my job are there any bugs. Using a macro to transfer money in and out of peoples accounts in bulk is bad design, It's insecure, and i have at times argued that it's unethical, but it is also not a bug, It's exactly how the system was designed to work. Edge was designed to embed an Internet Explorer OLE frame, and that frame was designed to have an IE7 compatibility mode. No part of that would count in the "70% of bugs" list.

Moreover, almost no bugs are discovered in the actual reasonable software we have. That's not because we are the best engineers, or because we write it with the utmost care and attention to detail. It's because we're a total of 5 people (mostly a couple of years out of uni) looking at it. C, and other systems programming languages are greatly overrepresented in the corpus of software that is actually being combed through for bugs. Java and Cobol are heavily underrepresented.

I want to make this clear again. I work in banking. If 2008 showed us anything it's that banking underpins most of our modern society so these quality issues are not unimportant, they can be devastating.

Re:Nvidia Security Team: “What if we just stopped using C?” by GeekyBear on Monday November 07, 2022 @02:59PM (#33511500)
> Believing that all software security problems would be solved if we got rid of C is a bigger disease than C itself.

According to studies done at Google and Microsoft, about 70% of their serious security issues are a result of memory safety errors.

>Around 70 percent of all the vulnerabilities in Microsoft products addressed through a security update each year are memory safety issues; a Microsoft engineer revealed last week at a security conference.

https://www.zdnet.com/article/microsoft-70-percent-of-all-se...

and

>Nearly 70% of the high severity security bugs in Chrome's code are memory unsafety problems, Google's engineers have revealed.

https://tech.hindustantimes.com/tech/news/70-of-security-bug...

Re:Nvidia Security Team: “What if we just stopped using C?” by lelanthran on Tuesday November 08, 2022 @03:15AM (#33517022)
As has been pointed out repeatedly whenever this statistic is brought up in discussion, that figure is not indicative of much.

And in discussions like this, it's verging on the dishonest - leading with a large number makes readers think that a large difference to bug count will result.

> Around 70 percent of all the vulnerabilities in Microsoft products addressed through a security update each year are memory safety issues; a Microsoft engineer revealed last week at a security conference.

What's the total bug count?

A codebase with 10000 bugs logged against it might have maybe 10[1] that are CVEs, of which, according to that statistic, only 7 would be fixed by moving to a safer language (either GC or Rust or similar).

That's just not enough motivation for switching when the payoff for preventing "70% of CVEs" is so small it may never even happen.

[1] I've worked on C codebases that were developed over a decade, and 1000:1 of all-bugs:memory-safety-bugs is a very conservative ratio. IME, it's been closer to 10000:1.

Re:Nvidia Security Team: “What if we just stopped using C?” by GeekyBear on Tuesday November 08, 2022 @04:28AM (#33517457)
> that figure is not indicative of much

Microsoft does not appear to agree.

>Mark Russinovich, the chief technology officer of Microsoft Azure, says developers should avoid using C or C++ programming languages in new projects and instead use Rust because of security and reliability concerns.

https://www.zdnet.com/article/programming-languages-its-time...

Re:Nvidia Security Team: “What if we just stopped using C?” by stubish on Monday November 07, 2022 @09:27PM (#33515256)
Nobody believes that all software security problems will be solved if we get rid of C. Nobody. Absolutely nobody. Really.

What people do believe is it would remove whole classes of security problems that affect everybody. Even if you have software running in excel macros. Maybe in your environment that is a minority of your problems. That is probably not a good thing, and we feel for you, and respect preferring to tackle that problem first. But it would be a good idea to not entrench C further while you are doing that. Once you shrink your attack surface, it would be great if the code being invoked doesn't have exploitable memory overflows to make all your hard work pointless.

Re:Nvidia Security Team: “What if we just stopped using C?” by encryptluks2 on Monday November 07, 2022 @11:16AM (#33507781)
Rust is like Scientology. At one point it was considered scientific. Then at some point it was no longer accepted because it became a cult.
Re:Nvidia Security Team: “What if we just stopped using C?” by potta_coffee on Monday November 07, 2022 @01:24PM (#33509887)
I've never given Rust a chance because I'm utterly repulsed by the community.
Re:Nvidia Security Team: “What if we just stopped using C?” by encryptluks2 on Monday November 07, 2022 @08:24PM (#33514900)
I actually am quite please with it, or at least the programs I've used written in Rust... but the community has been pretty toxic and it hasn't been without its share of security vulnerabilities.
Re:Nvidia Security Team: “What if we just stopped using C?” by epistasis on Monday November 07, 2022 @11:21AM (#33507860)
I think a better analogy may be nuclear power, than asbestos, because of the labor side of the tech.

Using nuclear power correctly takes a ton of engineering prowess, lots of additional construction. If done well, it works great. When it goes bad, it goes really bad.

So if it's 1982, maybe nuclear power or C is a good option. If it's 2022, new technology may provide a cheaper way of getting to the same end point, with less engineering and construction, and probably even less cost.

Re:Nvidia Security Team: “What if we just stopped using C?” by adgjlsfhk1 on Monday November 07, 2022 @12:45PM (#33509271)
This is a worse analogy because good nuclear plants exist. With C, I've yet to see a widely used library written by multiple humans in C that doesn't have critical memory bugs.
Re:Nvidia Security Team: “What if we just stopped using C?” by fxtentacle on Monday November 07, 2022 @03:31PM (#33511971)
Linux comes pretty close for practical usage. Or sqlite.
Re:Nvidia Security Team: “What if we just stopped using C?” by adgjlsfhk1 on Monday November 07, 2022 @03:59PM (#33512356)
https://www.cvedetails.com/product/47/Linux-Linux-Kernel.htm... and https://www.cvedetails.com/vulnerability-list.php?vendor_id=.... Linux has new security vulnerabilities found every year due to memory issues caused by C.
Re:Nvidia Security Team: “What if we just stopped using C?” by Schroedingersat on Monday November 07, 2022 @09:12PM (#33515174)
Those C code bases all get used and many have lives depending on them. Generally the really bad disasters are almost always narrowly avoided before they come to public attention.

Why would your experience there make you think the good nuclear plants are any different?

Re:Nvidia Security Team: “What if we just stopped using C?” by wiseowise on Monday November 07, 2022 @01:03PM (#33509548)
Nuclear power yields amazing results compared to alternatives, this isn’t the case with C.
Re:Nvidia Security Team: “What if we just stopped using C?” by tomp on Monday November 07, 2022 @11:25AM (#33507922)
> Safer alternatives exist.

Do they? The only “safe” comparable alternative is unsafe Rust which as the name suggests isn’t actually safe.

Re:Nvidia Security Team: “What if we just stopped using C?” by jesse__ on Monday November 07, 2022 @11:38AM (#33508157)
You're right. Alternatives that tick all the boxes that C does, and are also safer, do not exist.

This guy is just doing the typical religious yelling about people doing their jobs (writing kernels, drivers, browsers, games, etc) with the most flexible tool for programming we've developed to date.

Maybe one day Rust will become dominant. Maybe someone will overhaul the aliasing rules of C, write some similar lifetime tracking tooling, and it will live on for another 50 years. Who knows. The reason people still use C and C++ isn't because they're good languages (or even that people like them, as the comment states), it's that until recently there have been very few viable alternatives, and for some domains literally none at all. They've largely been the only option for a long time.

Re:Nvidia Security Team: “What if we just stopped using C?” by notriddle on Monday November 07, 2022 @11:57AM (#33508483)
The article is about Ada SPARK, and nVidia using it to develop their firmware today.
Re:Nvidia Security Team: “What if we just stopped using C?” by jesse__ on Monday November 07, 2022 @12:01PM (#33508578)
Yes, I wasn't referring to the article, I was referring to the person comparing C to asbestos.

It makes sense for nVidia to trade development time and prefer a language with formal verification for their firmware.

Re:Nvidia Security Team: “What if we just stopped using C?” by nordsieck on Monday November 07, 2022 @11:54AM (#33508438)
> The only “safe” comparable alternative is unsafe Rust which as the name suggests isn’t actually safe.

And for some applications, Rust isn't even an alternative. Not every chip is supported by LLVM.

Re:Nvidia Security Team: “What if we just stopped using C?” by Gigachad on Monday November 07, 2022 @06:57PM (#33514279)
You typically don't have to write any unsafe Rust as an end user. The unsafe stuff is contained in very small and very rigorously analyzed standard library types. Which then provides you a safe interface to do all the stuff you normally do.
Re:Nvidia Security Team: “What if we just stopped using C?” by nyanpasu64 on Monday November 07, 2022 @08:47PM (#33515030)
In practice unsafe Rust is necessary to write many classes of nontrivial code, and is harder to get right in many ways than C++ (possibly C) and I think Zig.
Re:Nvidia Security Team: “What if we just stopped using C?” by Gigachad on Tuesday November 08, 2022 @01:02AM (#33516331)
Examples? I have been writing production rust for about 6 months now and haven’t had to use unsafe yet. Looking at the standard library internals I see it a lot but everything I have had to do works in safe.
Re:Nvidia Security Team: “What if we just stopped using C?” by nordsieck on Monday November 07, 2022 @11:33AM (#33508062)
> For whatever reason with C there’s this huge emotional component to it. Safer alternatives exist.

For a lot of things, I just don't think this is true.

For example, here is sqlite's reasoning for choosing C: https://www.sqlite.org/whyc.html

I can't say I can really disagree with it.

Re:Nvidia Security Team: “What if we just stopped using C?” by wizofaus on Monday November 07, 2022 @01:36PM (#33510095)
That article wins the argument for me, and I'm not a fan of C particularly. Admittedly it doesn't address security concerns, but the fact they're able to achieve 100% machine code level branch coverage (I wonder if that includes the possibility of executing injected code...) should go a long way towards generating confidence that there are no readily exploitable vulnerabilities.
Re:Nvidia Security Team: “What if we just stopped using C?” by spamizbad on Monday November 07, 2022 @11:33AM (#33508073)
There are many C developers out there who will insist they have gained enough experience to never write code vulnerable to various memory safety exploits. Real "I actually drive safer slightly buzzed" vibes.
Re:Nvidia Security Team: “What if we just stopped using C?” by wiseowise on Monday November 07, 2022 @01:01PM (#33509514)
> Real "I actually drive safer slightly buzzed" vibes.

“I don’t need seatbelts, I actually know how to drive unlike others”

Re:Nvidia Security Team: “What if we just stopped using C?” by abudabi123 on Monday November 07, 2022 @06:45PM (#33514169)
phase out C on the schedule the internal combustion engine is going out of circulation as is being required
Re:Nvidia Security Team: “What if we just stopped using C?” by marcosdumay on Monday November 07, 2022 @11:34AM (#33508090)
People also had a large and unexplainable emotional attachment to asbestos.
Re:Nvidia Security Team: “What if we just stopped using C?” by noobermin on Monday November 07, 2022 @11:51AM (#33508388)
So it's not everything but as long as operating systems are written in C, it will be the language of choice for many projects.
Re:Nvidia Security Team: “What if we just stopped using C?” by jimlongton on Monday November 07, 2022 @12:00PM (#33508554)
> Safer alternatives exist.

Sure, but do they have certified compilers for Functional Safety (ISO26262) development for Automotive or Medical applications? Rust does not, although there's a company working on it.

Re:Nvidia Security Team: “What if we just stopped using C?” by docandrew on Monday November 07, 2022 @12:04PM (#33508612)
Yes, the compiler used for the work described in the post: https://www.adacore.com/industries/automotive/iso26262
Re:Nvidia Security Team: “What if we just stopped using C?” by kazinator on Monday November 07, 2022 @12:07PM (#33508656)
We use all sorts of hazardous materials, which are safe if properly used, transported and stored.

C is not "unsafe" in the sense that little bits of it break off in installations and make people sick, but in the sense that the assurance of safety almost all rests on the programmer.

If code is safe, and not changed, it stays that way.

Re:Nvidia Security Team: “What if we just stopped using C?” by optymizer on Monday November 07, 2022 @12:08PM (#33508682)
> It was fine at what it did

No need to talk in past tense. C is still the best language at what it is meant for: writing fast software. Not safe software, _fast and portable_ software.

> but the safety problems outweigh them

Safety is to speed what security is to convenience. Frankly, most of the arguments I see today are just fear mongering. In my experience, there is no protecting users from developer mistakes that lead to software exploitation and 'unsafety', independent of the language being used. Memory issues are a common avenue, but if you take it away, the next issue will become the main avenue for exploitation, and you'll be back in the same spot, with the next generation of developers fearing that the new software safety level is insufficient to reach some ideal safety level, all while having traded off real world speed across the board to reach that point.

> no new installations use it

I'm writing a tool in C. It doesn't need to be perfectly secure. It does need to be fast.

By using C we acknowledge that users want speed, more than they want safety, and that's our developer reality. That doesn't mean users don't want safety, it just means that outside of specialized domains, on average speed takes priority - people have been voting for decades that they want speed more than safety, and the process of deciding the priority is as you'd expect: users use money to buy a faster product and companies selling software invest in making their software fast first.

The security argument is also weak. The whole point of cracking software is to find flaws in existing systems, regardless of the language they were coded in. One thing will always be true: anything that sends data can be cracked. You can only make the entry bar harder, but you will not create a language that is significantly safer and as fast as C because the optimizations that make software fast (like not checking array lengths, not checking for overflow, etc) are also the ones making it less secure.

One can create a language that's safer than C and fast (in specific situations), but there will always be people cracking the core of whatever the 'safe' language du jour is, so you will have decreased security incidents on average, but have not eliminated them, while leaving room for a competitor to swoop in with a faster product that's safe enough, and it's your users who will decide who wins, not you.

Just to emphasize this, so far, I have not seen any indication that the general population will shift to picking safety over speed, so you'd be betting against your users.

Re:Nvidia Security Team: “What if we just stopped using C?” by c-cube on Monday November 07, 2022 @06:32PM (#33514058)
At this point there isn't strong evidence that C is going to deliver better performance than C++ or Rust, especially for a given amount of work. One could argue that better code reuse (templates, generics, crates, etc.) allow programmers to write faster code in C++ or rust. For example you need barely any work to use a really good hash table in rust, one that's really tricky to rewrite by hand because it involves simd and whatnot.
Re:Nvidia Security Team: “What if we just stopped using C?” by optymizer on Wednesday November 09, 2022 @09:21AM (#33531943)
The language that for the past 50 years has:

1. consistently had much faster compilation times than C++ or Rust

2. consistently generated some the smallest binaries

3. consistently ended up in #1 on programming language benchmarks

4. consistently been used to write the worlds OS kernels, where speed is critical

does not have _strong evidence_ that is going to continue to deliver better performance than C++ or Rust?

On the contrary, there is no evidence that Rust will ever be as fast as C. The burden on proof is on you and Rust to support your bold claims. C++ is in a different boat - it already tried to displace C in the 90s and it has been successful only in the environments where its other properties are a much more needed advantage, not for being faster than C. That's where Rust will end up - in between Java and C++. It will never displace C, because you pay for runtime safety with CPU cycles. Static analysis can only get you so far.

Even Java's JIT, which got everyone excited about beating C in the early 2000s, failed miraculously at being faster than C, even if it could generate better assembly code at runtime, precisely because extra features cost cycles which necessarily slow down execution speed, so you're not the first group of people with starry eyes and bold claims about performance and C.

As far as the generic simd hashmap goes, it will always be slower than a specialized custom built hashmap in C, even if it takes longer to code it and has more bugs.

Re:Nvidia Security Team: “What if we just stopped using C?” by c-cube on Wednesday November 16, 2022 @10:59AM (#33625287)
C has existed for a longer time, and for historical reasons it's used for some of the biggest and most popular kernels. That makes sense. However, newer kernels don't necessarily stick to C (e.g. Fuschia's kernel is in C++); there is also no evidence that kernels in C++ would be slower than the C equivalent. Regarding your other points:

1. compilation time is not related to runtime performance.

2. smaller binaries can mean better perf sometimes, but it's not always a win. It's a deep tradeoff between inlining/specialization/code size.

3. benchmarks are fun, but I think it's misleading to claim they're absolute truth. In particular, a popular benchmark will be tuned endlessly till it yields what you want. For real code you get a tradeoff between the effort put in optimization, and the total time to deliver features. I think this is where C++ (and rust) shine over C.

4. see above

For the rest: "continue to deliver better performance than C++ or Rust" that makes no sense since C++ and rust are more recent. And C++ can be just as performant as C already, or better (for a given amount of programmer effort). Code reuse is a big deal.

The runtime impact of safety features is real, but (for non-elided bound checking) it's pretty low. Rust is also known for compile-time safety features which can help writing better code because you need to spend less time on debugging; the classic examples are string handling (keeping slices of the input is easier to do safely in Rust) and threading. Some features of C++ and Rust are also better optimizable than the equivalent C idiom (e.g. to represent objects/dynamic dispatch).

Comparing C++ and Rust with java is a red herring. Java is JIT compiled and garbage collected, with little control over memory layout. People might have overhyped it in the 1990s and 2000s, sure. Rust and C++ give you as much control as C if you need it, and they go throught the same static code generator (LLVM) than one of the leading C compilers. Rust also will optimize the memory layout of structs for you by rearranging fields unless you explicitly use `#[repr(C)]`, which means that it'll be smaller than C's equivalent on average.

> As far as the generic simd hashmap goes, it will always be slower than a specialized custom built hashmap in C, even if it takes longer to code it and has more bugs.

Maybe if you spend as much time to write your C hashmap as was spent on the generic Rust hashmap. That's really a long time. If you just need a hashmap somewhere, pulling the standard Rust hashmap (or, in C++, abseil, from which the Rust version took inspiration) will deliver great performance for little effort, so you can move on with your life and spend more time on the profiling phase. I think we talk too often about "absolute" performance without accounting for the total time it takes to achieve it, including debugging, profiling, etc.

Re:Nvidia Security Team: “What if we just stopped using C?” by googlryas on Monday November 07, 2022 @12:16PM (#33508825)
To adjust your analogy a little, we actually still use asbestos, but it just isn't used for the general public. It still has unique properties that are industrially or commercially useful, such as certain asphaltic roofing compounds and friction products like brake pads.

But, it isn't used in products designed for the general public where strict oversight can't generally be provided.

Re:Nvidia Security Team: “What if we just stopped using C?” by ethbr0 on Monday November 07, 2022 @12:32PM (#33509057)
This is the key point that's often missed: asbestos isn't used anymoee in applications where the risks outweigh the benefits.

We use incredibly dangerous materials in photolithography, nuclear weapons production, armor piercing projectiles, and aerospace... because there are no alternatives and/or the benefits outweigh the risks.

What changed is that we learned more about asbestos (it causes cancer) and phased it out of applications where alternatives existed, even more expensive ones.

In the C analogy, there may be places C continues to make sense... but it shouldn't be used anymore out of default, because it's the way things have always been done, or any other reason that doesn't end with "... and that's more important than an increased risk of security vulnerabilities."

Re:Nvidia Security Team: “What if we just stopped using C?” by hackerbrother on Monday November 07, 2022 @12:32PM (#33509071)
More asbestos! More asbestos!
Re:Nvidia Security Team: “What if we just stopped using C?” by paulmd on Monday November 07, 2022 @03:04PM (#33511573)
Re:Nvidia Security Team: “What if we just stopped using C?” by ploxiln on Monday November 07, 2022 @12:55PM (#33509425)
C in software stacks is more like flame in kitchens. Fire is dangerous and bad for your health. Kitchen fires kill people, gas leaks kill people. It's possible to do without. But billions of people around the world cook with flame and do OK. All our ancestors did, and here we are. There will always be professional kitchens that use gas/flame (almost all of them). And it'll always be possible for your food to catch on fire anyway, if you cook it wrong.

Unlike asbestos insulation in houses, or flame in your personal kitchen, you actually can't avoid C in your software stack. Do you use Linux, FreeBSD, or OpenBSD, or macOS, or Windows? Do you use Postgres or MySql or sqlite, or maybe redis or memcached? How about a language like Python or JS or Java or Ruby or Lua? Do you use rust? guess what the business-end of that compiler is written in! so you dabble at the tippy-top of the stack in some language like rust or go, so what?

Re:Nvidia Security Team: “What if we just stopped using C?” by ClumsyPilot on Monday November 07, 2022 @01:01PM (#33509512)
> Unlike asbestos insulation in houses, you actually can't avoid C in your software stack

You know what, construction industry could have made the same argument - oh look, all insulation suppliers use asbestos, the factory is built out of it too, its everywhere in the supply chain, you can't actually avoid asbestos if you ate trying to build a house, so we should learn to live with it.

You can't avoid fossil fuels, you gave to use fossil fuels to produce a solar panel, so dreaming about clean energy is pointless.

The difference is that some i industries pull the finger out of their bum and clean up their act, and some i dustries, like our's, does not. Even thoigh perfectly serviceable alternatives exist.

Re:Nvidia Security Team: “What if we just stopped using C?” by jstimpfle on Monday November 07, 2022 @02:11PM (#33510757)
Depression can be bad, too. Maybe it can lead to cancer, and it undisputedly causes deaths.

Other languages make me depressive and steal my focus. They make me go to great lengths trying to get the simplest things done. In C, it's like memset(p, 0, sizeof *p), done. Other languages make it such that I always code on 3 layers of abstraction to not have to do the "hard" task, but now I don't know the implementation of those layers. They make it such that I'm constantly torn to come up with an even more clever thing to say the same things, with even more abstractions and moving parts. They pull so much attention to themselves, distracting from the task that I want get done. With C, this is not the case.

Maybe with a different personality, I could be similarly or even more productive in Rust, ignoring all the kitsch in its ecosystem. But I've started reading Rust projects dozens of times and have always turned away. They always use one more abstraction than I can be arsed to look up, always hide the most interesting and motivating parts behind a crate dependency.

This is not the case with C, where it is easy to find good (enough) code that is honest and direct, and rewarding. I know that C is not perfect. We're having an open relationship, and I don't have any attachments (besides knowing it well) that prevent me from jumping ship when I find a better one.

Re:Nvidia Security Team: “What if we just stopped using C?” by qualudeheart on Monday November 07, 2022 @05:24PM (#33513426)
MISRA C avoids those security flaws in a big way.
Re:Nvidia Security Team: “What if we just stopped using C?” by TazeTSchnitzel on Monday November 07, 2022 @05:38PM (#33513544)
I wish that were true. It imposes a lot of restrictions but doesn't solve the fundamental issues of C.
Re:Nvidia Security Team: “What if we just stopped using C?” by raxxorraxor on Tuesday November 08, 2022 @03:03AM (#33516949)
I have no emotion towards C. It is an old language and certainly an imperfect one. The thing is you just need to come up with something better. Maybe someday that can be Rust or another language. But you need something to replace it.

This will not be a quick change. C is interoperable, and the industry is moving slowly.

Re:Nvidia Security Team: “What if we just stopped using C?” by mbrodersen on Tuesday November 08, 2022 @06:12PM (#33525553)
There is a lot of software out there written in C. All of which needs maintenance. At work new C code gets checked in every day for software that runs major companies around the world.

Having said that, I would never recommend C as the language of choice for new projects.