3 ms·
"C just adds memory corruption to the set of issues one has to worry about." That's a very casual way to say that C adds an entire class of errors that lets at
by nickpsecurity 11y ago
"C just adds memory corruption to the set of issues one has to worry about."
That's a very casual way to say that C adds an entire class of errors that lets attackers own your machine with the slightest mistake in the most common coding situations. Memory safety is such a huge increase in security over C that it isn't even funny that people use C where not necessary. Type-safety plus good type system gets a start on knocking out data and interface errors. Type systems with context, or just Design-by-Contract, can knock out more interface errors.
So, a good type system, type safety, and memory safety should be the baseline for reliable or secure systems. C tosses out the whole baseline in exchange for... running a bit faster or lazy programmers?
Note: I'm talking in general rather than building on existing C projects, where using C makes some sense.
- pjmlp 11y agoYeah, I should have let the "just" out. There are a whole class of errors caused by C's memory corruption "feature" that I can happily live without. C tosses safety away, because its designers were lazy to implement a proper compiler given what the computing world was doing outside AT&T. Bjarne wasn't also quite found of it, but he had to compromise to get adoption, given his employer. https://www.youtube.com/watch?v=ZO0PXYMVGSU https://www.youtube.com/watch?v=ZO0PXYMVGSU
- nickpsecurity 11y agoThanks for the link. It's all good so long as you keep countering the myth of C having good design like you did here [1] and I backed you up on here [2]. Their house of cards (i.e. ideology) will come down easier as we continue kick its foundation out from underneath. ;) Far as resource constraints, there's been interesting work along those lines, too. I mean, we have obvious Modula-2/Lilith project. However, it was cool that a recent project used ATS language to program an 8-bit microcontroller. That's on top of safe ASM, embedded DSL's like Ivory language, and stuff like Cyclone. C proponents' excuses for its design advantages are getting thin, thin, thin... [1] https://news.ycombinator.com/item?id=10268614 https://news.ycombinator.com/item?id=10268614 [2] https://news.ycombinator.com/item?id=10273656 https://news.ycombinator.com/item?id=10273656
- pjmlp 11y agoThere is some interesting content here regarding how older languages were ignored in the process. History and Spirit of C and C++ @ NDC 2015 https://vimeo.com/132192250 https://vimeo.com/132192250
- nickpsecurity 11y agoAppreciate it. Watching it now as I have some spare time. Seems good so far.
- nickpsecurity 11y agoFinished. Was a pretty good video. I did a write-up of it below on Schneier's blog to justify eliminating C because it's provably Bad by Design. All due to limitations of the PDP's and, new to me, the EDSAC. Also more of a rip-off of BCPL than I thought before. https://www.schneier.com/blog/archives/2015/10/friday_squid_bl_497.html#c6708072 https://www.schneier.com/blog/archives/2015/10/friday_squid_...
- pjmlp 11y agoVery good write-up. Sadly I can only up-vote once.