Announcement

Collapse
No announcement yet.

Google To Allow Rust Code In The Chromium Browser

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

  • Originally posted by Weasel View Post
    Because it fails to compile?
    That doesn't give you magic capabilitys to write a harder language. You just get frustrated that you cant even compile something.
    What are you going to show your boss when he asks for progress, code that won't compile?
    Ok, if the boss asks for it, the programmers become magically better? Why didn't the boss just ask for better C++ code then?
    They'll spend probably 5 times more on the same piece of code battling with the borrow checker.
    And they save 20 x the time afterwards not chasing strange bugs in the threading code or other memory bugs.

    Comment


    • Originally posted by Anux View Post
      That doesn't give you magic capabilitys to write a harder language. You just get frustrated that you cant even compile something.
      Like I said, Rust isn't harder. In fact, if your code doesn't compile, the compiler actually tells you why, it doesn't just say it doesn't compile.
      You'd only get frustrated if you were rejecting all avenues to learn from. Otherwise, if your code doesn't compile, the compiler is directly teaching you why. That's why people say the best Rust teacher is the compiler itself.
      Once you've learned all the compiler's lessons (which is not hard, lifetimes are actually very straight forward. Only one can mutably borrow, or many can immutably borrow; that's it, it's not much more complicated than that), then you've learned Rust, and can take advantage of all of it's features; strong typing, lifetimes, simple syntax and consistent types. For some reason, people think they're hinderances. They're not, they're extremely powerful tools. And when you learn how to use them, you can create extremely sophisticated programs without the cognitive load required in other languages.

      Comment


      • Originally posted by Ironmask View Post
        Like I said, Rust isn't harder.
        Don't tell me, I have written a few lines in it. It certainly has a higher learning curve but once you understand the borrow checker it is as easy as any other language.

        I was trying to show that Weasels way of thinking is flawed. And rust is actually a good solution if your programmers (good or bad) make many memory errors.

        Comment


        • Originally posted by Anux View Post
          That doesn't give you magic capabilitys to write a harder language. You just get frustrated that you cant even compile something.
          I can tell you haven't programmed a single line of code if you give up on a compilation error. So the rest of the point is moot, we're in different worlds.

          You don't need to be magically better. You need to restructure the code to satisfy the strict constraints imposed by the language. Refactoring takes a lot of time buddy, if you started off with something flawed.

          I don't care if it's ultimately good for the end product (less bugs etc), like I said I wasn't blaming Rust for it. I'm just stating that the average Mozilla/Chrome dev sucks.

          Comment


          • the idea that rust is hard to write anyways is outright wrong anyways.

            Comment


            • Originally posted by Weasel View Post
              I can tell you haven't programmed a single line of code if you give up on a compilation error.
              Wooha, you can tell a lot by things I never wrote. I was talking about your hypothetical dumb google devs. And your attitude towards a large group of devs that you know nothing about tells a lot more about your experience as a programmer than anything else.

              You don't need to be magically better.
              You where the one to claim rust is harder to write. If something is harder then another thing, that you were already struggling with, of course you need to be better to do it. Do you even logic?

              You need to restructure the code to satisfy the strict constraints imposed by the language. Refactoring takes a lot of time buddy, if you started off with something flawed.
              And it saves a lot of time afterwards, because you don't need to search for certain hard to catch bugs.

              I don't care if it's ultimately good for the end product (less bugs etc), like I said I wasn't blaming Rust for it. I'm just stating that the average Mozilla/Chrome dev sucks.
              And that's just an unproven claim that doesn't make you look grown up.

              Comment


              • Originally posted by Anux View Post
                Wooha, you can tell a lot by things I never wrote. I was talking about your hypothetical dumb google devs. And your attitude towards a large group of devs that you know nothing about tells a lot more about your experience as a programmer than anything else.
                Funny thing is you can figure out a lot about some devs by looking at the code they write. As an experienced dev, you would know that, wouldn't you?

                Originally posted by Anux View Post
                You where the one to claim rust is harder to write. If something is harder then another thing, that you were already struggling with, of course you need to be better to do it. Do you even logic?
                WTF are you even talking about? Do you think harder means impossible? That's your problem, not mine, stop putting words in my mouth.

                Harder things usually require more time. We're not talking algorithm development here, just standard programming. So even if they're dumb, they can still code in Rust, albeit slower. As I said, even in C++ they'd have to code slower for quality code, except that they usually take the easy way out there, producing the poor code we can see today in Chromium. In Rust that's a hard compilation error so they can't pick the easy way out.

                For algorithms, yeah, if you suck you won't even get the result done at all, but that's not what Rust vs any other language is about.

                Originally posted by Anux View Post
                And it saves a lot of time afterwards, because you don't need to search for certain hard to catch bugs.
                And you're saying this because...?

                I'm not arguing why Rust is bad in this topic. The argument was that the Chromium/Firefox codebases are made by bad devs, since that's what I replied to him. You decided to reply to it, so fucking focus on the topic?

                tl;dr Chormium/Firefox C++ codebases are beyond ugly and shit. Argue about that or shut the hell up. I'm not talking about Rust being bad. I'm using Rust as example to say that they will be forced to code slower because THEIR CODE WON'T COMPILE. And that's a GOOD THING so idk why you're on my case?

                Comment


                • Originally posted by Weasel View Post
                  Harder things usually require more time. We're not talking algorithm development here, just standard programming. So even if they're dumb, they can still code in Rust, albeit slower. As I said, even in C++ they'd have to code slower for quality code, except that they usually take the easy way out there, producing the poor code we can see today in Chromium. In Rust that's a hard compilation error so they can't pick the easy way out.
                  I still disagree with this. Rust is a very high-level language, it abstracts a lot of concepts that would otherwise cause some cognitive load.
                  Take, for instance, the Mutex. The Mutex<T> type encapsulates the data it's locking over. You don't have to take the extra time and consideration to worry if you're properly locking or unlocking, or if you're accessing the data at the wrong time. You can *only* access the data when you have the lock, you *cannot* access the data after you release the lock, there are no ways around this at all. If you drop (release) the lock, the access to the data is gone, you can't reach it anymore. You can't copy a reference and store it somewhere after you released it, the compiler simply won't let you. Not even to simply read it. It makes programming more convenient and worry-free, so you spend less time worrying about things like that. You don't get those guarantees in languages like C, C++, C# etc., you end up having to worry and wonder if you're really accessing that data correctly, if you're really holding the correct lock.
                  Or maybe you take good advice and don't use a Mutex at all, but instead use message passing, like channels. So if you have a type that can be multiple things (an enum), the receiver of the message *must* check all of it's states. If they forget one, the compiler will tell them. They cannot accidentally forget one (unless they use a wildcard, but actually I never seen people use those).
                  Even then, if you manage to write some non-idiomatic code, Clippy itself will tell you that. I certainly don't consider myself bad or a novice, but even I've written some code that was actually pretty dumb or pointless, and Clippy told me about it and said what I should do instead. It's one of the most powerful and extensive linters I've ever seen and it comes baked into the toolset. The tooling itself teaches you how to program better even if you didn't expect it to. Like having an experienced developer over your shoulder guiding you.
                  What Rust does it confines and restricts what an API can do at compile-time. With less options and pitfalls to worry about, you can pretty much just speed through writing something because the API can only really be used in one way. You're not going to get slowed down wondering or worrying what to call next or what resources you need to clean up, you're not gonna get caught on runtime bugs from using the API incorrectly. You certainly spend way less time pouring over docs (if they documented anything at all) since the API pretty much documents itself. Of course, all Rust libraries are also pretty well documented. I actually set a Clippy macro in my projects to warn me if anything isn't documented.

                  Comment


                  • Originally posted by Lycanthropist View Post
                    With containers and smart pointers, modern C++ can be just as memory safe as Rust. All memory related proplem stem from interfacing with older code. Rust has the same problem when having to interface with a C library.
                    No it cannot, this is false and I wish people would stop repeating it.

                    Firstly, Rust's compiler guarantees extend much further than containers/smart pointers. More critically however, because of C++'s design and history there are various gotchas/escape hatches that allow programmers to circumvent these abstractions. Due to Rust being designed with resource safety right from the start as a core design principle, this cannot be done without using unsafe which means its explicit and there are even crates that allow you to ban unsafe if you need to do so.

                    Comment


                    • Originally posted by Ironmask View Post

                      Slowness is entirely from Google's telemetry services. I use Brave and it's probably the most optimized Chromium-based browser on the market. Pretty much any non-Google Chromium-based browser is faster than Google Chrome.
                      Also adding a language to a project has no bearing on it's performance. Chromium is already a multi-process program communicating through IPC, no language runtime (especially not one on-par with C) is going to compare to that delay.
                      Exactly, I use brave as well and have never looked back since. It cherry picks the best of both worlds (the core performance of chromium and the privacy of Firefox) and its also purely open source. They have also stripped all of the Googleisms out of the chromium browser and have managed (without the use of extensions) to do things like block ads from youtube, something you cannot do just with DNS blocking.

                      Originally posted by Sonadow View Post
                      Rust on Chromium already exists. It's called Brave.

                      But practically no one here knows it because they are too stupid to compile their own browser.


                      I use it!
                      Last edited by mdedetrich; 19 January 2023, 07:03 AM.

                      Comment

                      Working...
                      X