Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Programming
  3. Time to make C the COBOL of this century

Time to make C the COBOL of this century

Scheduled Pinned Locked Moved Programming
41 Posts 24 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C [email protected]
    This post did not contain any content.
    P This user is from outside of this forum
    P This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #22

    That's a rather misleading headline, it's completely different from what the article which talks more on adopting good practices.

    1 Reply Last reply
    0
    • troyunrau@lemmy.caT [email protected]

      No.

      C is going to be around and useful long after COBOL is collecting dust. Too many core things are built with C. The Linux kernel, the CPython interpreter, etc. Making C go away will require major rewrites of projects that have millions upon millions of hours of development.

      Even Fortran has a huge installed base (compared to COBOL) and is still actively used for development. Sometimes the right tool for a job is an old tool, because it is so well refined for a specific task.

      Forth anyone?

      The rewrite-it-in-rust gang arrives in 3, 2 ...

      D This user is from outside of this forum
      D This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #23

      People tend to be obsessed with bleeding edge technology. But those who truly understand know that "bleeding edge" is an anti-pattern and there's a reason it's called that: it can bleed you as well.

      If it ain't broken, don't fix it.

      B troyunrau@lemmy.caT 2 Replies Last reply
      0
      • D [email protected]

        People tend to be obsessed with bleeding edge technology. But those who truly understand know that "bleeding edge" is an anti-pattern and there's a reason it's called that: it can bleed you as well.

        If it ain't broken, don't fix it.

        B This user is from outside of this forum
        B This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #24

        If it ain't broken, don't fix it.

        That’s the thing, it is broken and there is a fix desperately needed. C lacks memory safety, which is responsible for many, many security vulnerabilities. And they’re entirely avoidable.

        D 1 Reply Last reply
        0
        • vhstape@lemmy.sdf.orgV [email protected]

          It’s great that there are new languages coming along that strike a balance between performance and safety. However, there’s always going to be a need for unsafe, low-level code. I work in semiconductors and occasionally have to write firmware and drivers for our devices. There’s no avoiding C in those environments.

          B This user is from outside of this forum
          B This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #25

          Unsafe rust has proven that it can be an effective alternative here, ideal especially when the consumers are also rust.

          troyunrau@lemmy.caT 1 Reply Last reply
          0
          • C [email protected]
            This post did not contain any content.
            Z This user is from outside of this forum
            Z This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #26

            I do not think C is going to completely go away. If nothing more, it will be used as an ABI, to glue various other languages together.

            On the other hand, C is going to fade out, not just for memory safety issues, but also due to "language jank". Usually language design choices that made sense on 60's and 70's mainframes, but no longer needed, and later languages tried to rectify them in their "C-influenced" syntax, but had the issue of also being much higher level than C.

            Also Rust is just the most hyped replacement for C, and depending on your usecase, other languages might be much better. D has a very close syntax to C without the jank, expecially when used in the betterC mode.

            F 1 Reply Last reply
            0
            • B [email protected]

              If it ain't broken, don't fix it.

              That’s the thing, it is broken and there is a fix desperately needed. C lacks memory safety, which is responsible for many, many security vulnerabilities. And they’re entirely avoidable.

              D This user is from outside of this forum
              D This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #27

              So the solution is to take away any agency the developer may have over how their application allocates memory?

              B O 2 Replies Last reply
              0
              • D [email protected]

                So the solution is to take away any agency the developer may have over how their application allocates memory?

                B This user is from outside of this forum
                B This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #28

                Remove the need to, yes. Remove the ability to? No, and rust doesn’t prevent you from doing that, it just makes you mark it unsafe so that way if you fuck up and cause a memory error, the root cause can be narrowed down to a tiny fragment of the code base.

                1 Reply Last reply
                0
                • Z [email protected]

                  I do not think C is going to completely go away. If nothing more, it will be used as an ABI, to glue various other languages together.

                  On the other hand, C is going to fade out, not just for memory safety issues, but also due to "language jank". Usually language design choices that made sense on 60's and 70's mainframes, but no longer needed, and later languages tried to rectify them in their "C-influenced" syntax, but had the issue of also being much higher level than C.

                  Also Rust is just the most hyped replacement for C, and depending on your usecase, other languages might be much better. D has a very close syntax to C without the jank, expecially when used in the betterC mode.

                  F This user is from outside of this forum
                  F This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #29

                  Well COBOL hasn't completely gone away... I don't think anyone expects C to become completely extinct; just very legacy.

                  1 Reply Last reply
                  0
                  • D [email protected]

                    People tend to be obsessed with bleeding edge technology. But those who truly understand know that "bleeding edge" is an anti-pattern and there's a reason it's called that: it can bleed you as well.

                    If it ain't broken, don't fix it.

                    troyunrau@lemmy.caT This user is from outside of this forum
                    troyunrau@lemmy.caT This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #30

                    I agree. And those decades of development come with huge advantages. Libraries. Patterns. Textbooks! Billions of lines of code you can cross reference and learn from!

                    It's fun to bleed a little when you are tinkering. It's not fun to have to reinvent the wheel because you choose a language that doesn't have an existing ecosystem. That becomes and chicken-and-egg problem. The tinkerers fulfill this role (building out the ecosystem) and also tend to advocate for their tinkering language of choice. But there needs to be a real critical mass.

                    It takes decades to shift an entrenched ecosystem. Check in ten years if the following exist in languages other than C/C++: an enterprise grade database, a python(/etc.) interpreter that isn't marked experimental, an OS kernel that is used somewhere real, an embedded manufacturer that ships the language as its first class citizen, a AAA game using it under the engine...

                    Like, in the last 15 years, I'm only aware of a single AAA game that used a memory safe language -- Neverwinter Nights 2 used C# for part of the Electron Engine...

                    Rust is the most likely candidate here, although you see things like Erlang being used to make some databases (CouchDB). People see Rust being used on some real infrastructure projects that gain actual traction (polars comes to mind). Polars is an interesting use case though -- it's simply better than the other projects in its particular space and so people are switching to it not because it is written in rust at all... And honestly, that's probably the only way this happens.

                    1 Reply Last reply
                    0
                    • B [email protected]

                      Unsafe rust has proven that it can be an effective alternative here, ideal especially when the consumers are also rust.

                      troyunrau@lemmy.caT This user is from outside of this forum
                      troyunrau@lemmy.caT This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #31

                      Chicken and egg problem strikes again

                      1 Reply Last reply
                      0
                      • D [email protected]

                        So the solution is to take away any agency the developer may have over how their application allocates memory?

                        O This user is from outside of this forum
                        O This user is from outside of this forum
                        [email protected]
                        wrote on last edited by
                        #32

                        Have you heard of the unsafe block in rust?

                        Anti Commercial-AI license

                        1 Reply Last reply
                        0
                        • kolanaki@pawb.socialK [email protected]

                          Serious question: How can a programming language be more or less secure than another? I am just a hobbiest, not a professional, so I am genuinely curious.

                          O This user is from outside of this forum
                          O This user is from outside of this forum
                          [email protected]
                          wrote on last edited by
                          #33

                          It's about memory management.

                          In programming terms: allocated memory has to have the data in it that you expect in order for your program to work. The unsafe languages do it by manually ensuring it's good and doing so mostly at runtime, or just assume the data is valid and write code that looks valid and have somebody check it before the program runs, or do a mix thereof. In all cases, it require a lot of human intervention and because humans are fallible with different skill levels, this fail quite often.

                          Safe languages are either built on top of unsafe languages that are battle tested and do lots of runtime checks behind the scenes (interpreted languages like python, ruby, javascript, etc.). Then there are languages that check actions at compile time like Rust. They tell you that the memory you're trying to access can be modified by another part of the code, which might make unexpected changes and that in order to access it, certain conditions have to be met.

                          In laymans terms: imagine you work at a storage facility (memory) and have to store and retrieve packages. To know where to store and retrieve them, you have a piece of paper with the aisle, shelf, and rack and position on the rack. That's your pointer. To store something, you have to make space on a rack and put the item there, write down the name of the item (variable) and location on a piece of paper (memory address), and keep it on you.

                          Imagine keeping all of that in order. You have to make sure you don't write down the wrong location (off by one error), remove a piece of paper then it's not valid anymore (dangling reference), remove a piece of paper without removing the item (memory leak), add a piece of paper pointing to something without actually checking what you expect to be there is there and then retrieve it later, and so many other things.
                          Those are the things unsafe languages allow you to do.

                          Safe languages either enforce that before doing certain things, you check stuff (runtime checks) or that before you even start doing anything, you plan how you would do, and that plan is checked.

                          The crazy storage facilities are what most of our world runs on at the moment and there a whole lot of people who love it because it's simple and they know it. "Just tell the intern to get that box there, I made sure it'll be fine. Trust me, I've been doing it this way for years." meanwhile somebody gets the wrong medicine because a piece of paper said another one was supposed to be on the shelf. There are a bunch of people who have thought about ways to improve it, implemented, tested it, and are using it to manage their storage facilities.

                          Anti Commercial-AI license

                          1 Reply Last reply
                          0
                          • C [email protected]
                            This post did not contain any content.
                            footfaults@lemmygrad.mlF This user is from outside of this forum
                            footfaults@lemmygrad.mlF This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #34

                            I mean it's never going to go away, because there has to be something to bootstrap all these newer languages from.

                            https://en.m.wikipedia.org/wiki/Bootstrapping_(compilers)

                            I absolutely agree that most normal programmers need to move away from C but it's not going to go away anytime soon

                            1 Reply Last reply
                            0
                            • M [email protected]

                              These tech images are getting pretty ridiculous. What even is this thumbnail?

                              joshcodes@programming.devJ This user is from outside of this forum
                              joshcodes@programming.devJ This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #35

                              Getting?

                              1 Reply Last reply
                              0
                              • C [email protected]
                                This post did not contain any content.
                                G This user is from outside of this forum
                                G This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #36

                                We’ve already seen a few crotchety old timers who don’t want to add rust to the Linux kernel.

                                At some point, a complete rewrite of the kernel in a memory safe language would be prudent. Unfortunately, the dinosaurs will have to go extinct before that can happen.

                                mrkite@programming.devM 1 Reply Last reply
                                0
                                • G [email protected]

                                  We’ve already seen a few crotchety old timers who don’t want to add rust to the Linux kernel.

                                  At some point, a complete rewrite of the kernel in a memory safe language would be prudent. Unfortunately, the dinosaurs will have to go extinct before that can happen.

                                  mrkite@programming.devM This user is from outside of this forum
                                  mrkite@programming.devM This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by
                                  #37

                                  Literally no one is stopping you

                                  G 1 Reply Last reply
                                  0
                                  • mrkite@programming.devM [email protected]

                                    Literally no one is stopping you

                                    G This user is from outside of this forum
                                    G This user is from outside of this forum
                                    [email protected]
                                    wrote on last edited by
                                    #38

                                    Just those crotchety old timers who currently gatekeep the code base.

                                    mrkite@programming.devM 1 Reply Last reply
                                    0
                                    • M [email protected]

                                      These tech images are getting pretty ridiculous. What even is this thumbnail?

                                      deebster@programming.devD This user is from outside of this forum
                                      deebster@programming.devD This user is from outside of this forum
                                      [email protected]
                                      wrote on last edited by
                                      #39

                                      It's how everyone who's anyone does code reviews!

                                      1 Reply Last reply
                                      0
                                      • G [email protected]

                                        Just those crotchety old timers who currently gatekeep the code base.

                                        mrkite@programming.devM This user is from outside of this forum
                                        mrkite@programming.devM This user is from outside of this forum
                                        [email protected]
                                        wrote on last edited by
                                        #40

                                        That doesn't prevent you from forking it.

                                        G 1 Reply Last reply
                                        0
                                        • mrkite@programming.devM [email protected]

                                          That doesn't prevent you from forking it.

                                          G This user is from outside of this forum
                                          G This user is from outside of this forum
                                          [email protected]
                                          wrote on last edited by
                                          #41

                                          The Linux kernel is a few hundred million lines of code, probably.
                                          It does need to slowly be moved into a memory safe language.

                                          1 Reply Last reply
                                          0
                                          • System shared this topic
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups