Announcement

Collapse
No announcement yet.

Making The Case For Using Rust At Low Levels On Linux Systems

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

  • #71
    Has Rust been crafted with all these use cases in mind?
    Yes. Rust was explicitly designed to be an alternative "successor to C" by people fed up with having to use C++ when it clearly had lost the plot with regards to C and was too constrained by backwards compatibility with design mistakes in existing C++.

    In fact, it's been specifically designed to allow you to reason about your program's low-level behaviour even more effectively than with C, by specifying much less undefined behaviour for the compiler to play around with than the C spec.

    Even -nostdlib is non-standard GCC (and maybe clang?) extension
    Rust has equivalent pragmas. What runtime it has (standard library, stack trace on panic, jemalloc as the default allocator, etc.) can be opted out of, and there are various efforts, both past and in progress, to write OS kernels (rustboot, redox, etc.), kernel modules (rust.ko, winapi-kmd-rs, etc.) and microcontroller firmware (Zinc, AVR-Rust, etc.) in it.

    IMHO, imcompatibility with shitload of pre-existing libs is a disaster.
    Rust isn't incompatible with the existing C libraries. The efforts to translate C libraries to Rust are purely to take advantage of Rust's much stricter compile-time checks (primarily letting the "borrow checker" statically verify memory safety at compile time rather than by adding something at runtime like a garbage collector.)

    Bindings in rust aren't like bindings in other languages. Rust's compatibility with C libraries is very similar to C++'s and Rust bindings exist mostly to enforce invariants and bridge the gap between how idiomatic C and idiomatic Rust do things. (eg. A wrapper around a database library would hook it up to Rust's RAII-style model for closing handles when they go out of scope.) Given that one of Rust's design goals is "zero-cost abstraction", the compiler's also very good at optimizing the wrappers to code at least as good as what you'd hand-write. (In the case of iterators, for example, you get safety without bounds checks because the compiler can prove, at compile time, that they're unnecessary. In addition, the closure-based API gets optimized to the same code you'd get by writing a for loop without closures.)

    And who told I want it to download some crap from network without my consent? Then, what about centralized locations and means of override? Could I have my own repos/lists, getting all Mozilla spiggots out of the way? If no, I wouldn't touch it with 10' pole for the time being. Getting locked down on centarlized repo/list managed by Mozilla thing is absolutely last thing I may want.
    It's possibly to specify a crate's location explicitly (similar to how pip for Python will accept URLs in addition to package names), local overrides are supported, and a flag that means "NEVER do network requests. Die with an error if you have to." is in development. (In fact, lack of that is the main remaining blocker for Rust getting integrated into Firefox's build system.)
    Last edited by ssokolow; 06-26-2016, 01:20 AM.

    Comment


    • #72
      Originally posted by ssokolow View Post
      Yes. Rust was explicitly designed to be an alternative "successor to C" by people fed up with having to use C++ when it clearly had lost the plot with regards to C and was too constrained by backwards compatibility with design mistakes in existing C++.
      From my perspective, the most severe problem of C++ is the amount of time it takes to compile. In theory there do exist methods for making typical C++ code compile 10x faster but unfortunately C++ compiler implementations aren't there yet.

      Comment


      • #73
        Originally posted by atomsymbol View Post

        From my perspective, the most severe problem of C++ is the amount of time it takes to compile. In theory there do exist methods for making typical C++ code compile 10x faster but unfortunately C++ compiler implementations aren't there yet.
        That is one area they're still working on in Rust. They prioritized stuff that couldn't be improved later without breaking existing code, such as deciding on a balance point between type inference and explicitness which makes things comfortable without causing "action at a distance" and massive error messages as C++ is prone to.

        Comment


        • #74
          Originally posted by SystemCrasher View Post
          rant
          tl;dr: It's apparent that you have no idea what you are talking about. Talk about FUD, you're full of it..

          Comment


          • #75
            Originally posted by mmstick View Post
            tl;dr: It's apparent that you have no idea what you are talking about. Talk about FUD, you're full of it..
            Yes, I'm full of FUD when it comes down to Mozilla and especially anything relying on their nasty online services, they've both surpassed Google in terms of aggressive data mining (like "telemetry" backdoor crap they are planting here and there) and weird restrictions (like mozilla being the only authority who could sign extensions). Thanks to Mozilla's own actions I'm definitely not going to touch their products with 10' pole. Seems they want to be MS/Apple style ecosystem and I wish them good luck heading this direction. I'm not going to be fond of ppl trying to push dependence on such entity either.

            Comment


            • #76
              Originally posted by SystemCrasher View Post
              Yes, I'm full of FUD when it comes down to Mozilla and especially anything relying on their nasty online services, they've both surpassed Google in terms of aggressive data mining (like "telemetry" backdoor crap they are planting here and there) and weird restrictions (like mozilla being the only authority who could sign extensions). Thanks to Mozilla's own actions I'm definitely not going to touch their products with 10' pole. Seems they want to be MS/Apple style ecosystem and I wish them good luck heading this direction. I'm not going to be fond of ppl trying to push dependence on such entity either.
              For Telemetry, they explicitly ask you when you first launch the browser and give you control over two different levels of opt-in at Preferences > Advanced > Data Choices.

              As for signed extensions, they got fed up with crapware companies exploiting their installers' privileged access to the host system to circumvent user permission prompting by patching Firefox's configuration. Yes, I dislike the solution they chose and always stay on Developer Edition, which will keep the check optional, but I can certainly see where they're coming from. (The only real way to make it prohibitive for crapware is to hard-code the check so the crapware would have to include binary patches for major Firefox releases, at which point it would be too virus-like for malware scanner companies to ignore.)

              Comment


              • #77
                Originally posted by SystemCrasher View Post
                Yes, I'm full of FUD when it comes down to Mozilla and especially anything relying on their nasty online services, they've both surpassed Google in terms of aggressive data mining (like "telemetry" backdoor crap they are planting here and there) and weird restrictions (like mozilla being the only authority who could sign extensions). Thanks to Mozilla's own actions I'm definitely not going to touch their products with 10' pole. Seems they want to be MS/Apple style ecosystem and I wish them good luck heading this direction. I'm not going to be fond of ppl trying to push dependence on such entity either.
                1. The telemetry is optional. Period.
                2. There are good reasons to not allow just anyone to sign add-ons. XUL based add-ons can easily gain access to lower level system resources. It's an outright miracle we haven't seen more nastiness in the past few years. Particularly after the introduction of js ctypes made it ever more easy to call into low level native code.

                Comment


                • #78
                  ssokolow To me Mozilla looks like COM, CORP and wannabe-apple these days. I do not want package management from someone like this, especially granted apt-get install libsomething-dev works for me in C/C++ and maintainers of my distros proven level-headed by 10+ years of positive experience. They never considered removing overrides from package manager to "secure" me, etc. And even google's chromium 100% ok with any crx I give it, dammit. It looks like npm/pip/cargo/... are solely meant to solve fucking windows problems and prefer to do it windows/apple ways. I'm not okay with it.

                  So when it comes to Mozilla stuff I could have biased views and so on. But Mozilla IMHO have to blame itself for this. It wasn't me who put sigs but forgot to put option to install my own keys or get rid of their "protection" racket. Then telemetry is optional, ads could be disabled. But darn, its got worse than Chromium in terms of annoyance and lack of customization and technically being well behind of chromium techs as well. Their "browser.html"? I wish 'em luck to persuade e.g. web devs to launch this bizarre thing to check page rendering. Are they prepared to rename to Mozilla Software ASA? (yeah, I'm trolling, but after looking on browser.html "tech preview" I'm really tempted to ask this).

                  Comment


                  • #79
                    Originally posted by unixfan2001 View Post
                    1. The telemetry is optional. Period.
                    Yeah, but overall Mozilla got way too annoying. Lol, MS recently been caught on calling telemetry XD services in MS VS runtime. Funny coincidence.

                    2. There are good reasons to not allow just anyone to sign add-ons. XUL based add-ons can easily gain access to lower level system resources. It's an outright miracle we haven't seen more nastiness in the past few years. Particularly after the introduction of js ctypes made it ever more easy to call into low level native code.
                    Those who would give up essential liberty to obtain little temporary safety, deserve neither liberty, nor safety. Apple told similar things. It ended in total lockdown of ecosystem and even inability to use e.g. GPLed programs. And then apple decides what is good and what is bad. So you can't e.g. download torrents using iphone. Coz apple decided it is "bad". Oh, one can't even install real Firefox in iOS since apple decided it is prohibited to install any SW capable of executing other code. So Gecko is "illegal" on iOS. And "firefox" for IOS is a mere skin to system-level webkit. Same crap in my browser? No way, I'm not going to buy this. Even less welcome in compiler toolchain & homegrown "package manager".

                    Comment


                    • #80
                      Originally posted by SystemCrasher View Post
                      Yeah, but overall Mozilla got way too annoying. Lol, MS recently been caught on calling telemetry XD services in MS VS runtime. Funny coincidence.
                      Not sure what one has to do with the other. Mozilla isn't Microsoft.

                      Those who would give up essential liberty to obtain little temporary safety, deserve neither liberty, nor safety.
                      You aren't losing "liberty".

                      1. The changes only concern type 2 add-ons. Nothing else.
                      2. Little temporary safety? Not being able to easily nuke your entire system by running unsigned, untested, malevolent C/C++ code is "little temporary safety" for you?
                      3. You can still install Firefox Developer Edition or Firefox Nightly. Particularly the developer edition is made to run unsigned code. For enterprise setups there is Firefox Unbranded.


                      Apple told similar things.
                      Mozilla isn't Apple.

                      It ended in total lockdown of ecosystem and even inability to use e.g. GPLed programs.
                      Last time I checked, GPLed software runs fine on Mac OS X.
                      It's hardly their fault that they can't allow GPLed software in their store.

                      It's general consensus that commercial app stores including any additional EULA are incompatible with the GPL. Thus says the FSF.


                      Coz apple decided it is "bad"
                      They didn't do shit. The FSF did.

                      One can't even install real Firefox in iOS since apple decided it is prohibited to install any SW capable of executing other code. So Gecko is "illegal" on iOS.
                      Welcome to the 21st century. Where we take security seriously! Stop being a whiny child, FFS! No one in the system engineering world is going to take you seriously with that attitude.

                      Same crap in my browser? No way, I'm not going to buy this.
                      Yea. Because not being able to exploit remote vulnerabilities is totally the same as a DRM filled, locked down app store and a sandboxed security model that prevents you from creating a different browsing engine...

                      For being the guy who, by his own admission, prefers "simple designs", you sure protest loudly about not being able to run the freaking kitchen sink within your browser.

                      Doubly ironic, considering that just yesterday you complained about npm being too trusting.

                      Even less welcome in compiler toolchain & homegrown "package manager".
                      You just lost me. What kind of "restrictions" does the compiler toolchain lay on you, pray tell?

                      Comment

                      Working...
                      X