GCC Rust Approved By Steering Committee, Likely To Land For GCC 13

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Developer12
    Senior Member
    • Dec 2019
    • 1549

    #11
    Originally posted by babali View Post
    What's the benefit of having a GCC port?
    Rust doesn't need to get picked up by GCC to get into linux (Torvalds said himself that Rust might get picked up next kernel cycle).

    However, Rust does need GCC support to be used for non-optional core Linux kernel stuff. You can't replace part of the memory management with Rust without GCC support, because then a significant number of architectures supported by linux wouldn't be able to compile the kernel. You would effectively be dropping support for them.

    Comment

    • andyprough
      Senior Member
      • Feb 2012
      • 2436

      #12
      Originally posted by babali View Post
      What's the benefit of having a GCC port?
      The benefit is that gcc can reliably build a working kernel for you, unlike clang/llvm after 19 years of development. Going to need to have at least one compiler that can handle rust if you are going to add it to the kernel.

      Comment

      • Ironmask
        Senior Member
        • Mar 2019
        • 828

        #13
        Originally posted by andyprough View Post

        The benefit is that gcc can reliably build a working kernel for you, unlike clang/llvm after 19 years of development. Going to need to have at least one compiler that can handle rust if you are going to add it to the kernel.
        You do know LLVM struggled to build Linux because Linux heavily made use of GCC-specific non-standard extensions, right?
        Linux was broken, not LLVM. Nothing but GCC could compile it.

        Comment

        • andyprough
          Senior Member
          • Feb 2012
          • 2436

          #14
          Originally posted by Ironmask View Post
          You do know LLVM struggled to build Linux because Linux heavily made use of GCC-specific non-standard extensions, right?
          Linux was broken, not LLVM. Nothing but GCC could compile it.
          I do know that large corporations like Apple and IBM are constantly promoting "new and amazing" technologies for Linux Land that never quite work out in the way that they were promoted, but they always have excuses for why Linux is "just too hard to work with". You are correct that I could track down all of their excuses and see if they have merit or not.

          Comment

          • oleid
            Senior Member
            • Sep 2007
            • 2472

            #15
            Originally posted by babali View Post
            Are rust/llvm and rust/gcc sharing the front-end?
            There are actually two projects to get gcc to understand rust. The first one, gccrs, is what this news is about.
            This is a full re-implementation of rust and currently independent from the reference implementation of rustc.
            The 2nd project is re-using basically adding a gcc backend to the existing rustc codebase. It lives in the rustc repository:

            libgccjit AOT codegen for rustc. Contribute to rust-lang/rustc_codegen_gcc development by creating an account on GitHub.


            It leverages gcc-as-a-library, aka libgccjit. Despite the name, it is also able to generate ahead-of-time code.

            Originally posted by babali View Post
            How much latency between one release with llvm and one release with gcc?
            For the first project it is currently really hard to tell. But it is probably safe to say it will be in catch-up-mode for some time.
            For the 2nd project, it will at some point be one of the official backends and be up-to-date.

            Originally posted by babali View Post
            What are the consequences for cargo?
            cargo will, most likely, have to learn about gccrs at some point. If the compiler options are compatible, it wll probably just work today.

            Comment

            • cj.wijtmans
              Senior Member
              • Mar 2016
              • 1404

              #16
              Originally posted by Sin2x View Post
              Should have been Zig (or nothing, nothing works for me too). Rust is an overhyped buzzword pushed by the corporations and their zombified zealots.
              Indeed the world has gone insane. I expect the IT world to get even worse and worse as coding zombies become the majority of "coders". I am even surprised dyslexic languages came to be. Linux distros have become trashy, almost as trashy as windows 10 o windows 11, with lots of crashes, inconsistencies etc. Idiocracy is becoming real. At least we still have BSD or TempleOS.

              Comment

              • mdedetrich
                Senior Member
                • Nov 2019
                • 2507

                #17
                Originally posted by andyprough View Post

                I do know that large corporations like Apple and IBM are constantly promoting "new and amazing" technologies for Linux Land that never quite work out in the way that they were promoted, but they always have excuses for why Linux is "just too hard to work with". You are correct that I could track down all of their excuses and see if they have merit or not.
                Or you could just do your research and stop spreading BS.

                Linux used many non standard GCC extensions in the codebase which meant that only GCC could compile it, it wasn't a standard C codebase in this regard (so much for standards).

                Comment

                • mdedetrich
                  Senior Member
                  • Nov 2019
                  • 2507

                  #18
                  Originally posted by babali View Post
                  What's the benefit of having a GCC port?
                  Compared to having a gcc backend in official rustc compiler? None really, since in reality it will always be playing catchup to official rustc.

                  Comment

                  • bug77
                    Senior Member
                    • Dec 2009
                    • 6481

                    #19
                    Originally posted by babali View Post
                    What's the benefit of having a GCC port?
                    Well, let's look at this in reverse. LLVM was a compiler for C/C++ initially. So it catered to that. When Rust started using LLVM, it turned out some assumptions LLVM was making, only worked for C/C++. LLVM went on to fix (some of) that and it became a better compiler as a result. That is one of the benefits here: some of the assumptions Rust made, will only work with rustc, having gcc bring those to light can make Rust a better language.

                    And, of course, what everyone before me has said.

                    Comment

                    • bug77
                      Senior Member
                      • Dec 2009
                      • 6481

                      #20
                      Originally posted by mdedetrich View Post

                      Or you could just do your research and stop spreading BS.

                      Linux used many non standard GCC extensions in the codebase which meant that only GCC could compile it, it wasn't a standard C codebase in this regard (so much for standards).
                      Hey, standards are essential! How else would you know what to deviate from?

                      PS It's the same story with good practices - references, so you'll know what to stay away from.

                      Comment

                      Working...
                      X