Stories
Slash Boxes
Comments

SoylentNews is people

posted by CoolHand on Friday May 08 2015, @09:01PM   Printer-friendly
from the off-with-its-head dept.

Ladies and gentlemen, the C programming language. It’s a classic. It is blindingly, quicksilver fast, because it’s about as close to the bone of the machine as you can get. It is time-tested and ubiquitous. And it is terrifyingly dangerous.

The author's biggest issue with the C language seems to be security holes:

If you write code in C, you have to be careful not to introduce subtle bugs that can turn into massive security holes — and as anyone who ever wrote software knows, you cannot be perfectly careful all of the time.

The author claims that the Rust language is a modern answer to these issues and should replace C (and C++). It does look that Rust can run C code, so it looks like an interesting proposition. What do Soylent's coders think about this?

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by richtopia on Friday May 08 2015, @09:18PM

    by richtopia (3160) on Friday May 08 2015, @09:18PM (#180481) Homepage Journal

    I'm not familiar with the speed of Rust, but when dealing with embedded systems, the speed of C is needed and thanks to its vast deployment has become a bit of a defacto standard.

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 0) by Anonymous Coward on Friday May 08 2015, @09:30PM

    by Anonymous Coward on Friday May 08 2015, @09:30PM (#180489)

    but when dealing with embedded systems, the speed of C is needed

    Ding, Ding, Ding. The proliferation of embedded systems ... including all the itsy-bitsy processors that will be swarming to become the Stupidnet of Everything ... require fast, small, reliable code. And where can we get this fast, small, reliable code? Hmmm ... let's C ...

    • (Score: 1, Interesting) by Anonymous Coward on Friday May 08 2015, @09:38PM

      by Anonymous Coward on Friday May 08 2015, @09:38PM (#180497)

      C will help you get fast and small, but it also makes reliable harder.

      Besides, nowadays "itsy-bitsy" systems are are 1GHz with 512MB of ram. [soylentnews.org]

      • (Score: 2, Insightful) by Anonymous Coward on Friday May 08 2015, @11:09PM

        by Anonymous Coward on Friday May 08 2015, @11:09PM (#180546)

        If you can't write reliable C code, then Rust isn't going to help you. If you can't figure out C, then you won't be able to figure out Rust. You'll just end up writing a lot of Rust code that works around the protections (limitations, really) that Rust tries to provide. You'll end up using Rust's unsafe keyword a lot. Your Rust code will be more dangerous than C code, because you and others will mistakenly think it's "safer" than C code when it really isn't. In fact, this poorly written Rust code could even be unsafer than poorly written C code.

        • (Score: 1, Insightful) by Anonymous Coward on Saturday May 09 2015, @12:03AM

          by Anonymous Coward on Saturday May 09 2015, @12:03AM (#180564)

          > If you can't write reliable C code, then Rust isn't going to help you.

          If you aren't perfect no tool will make you perfect.
          But none of us are perfect. Not even you.
          Good tools can make us better. Even you.

          • (Score: 0) by Anonymous Coward on Saturday May 09 2015, @03:34AM

            by Anonymous Coward on Saturday May 09 2015, @03:34AM (#180617)

            C is a good tool. Rust is not a good tool.

      • (Score: 0) by Anonymous Coward on Saturday May 09 2015, @04:31AM

        by Anonymous Coward on Saturday May 09 2015, @04:31AM (#180637)

        5 year from now, "itsy-bitsy" systems may be 3GHz hex core with 16 GB of RAM.

        Which language do you recommend we use to program them? Will you suggest the "hip" language of the week?

      • (Score: 0) by Anonymous Coward on Saturday May 09 2015, @04:07PM

        by Anonymous Coward on Saturday May 09 2015, @04:07PM (#180784)

        That's a nice $9 system you have there. Unfortunately, for what I'm working on, the processor cannot cost more than $0.40 (preferably half that), or the product will not be economically viable. Also, it has to run on a coin cell battery for at least a month.

  • (Score: 3, Interesting) by MichaelDavidCrawford on Saturday May 09 2015, @12:05AM

    by MichaelDavidCrawford (2339) Subscriber Badge <mdcrawford@gmail.com> on Saturday May 09 2015, @12:05AM (#180565) Homepage Journal

    or rather, if you aren't regarded as a particularly good programmer, you won't be offered an embedded job.

    The problem we have is that many people still learn C as a first programming language, by following K&R's advice about the C standard library with scanf and strcpy.

    --
    Yes I Have No Bananas. [gofundme.com]