News for hackers. Stuff that matters.
Re:The Safe C Library (2009) by LambdaComplex on Wednesday April 12, 2017 @09:03PM (#14103203)
> Following the logic here, you seem to be implying that no-one except the irresponsible should use C.

There are some platforms (such as embedded systems) where C really is the only choice. But if you do have a choice? Then I don't think using C is a good idea.

I'm not sure if "irresponsible" is the right word, though. I think developers underestimate the risks of C's unsafety and/or overestimate their ability to properly deal with it. Hanlon's razor[0] applies.

0. https://en.wikipedia.org/wiki/Hanlon%27s_razor

Re:The Safe C Library (2009) by Safety1stClyde on Thursday April 13, 2017 @04:11AM (#14105085)
Given a problem, C may or may not be the correct tool to solve it. Decrying C as so dangerous that it can never be safely used under any circumstances, as you and others on this discussion seem to be doing, is absolutely ridiculous, like trying to ban chefs from ever using sharp knives because they might cut themselves.

Much of the software that we all currently rely on is in C, for example all of the common operating systems are in C, and the reliability of these operating systems shows very clearly that C is nowhere near as inherently dangerous as you claim it to be.

Re:The Safe C Library (2009) by nickpsecurity on Thursday April 13, 2017 @12:09AM (#14104103)
"There are some platforms (such as embedded systems) where C really is the only choice. "

That's never true. You can always use a higher-level, safer language that can compile to C. The result is C code but you never write it & avoid its pitfalls. Ivory language in Haskell, Ada-to-C, and Modula-2-to-C come to mind. Alternatively, you can use something even more primitive in a C subset or native assembly that it compiles to. OcaPIC or JavaCard come to mind. Astrobe Oberon is another for safe, low-level coding but not sure how its compiler works.

Re:The Safe C Library (2009) by adrianN on Thursday April 13, 2017 @04:04AM (#14105049)
Adding an extra compilation step doesn't make debugging easier. The embedded C compilers also aren't known for their stability and standards compliance, so you'd likely have to massage your generated C to avoid bugs in the C compiler.
Re:The Safe C Library (2009) by nickpsecurity on Thursday April 13, 2017 @11:42AM (#14107946)
Those are good points worth considering for a given tool.
Re:The Safe C Library (2009) by sametmax on Thursday April 13, 2017 @01:43AM (#14104424)
No you can write rust now.
Re:The Safe C Library (2009) by jsymolon on Thursday April 13, 2017 @11:20AM (#14107713)
Per the Reenix OS implementation:

"This boot-loader, unfortunately, did not support loading any kernel images larger than 4 megabytes. This turned into a problem very quickly as it turns out that rustc is far less adept than gcc at creating succinct output. In fact, I was hitting this problem so early I was barely able to make a “Hello World” before having to stop working on rust code. Fixing this problem required rewriting most of the early boot code, all of which was x86 assembly ..."

Re:The Safe C Library (2009) by adrianN on Thursday April 13, 2017 @04:05AM (#14105052)
Not for all targets.