News for hackers. Stuff that matters.
Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by andrewflnr on Wednesday November 14, 2018 @05:56PM (#18455003)
There's no way to "fix C" in a way that saves you from the cost of fixing all those broken programs written in C. The best a language-level solution can do for an existing project is make it easier to figure out what specifically needs fixing. Or blow up your code and run time with checks, I guess, but if that was technically feasible, to say nothing of political challenges, those projects wouldn't have been in C to start.

I feel like Elrond at the council of Rivendell: "you have only one choice." Except throwing a ring into a hole is a comparatively well-defined task relative to rewriting an unknown number of crappy pieces of software. Ed: also there's no conveniently situated group of people to whom to assign the project.

Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by pcwalton on Wednesday November 14, 2018 @06:16PM (#18455162)
> Or blow up your code and run time with checks, I guess, but if that was technically feasible, to say nothing of political challenges, those projects wouldn't have been in C to start.

Most of the infrastructural projects you're referring to predated modern languages. There is no reason, for example, for an MTA to be written in C today. We use MTAs written in C because MTAs are old.

Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by andrewflnr on Wednesday November 14, 2018 @06:48PM (#18455426)
They had pascal and friends, didn't they? Which are safer, safe-ish, right? But I guess today you could eat the cost of automatically inserted runtime checks on software designed to push the limits of 30yo hardware. Still won't fly for Linux or embedded systems...
Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by pjmlp on Thursday November 15, 2018 @01:25AM (#18457308)
There is this expression, a language is a dialect with an army.

The same applies to system languages, just that the army is the OS that bundles them as THE official language.

Pascal based OSes unfortunately lost their place on the market.

To pick a more modern example, how many people would have bothered with JavaScript if it wasn't THE language on the Web OS?

Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by nickpsecurity on Wednesday November 14, 2018 @08:31PM (#18456128)
Schemes for memory safety of C code have already been applied to UNIXy OS's. SVA-OS with SAFEcode used FreeBSD.

Far as embedded, there were some done in Ada and a Java subset. There's even real-time GC's for that kind of stuff. One or two companies sell Java processors that run it natively. CompSci stays doing CPU extensions that could work with MCU's.

Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by pcwalton on Wednesday November 14, 2018 @08:20PM (#18456057)
The versions of Pascal that are practical aren't any safer than C.

With a properly designed programming environment, you don't need many bounds checks to begin with. Almost every embedded system can easily afford the cost of the few you can't eliminate.

Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by pjmlp on Thursday November 15, 2018 @01:21AM (#18457294)
On the contrary.

While they aren't Rust level safe, they eliminate like 80% of the common C safety errors.

Thanks to explicit conversions, proper enums, reference parameters, actual string and vector types, memory allocation based on types instead of arbitrary numbers, type safe linkage thanks modules.

So while use after free or double frees would are still an issue, many other classes of typical C errors would be gone.

Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by pcwalton on Thursday November 15, 2018 @12:19PM (#18461161)
Conversions and such aren't where the memory-safety-related vulnerabilities in C++ come from nowadays. They come from memory management problems, which Pascal doesn't help with.
Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by pjmlp on Thursday November 15, 2018 @04:49PM (#18463749)
Moving goal posts here? I thought we were speaking about C.

Yes Rust is great and all, sometimes getting people half-way is better than not at all.

Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by andrewflnr on Thursday November 15, 2018 @07:53PM (#18465172)
He probably meant to type C/C++ or something but typo'd it. The set of vulnerabilities is exactly the same. If Pascal still lets you do heap corruption, it's only a matter of time before RCEs become common. So yeah, I'm convinced on that point.
Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by pjmlp on Wednesday November 14, 2018 @06:06PM (#18455075)
Basically, until the world gets rid of UNIX derived OSes, we call it a defeat and go back home.
Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by andrewflnr on Wednesday November 14, 2018 @06:22PM (#18455218)
If you're trying to characterize what I said, no. I'm saying we need to work on convincing the world to frigging drop Unix-derived OSes already.
Re:There’s a Hole in the Bottom of the C: Effectiveness of A... by pjmlp on Thursday November 15, 2018 @01:29AM (#18457324)
Agreed, but it seems we are loosing on that front from the last 20 years, right?

Including the commercial failure of Inferno.

How things are going even Microsoft could eventually have again their own version.

So from the business perspective it seems the only way to win is to fix the language UNIX is written on.