Announcement

Collapse
No announcement yet.

Google Making $1M USD Investment To Improve Rust & C++ Interoperability

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

  • Google Making $1M USD Investment To Improve Rust & C++ Interoperability

    Phoronix: Google Making $1M USD Investment To Improve Rust & C++ Interoperability

    Google is announcing today they are contributing $1M USD to the Rust Foundation to focus on enhancing interoperability between the C++ and Rust programming languages...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Good. Language interoperability is a key factor that will make the advantages of Rust available to more users.

    Comment


    • #3
      Bolt on a C and C++ frontend into the language within unsafe{} and that will solve a lot of issues relating to pulling in half of the NPM-style crates.io micro-dependencies just to open up a trivial GUI window.

      It won't be pretty but it means serious projects will actually consider Rust. Rather than a couple of random experimental extensions here and there.

      Comment


      • #4
        Originally posted by kpedersen View Post
        Bolt on a C and C++ frontend into the language within unsafe{} and that will solve a lot of issues relating to pulling in half of the NPM-style crates.io micro-dependencies just to open up a trivial GUI window.

        It won't be pretty but it means serious projects will actually consider Rust. Rather than a couple of random experimental extensions here and there.
        Huh? A) You can't bolt on unsafe into these languages. If it was that easy, somebody would have already done it. All C experiments to do this sort of things have failed for decades for very good reasons B). Crates are not NPM style at all and plenty of projects including Windows and Linux kernel use Rust without any crates dependencies anyway C) Plenty of serious projects including Android, Windows kernel and many projects have adopted Rust on critical portions used by millions of users (Binder and Windows networking stack for example). Calling it an experiment at this point is just denying reality.

        Comment


        • #5
          Originally posted by spicfoo View Post
          A) You can't bolt on unsafe into these languages.
          Yes you can. Emscripten's inline JS is one example. Even Golang's preamble stuff calling into a C frontend is an example of this

          Originally posted by spicfoo View Post
          B). Crates are not NPM style at all
          Yes it is

          Originally posted by spicfoo View Post
          and plenty of projects [...] use Rust without any crates dependencies anyway
          No they don't

          Originally posted by spicfoo View Post
          Windows networking stack for example
          Winsock is C. Based on the older POSIX/BSD sockets implementation. Nothing to do with Rust.

          Originally posted by spicfoo View Post
          Plenty of serious projects including Android, Windows kernel and many projects have adopted Rust on critical portions
          No they haven't. Only trivial extensions until Rust can prove itself. Both can happily be built without Rust for example. The definition of "not critical".

          But I'm not really here to discuss Rust's currently low uptake by the industry after a decade. More how to facilitate better interoperability between industry codebases to potentially *increase* its usage. For example "rewrite a project in Rust" is not productive at this point as most people have realized.
          Last edited by kpedersen; 05 February 2024, 01:51 PM.

          Comment


          • #6
            Originally posted by spicfoo View Post

            Huh? A) You can't bolt on unsafe into these languages. If it was that easy, somebody would have already done it. All C experiments to do this sort of things have failed for decades for very good reasons B). Crates are not NPM style at all and plenty of projects including Windows and Linux kernel use Rust without any crates dependencies anyway C) Plenty of serious projects including Android, Windows kernel and many projects have adopted Rust on critical portions used by millions of users (Binder and Windows networking stack for example). Calling it an experiment at this point is just denying reality.
            Wat. I think he meant the other day around; writing pure c/c++ within rust unsafe. And, yes, that would be ugly but very useful.

            Off-topic: I don't use rust and don't really understand why or how it's better than modern cpp, but to me, the syntax seems to be a hassle..

            Comment


            • #7
              Originally posted by kpedersen View Post
              No they haven't. Only trivial extensions until Rust can prove itself. Both can happily be built without Rust for example. The definition of "not critical".
              You are not paying attention. Neither Windows nor Android is buildable without Rust anymore. The definition of critical indeed.

              Comment


              • #8
                Originally posted by and.elf View Post

                Wat. I think he meant the other day around; writing pure c/c++ within rust unsafe. And, yes, that would be ugly but very useful.

                Off-topic: I don't use rust and don't really understand why or how it's better than modern cpp, but to me, the syntax seems to be a hassle..
                I believe Zig already has something like this for C (though not C++). (note: havent used zig myself, so this is just what I vaguely remember hearing...).

                But yeah, improved C++/rust interop would be good. Not sure including the clang frontend inside rustc is the way to do that though. That is quite a massive dependency.

                As for why it is better, memory safety and getting errors at compile time instead of runtime. Lots of nicer abstractions that make the language fun and fast to code in. Rust took a look at languages that came before and learned both from their successes and failures (not that it is flawless, nothing is).

                Especially important is that the language has built in support for tagged unions along with syntax to make those nice and safe to work with. So many of the other nice things build on top of that.

                Context: I have coded hard realtime embedded C++ professionally for over a decade, about a year ago I learned rust and love it.

                Comment


                • #9
                  Originally posted by spicfoo View Post

                  You are not paying attention. Neither Windows nor Android is buildable without Rust anymore. The definition of critical indeed.
                  This guy has like 3 or 4 different Phoronix accounts, all dedicated to going into any topic that mentions Rust and insisting that nobody uses it. People can tell him otherwise all day long, and he'll just respond with "no, that's not true", even if you cite sources lmao.

                  Comment


                  • #10
                    Originally posted by spicfoo View Post

                    You are not paying attention. Neither Windows nor Android is buildable without Rust anymore. The definition of critical indeed.
                    And while still not required, some interesting parts of the Linux kernel will soon require Rust, at least if you want to be able to run Linux with GPU acceleration on your Macbook using the M-series chips.

                    “The avalanche has already started. It is too late for the pebbles to vote." - JMS

                    Comment

                    Working...
                    X