Announcement

Collapse
No announcement yet.

Clang Flips On Modules Support With C++2A Switch

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

  • Clang Flips On Modules Support With C++2A Switch

    Phoronix: Clang Flips On Modules Support With C++2A Switch

    With modules being an accepted feature for C++20, LLVM's Clang compiler has now enabled the functionality when tapping the compiler's experimental support via the -std=c++2a compiler switch...

    http://www.phoronix.com/scan.php?pag...Modules-Switch

  • #2
    has the modules implementation of the different compilers already converged ?
    Last edited by GunpowaderGuy; 04-15-2019, 10:10 AM.

    Comment


    • #3
      Originally posted by GunpowaderGuy View Post
      has the modules implementation of the different compilers already converged ?
      Not a chance. Plus most dependencies in C++ projects are C libraries and they will obviously not be modules.

      Either way, CMake (for now) will work the same.

      Comment


      • #4
        I already made some experiments with clang and modules to dig into this topic.
        Sadly the docs are very tiny at module-ts.
        AFAIK clangs implementation make it possible to unify the header declarations with the source but it still needs to generate a "metadata" file which need to be provided for further compilation.
        There are no flags available to do this in 1 step, but well there is still time until C++20 is officially released.

        Comment


        • #5
          Originally posted by kpedersen View Post

          Not a chance. Plus most dependencies in C++ projects are C libraries and they will obviously not be modules.

          Either way, CMake (for now) will work the same.
          We'll probably see C++ repos emerge that wrap these C libraries as C++ modules.

          Comment


          • #6
            Originally posted by wswartzendruber View Post

            We'll probably see C++ repos emerge that wrap these C libraries as C++ modules.
            Possibly but it would be better to see a complete break from many old C libraries.

            Comment


            • #7
              Originally posted by wizard69 View Post

              Possibly but it would be better to see a complete break from many old C libraries.
              libvorbis? libopus? ... libaom?

              Comment


              • #8
                Originally posted by wizard69 View Post

                Possibly but it would be better to see a complete break from many old C libraries.
                Complete break is rarely feasible. We will occasionally see libraries move from C to C++ (say libdnf) or C to Rust (say librsvg) but some C libraries will continue to be developed because the Rust toolchain is not there in several older Linux distributions including the enterprise focused ones or Rust architecture support isn't as mature as C/C++. We are however seeing more new projects being developed in Go or Rust. One can expect that will continue to accelerate as the surrounding ecosystem develops more (for example, good module support in Go)

                Comment


                • #9
                  Go is more of a Node.js/Python replacement than a C/C++/Rust replacement at this point.

                  Comment


                  • #10
                    The big problem with C++ modules is pointed out in the clang docs --
                    • Binary distribution of modules: Headers (particularly C++ headers) expose the full complexity of the language. Maintaining a stable binary module format across architectures, compiler versions, and compiler vendors is technically infeasible.
                    This makes it hard for e.g. a Linux distribution to provide a module built with clang that can be used by applications that get built with gcc and vice versa. Unless this problem is solved, we'll run into binary incompatibilities between clang-built and gcc-built systems whenever modules come into the picture.

                    Comment

                    Working...
                    X