• onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    16
    arrow-down
    1
    ·
    6 months ago
    • We see no realistic path for an evolution of C++ into a language with rigorous memory safety guarantees that include temporal safety.
    • A large-scale rewrite of all existing C++ code into a different, memory-safe language appears very difficult and will likely remain impractical.

    Tough spot to be in, but I’m glad there are more and more people calling out for a transition away from C/C++. One can only hope that Rust doesn’t become the new C++ aka the garbage dump of programming languages. Every large player wanted to write C++ in their own way, so they added it to the language and now we have this… thing.

    CC BY-NC-SA 4.0

    • ebits21@lemmy.ca
      link
      fedilink
      English
      arrow-up
      4
      ·
      6 months ago

      In the long run, I wonder if rust will spawn a family of new memory-safe languages.

    • bluGill@kbin.social
      link
      fedilink
      arrow-up
      2
      ·
      6 months ago

      Unfortuately c++ interoperability is hard. I wouldn’t write c++ without vector and other containers (templates). Or classes complete with inheiritance (rarely multiple) and thus name mangeling. I now have millions of lines of that stuff and it is hard to write anything else because it has to mix.

  • varsock@programming.dev
    link
    fedilink
    arrow-up
    13
    ·
    6 months ago

    At work, we started the c++ migration to rust doing the following:

    1. Identify “subsystems” in the c++ code base
    2. Identify the ingress/egress data flows into this subsystem
    3. Replace those ingress/engress interfaces with grpc for data/event sharing (we have yet to profile the performance impact of passing an object over grpc, do work on it, then pass it back)
    4. Start a rewrite of the subsystem. from c++ to rust
    5. Swap out the two subsystems and reattach at the grpc interfaces
    6. Profit in that now our code is memory safe AND decoupled

    The challenge here is identifying the subsystems. If the codebase didn’t have distinct boundaries for subsystems, rewrite becomes much more difficult

    • designatedhacker@lemm.ee
      link
      fedilink
      arrow-up
      5
      ·
      6 months ago

      Sounds like you’re well on your way with a good process. The book Software Architecture: The Hard Parts is a pretty decent guide to breaking apart a monolith. It’s not a 100% follow it to the letter guide IMO, but I think the overall approach makes sense. At each step you have to consider trade-offs instead of following any kind of dogma.

  • dlynch@programming.dev
    link
    fedilink
    arrow-up
    9
    ·
    6 months ago

    Dang. It seems like there is a lot of momentum around transitioning away from C/C++.

    Is C++ going to be the new FORTRAN/COBOL/PERL in 30 years?

    • Sylvartas@lemmy.world
      link
      fedilink
      arrow-up
      10
      arrow-down
      1
      ·
      6 months ago

      Sign me the fuck up, I want to get paid absurd amounts of money to do basic stuff in a language I am already proficient in