Announcement

Collapse
No announcement yet.

C++20 Draft Approved As Major Update To C++ Programming Language

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Overall gist seems like let's copy Rust cool stuff, but overthink it to the point of absurd and mess it up to maintain fake C compatibility, because that's what C++ always stands for! (;

    Comment


    • #32
      Originally posted by mb_q View Post
      Overall gist seems like let's copy Rust cool stuff, but overthink it to the point of absurd and mess it up to maintain fake C compatibility, because that's what C++ always stands for! (;
      If C++ and C didn't maintain such careful compatibility... Cargo's crates.io would have 60% less packages. Perhaps you should a bit more grateful to what is effectively your upstream languages?

      Originally posted by gufide View Post
      Of course, if there was a well defined way to break ABI or define multiple ABI a change could be done and these would be truely zero overhead, but right now it cannot be done, not on unix like platform.
      Cool, thanks for the interesting info. I see what you mean. Are there any languages (or specific implementations) that do manage to achieve zero overhead?
      Last edited by kpedersen; 06 September 2020, 07:27 PM.

      Comment


      • #33
        Originally posted by Brane215 View Post
        Great. As Linus has pointed out, great value of C++ is to keep lure morons away from kernel crowd.
        I knew a C snob would be all over this, and it only took 2 replies! Plus an out of context Linux quote (he was talking about kernel/system level programming rather than C++ in general). Thanks for not disappointing, Phoronix!

        Comment


        • #34
          Originally posted by SledgeHammer_999 View Post

          If you want to edit the implementation you only have to edit the relevant .cpp file. You touch the header file only if you change function signatures or add/remove functions.

          As for the bold part: I don't think that ability is hindered by the split into header and .cpp files.
          The bolded part was me saying "I don't get any benefit from the source/header split" and the un-bolded part was me saying that the source/header split represents needless cognitive overhead.

          Comment


          • #35
            Originally posted by SledgeHammer_999 View Post
            If you want to edit the implementation you only have to edit the relevant .cpp file. You touch the header file only if you change function signatures or add/remove functions.

            As for the bold part: I don't think that ability is hindered by the split into header and .cpp files.
            I don't like header files because it's redundant work. Why do I have to type in my function signature TWICE, once in the .cpp and once again in the header? Furthermore, why does it have to be a slightly different syntax so I can't simply copy/paste and forget about it? No, I've got to worry about placing function parameter default values in the header and not in the cpp, among other odd quirks.

            I'm sitting at a computer for goodness sakes, why isn't the computer doing this busy work for me?

            In an ideal world, the compiler would parse the source code to figure out the function signatures by itself, then store that information in the resulting .o or .so files so that nobody down the line ever needs headers.

            Comment


            • #36
              Originally posted by Brane215 View Post
              Great. As Linus has pointed out, great value of C++ is to keep lure morons away from kernel crowd.
              moron, linus has improved his education and is happy c++ programmer for many years
              Last edited by pal666; 07 September 2020, 02:44 AM.

              Comment


              • #37
                Originally posted by skeevy420 View Post
                Code:
                <=>
                / \
                | |
                | |
                I'd like to propose the beam me up Scotty operator
                eol-sensitive syntax is more suited for python

                Comment


                • #38
                  Originally posted by RealNC View Post
                  The idea of "zero cost abstractions" in C++ is great. Too bad many of them turn out to not be zero cost at all in the actual implementations of the standard library. If you watch those "modern C++" conference videos on youtube, all is presented nice and dandy. "Use std::tuple, it's free!" Or "use std::unique_ptr, it's free!" Well, they're only "free" in some imaginary, theoretical implementation that doesn't exist :-/
                  in inlined case they are completely free

                  Comment


                  • #39
                    Originally posted by andreano View Post
                    Sceptical about: What modules will do to compilation speed.
                    they will greatly improve compilation speed, but there are much more important benefits of modules in providing real language cross-tu interfaces instead of token soup
                    Originally posted by andreano View Post
                    Will compilers treat everything as one compilation unit (as rustc 1.0 did)?
                    no. but optimizing compilers already do that for most time consuming step with lto

                    Comment


                    • #40
                      Originally posted by increasechief View Post
                      Could this language be any more of a mess: https://en.cppreference.com/w/cpp/memory/to_address
                      you don't have to write templated code, it's a job for smarter people than you. you can only use their code, it's much easier

                      Comment

                      Working...
                      X