News for hackers. Stuff that matters.
Re:Checked C: Making C Safer by Extension by Animats on Sunday September 09, 2018 @02:40AM (#17944677)
I wonder how this will work out. GCC had checked fat pointers for years, used by almost nobody. Microsoft can make it stick on their platform, because they own the libraries and can make them use fat pointers.

I hope this works out better than Microsoft Managed C++.

Re:Checked C: Making C Safer by Extension by pjmlp on Sunday September 09, 2018 @04:13AM (#17944917)
Managed C++ has been replaced by C++/CLI in 2005 and it pretty much alive.

Its purpose was to make .NET interop easier with C++ libraries and has been quite successful at it, instead of having to play around with P/Invoke until everything works properly.

Regarding Windows, Microsoft is pretty much on the ongoing transition to C++, where these kind of issues are easier to tackle.

I bet their goals regarding Checked C have more to do with the adoption of UNIX (Linux/BSD) based technologies for Azure deployments and IoT devices like Azure Sphere.

Re:Checked C: Making C Safer by Extension by wott on Sunday September 09, 2018 @06:12AM (#17945208)
There has been dozens of "safe" additions, variants and extensions to C along the years (from commercial companies, from individuals, from university labs, ...). Not one of them ever took off. This one did not either.

We always just say "hmmm... right... this one may look a bit better than the previous one (or doesn't)" and we never bother to use them. After 20 years like this, we can conclude that we like C as it is and are not interested in extra layers.

Re:Checked C: Making C Safer by Extension by stefano on Sunday September 09, 2018 @08:55AM (#17945687)
> After 20 years like this, we can conclude that we like C as it is and are not interested in extra layers.

This says a lot about how little the industry cares about software quality. You'd think a bunch of people who make a living out of automating tasks would happily use tools that automate the checking of an importnt source of bugs. Instead, many prefer to use tools that look simpler on the surface and then end up manually testing for the same kind of bugs over and over. So you have people writing in dynamically typed languages who rely on (manually written!) unit tests to check that their program is not mixing up types, and others using unsafe languages and then relying on tests to catch memory access violations. Inevitably, tests never catch all issues and you end up with type errors and segfaults in production.

Re:Checked C: Making C Safer by Extension by vmchale on Monday September 10, 2018 @12:07AM (#17949314)
> This says a lot about how little the industry cares about software quality. You'd think a bunch of people who make a living out of automating tasks would happily use tools that automate the checking of an importnt source of bugs. Instead, many prefer to use tools that look simpler on the surface and then end up manually testing for the same kind of bugs over and over. So you have people writing in dynamically typed languages who rely on (manually written!) unit tests to check that their program is not mixing up types, and others using unsafe languages and then relying on tests to catch memory access violations.

In the case of a "safer C" I suspect it's largely because it never materialized. C still has its deficiencies relative to Rust, but Rust is the first viable competitor.

Re:Checked C: Making C Safer by Extension by pjmlp on Monday September 10, 2018 @03:36AM (#17950066)
Sure it did, all major systems languages outside UNIX universe were safer than C.

But the OSes they were tied to were killed by UNIX's adoption, just like the browser has helped JavaScript to take over areas of other languages.

Re:Checked C: Making C Safer by Extension by zzzcpan on Sunday September 09, 2018 @09:08AM (#17945740)
For starters people have to realize that safe C is not a research problem. It's an engineering problem of compilers, package management and C software. And all it takes to take off is some engineering work.

However funding that work is a big problem, since it mostly benefits others.

Re:Checked C: Making C Safer by Extension by pjmlp on Monday September 10, 2018 @03:37AM (#17950073)
You missed the most important one, people.

Mentalities are very hard to change and we all know that only lousy programmers make errors in C.

Re:Checked C: Making C Safer by Extension by sterlind on Sunday September 09, 2018 @03:42AM (#17944836)
As far as I know, Managed C++ is mostly used as an interop layer between C/C++ and C#, sort of like the inverse of P/Invoke.

Since P/Invoke can't marshal C++ classes, Managed C++ gives you a way to expose such things. It's a very special-purpose chimera.