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

  • #11
    Originally posted by Shimon View Post

    Rust is not OO which can be a hard sell to C++ or Python veterans.
    Rust supports object oriented programming through Generics and Traits and it can do dynamic dispatching for inheritance (although it really prefers Traits/Generics and static dispatching). But the object orientation is detached from the data and it's really weird to work with if you're familiar with C++. You declare a struct, then you declare Traits (which are like Java interfaces, kind of) and then implement these traits for your struct type. These traits and functions are then usable against your struct just like an object conceptually and syntactically.

    Comment


    • #12
      I wonder why suddenly Rust generates so much hype while Ada has been there for years.

      Comment


      • #13
        So in the author’s mind Rust is the way to go, just like systemd.
        That’s not helping with my opinion of Rust.

        Comment


        • #14
          Originally posted by totoz View Post
          I wonder why suddenly Rust generates so much hype while Ada has been there for years.
          Sure, the Ada compiler generates native binaries, but are they really comparable? Ada's feature set is close to Rust's main concepts?

          Comment


          • #15
            Originally posted by caligula View Post

            Sure, the Ada compiler generates native binaries, but are they really comparable? Ada's feature set is close to Rust's main concepts?
            Because ADA derives from Pascal... VHDL also hails to ADA syntax. The problem is that it is so verbose that it is cumbersome...this could be alleviated somewhat with better tooling but it either doesn't exist or costs an appendage and half your offspring.

            Emacs is probably as good as it gets free software wise for VHDL and ADA but I don't grok it.

            Comment


            • #16
              Originally posted by cb88 View Post

              Because ADA derives from Pascal... VHDL also hails to ADA syntax. The problem is that it is so verbose that it is cumbersome...this could be alleviated somewhat with better tooling but it either doesn't exist or costs an appendage and half your offspring.

              Emacs is probably as good as it gets free software wise for VHDL and ADA but I don't grok it.
              Not really interested in the syntax. Is there something related to Rust's lifetimes and traits in Ada?

              Comment


              • #17
                I would love to see a SSH daemon written in Rust.

                Comment


                • #18
                  Originally posted by Shimon View Post

                  Rust is not OO which can be a hard sell to C++ or Python veterans.
                  Nobody writes modern C++ in an OO fashion anymore. Look at any modern C++ codebase and it's just a sugared C with smart pointers, templates, and lambdas.
                  OO programming(in the Java sense) was a mistake.
                  Last edited by peppercats; 10 June 2016, 04:09 PM.

                  Comment


                  • #19
                    I would love to see a Tor implementation or a SSH daemon written in Rust.

                    Rust sounds very suitable for high security scenarios.

                    Comment


                    • #20
                      Originally posted by atomsymbol

                      OO through Generics?
                      Yeah, as strange as that sounds. If you want to do anything that would otherwise involve inheritance, you would probably use generics and traits to pass around objects that implement desired functions. Although, if I remember right, you can take references to traits themselves and do dynamic dispatching. But Rust seems to prefer using Generics to pass around different objects.

                      Like if you want a function that operates on something that implements/"inherits" a class/interface/trait that implements addition, you'd do something like:
                      Code:
                      fn do_thing<T: Add>(x : &T, y :&T) -> T {
                        x + y
                      }


                      Obviously, you could also just implement functions directly with structs without needing traits and call those functions in a way consistent with other OO languages. But that's not very interesting by itself. Traits is what really gives Rust the ability to do interesting things with objects.

                      See also the HasArea example in the Rust book:

                      Comment

                      Working...
                      X