Will there be performance and security improvements?

  • Rikudou_Sage
    link
    fedilink
    82 years ago

    How is C faster than C++? Unless you use virtual functions, it’s as performant as C. And you definitely wouldn’t use virtual functions in a kernel.

    • Anti-Antidote
      link
      fedilink
      232 years ago

      C++ is only as fast as C if you use only the parts of C++ that are identical to C. In other words, C is faster than C++

        • @[email protected]
          link
          fedilink
          02 years ago

          Compile time has got to be part of the convo esp when it comes to the kernel. The Linux kernel is one of the few bits where end-users are actively encouraged to compile from source. It is a feature!

          Adding C++ compilitis is pain for what gain, from a kernel pov.

          I am not a big fan of c++ overall however that is because other languages have emerged that are sweeter than C that gate some of the people issues with C++.

          Anyone who has ever had a thing that was like a thing but not exactly the thing, in C, knows C ain’t great at that.

          • @[email protected]
            link
            fedilink
            82 years ago

            The description says:

            In this video, we’ll do a deep dive on what C++ Polymorphism is, what “virtual” does under the hood, and ultimately why it is SUCH a performance hit compared to languages like C and Rust.

            This is not about compile-time polymorphism.

        • @[email protected]
          link
          fedilink
          22 years ago

          Aside from that I think C is more performant than C++ (indeed when you use the bells and whistles that C++ offers), you are comparing the libraries with each other.

          The fact that the implementation of one random std::Sort is faster than the implementation of qsort() is comparing libraries, not the languages. You are comparing the algorithm of the Rust Sort with quicksort (which is obviously the qsort you are referring to.

          I am certain there are sort implementations in C which outperform Rust.

          Having said that, I immensely enjoy Rust because it forces me to think about the error handling and it does not give me the quirks of C/C++ (index out of bounds, memory corruption).

            • @[email protected]
              link
              fedilink
              02 years ago

              while C has to fiddle with void* and function pointer to get similar flexibility, which are much harder to optimize, as none of the type information is there.

              I thought we were discussing speed, not ease of use?

    • @[email protected]
      link
      fedilink
      22 years ago

      Since C++ has Turing complete compiling, I guess technically it can go infinite compilation time