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

  • nslay
    replied
    Originally posted by atomsymbol View Post

    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
    }
    https://doc.rust-lang.org/std/ops/trait.Add.html

    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:
    https://doc.rust-lang.org/book/traits.html

    Leave a comment:


  • atomsymbol
    replied
    Originally posted by nslay View Post
    Rust supports object oriented programming through Generics
    OO through Generics?

    Leave a comment:


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

    Rust sounds very suitable for high security scenarios.

    Leave a comment:


  • peppercats
    replied
    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; 06-10-2016, 04:09 PM.

    Leave a comment:


  • uid313
    replied
    I would love to see a SSH daemon written in Rust.

    Leave a comment:


  • caligula
    replied
    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?

    Leave a comment:


  • cb88
    replied
    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.

    Leave a comment:


  • caligula
    replied
    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?

    Leave a comment:


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

    Leave a comment:


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

    Leave a comment:

Working...
X