• m_f@midwest.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 months ago

        C is definitely still king, but I wonder if crABI will eventually be able to dethrone it:

        https://github.com/rust-lang/rust/issues/111423

        If they can define a useful ABI that manages to include lifetimes, that might just be enough of an improvement to get people to switch over from assuming the C ABI everywhere.

        • Possibly linux@lemmy.zip
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          The problem is that both Rust and Go are huge. The compiled binaries are bigger and the compilers themselves and slower and more resource intensive. The current benefit to C is that is lean and compiles quickly.

          • Zangoose@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            4 months ago

            Rust is only huge because it doesn’t have an ABI. If you had an ABI (and didn’t have to compile every single dependency into the binary) the binary sizes would probably drop a lot to the point where they’re only slightly bigger than a C counterpart

            Edit: I don’t know if Go has an ABI but they also include a runtime garbage collector in their binaries so that probably has something to do with it.

  • Magister@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    4 months ago

    Linux is C only, ever read the rant by Linus last century about C++ ? I was there, in usenet

    • kekmacska@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      the author of C++ said that C gives you many opportunities to shoot yourself in the leg. You have a much less chance for this to happen with C++, but when it does, you will blow your whole lower body off

      • Valmond@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        Yeah C++ is a bazooka, C is like the death of 1000 paper cuts.

        The paper cuts are all poisonous and kills you anyway.

        • kekmacska@lemmy.zip
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          I haven’t used either, but compiled a lot of C source code and they compiled or could be adjusted easier even for someone who barely knows what printf, fopen, or #include are

          • Possibly linux@lemmy.zip
            link
            fedilink
            English
            arrow-up
            1
            ·
            4 months ago

            The thing with C is that you probaby won’t know you messed it up. It happens silently as memory gets corrupted.

            Modern compilers are much more advanced but you still can overwrite stuff in memory with other stuff

  • z3rOR0ne@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    4 months ago

    Girl, I will wear whatever socks you want, but… pulls out my own gun. We’re reading this damn book instead.

  • 𝕸𝖔𝖘𝖘@infosec.pub
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Put the gun away and throw that cpp book in the bin, fool. I brought The Linux Kernel Programming Guide, which is in C, and my own socks, which are wool. Now let’s gets crackin.

      • 𝕸𝖔𝖘𝖘@infosec.pub
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        Never touched rust, so I don’t understand the hype. I’m not arguing against it, mind you, but I’m gathering, more and more, that it’s worth a look. Maybe I’ll look into it after work.

        • snekmuffin@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          even all of that hype about memory safety and borrow checker you keep hearing aside, the actual coolest thing about Rust is how it does Traits instead of classes and that you can bind arbitrary data to enums