Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror

Comment Re:Start with gcc -fsanitize=address,undefined (Score 1) 80

Java, C#, Rust, and Go were not created by people who want to make C safe, but people who have different ideas on how a language should work. Go is, unsurprisingly, close in philosophy but the others are very far.

Function pointers do not need to be replaced in a safe version of C.

You are right that you need something as lifetimes or a borrow checker. You certainly do not need an entirely different syntax, proc macros, monomorphization, many different string types, etc.

Comment Re:Start with gcc -fsanitize=address,undefined (Score 1) 80

I do not think a hardened version of C is that hard. Fil-C is slow because it runs unmodified C. To develop a hardened version of C you need to subset C and emit errors for possible UB. It would need some extensions for ownership and/or lifetimes, but there is no need to throw out the baby with the bathwater and come up with a super-complicated and different language such as Rust.

Comment Re:Nope (Score 1) 151

This "entire application written in C (and C++) is inherently unsafe by design" argument is also exaggeration. Not all C code is unsafe, in a single-threaded C application there are essentially three specific features in C that are unsafe with respect to memory namely pointer arithmetic, union access, and free.This also depends on the C implementation, but typically these are the three features you need to care about and you can easily isolate pointer arithmetic and union access into safe wrapper function. Only to avoid use-after-free this is a bit harder.

Slashdot Top Deals

This is a good time to punt work.

Working...