you are viewing a single comment's thread
view the rest of the comments
[–] 8 points 3 months ago (9 children)

If anyone has some insight: is Rust more or less verbose than C, generally? Like if Linux would be rewritten in Rust, would the LOC increase or decrease, e.g.?

  • source
  • hideshow 9 child comments
  • [–] 12 points 3 months ago (1 child)

    Rust has a lot more 'batteries included' than C, and the memory ownership model works a lot better than garbage collection or C's YOLO model. It also has built-in async/await. But you're pretty much in the same boat as C when it comes to multiprocessing or thread-safety.

    Anyone building a long-running backend service would be wise to take a serious look at Rust. Personally, I'm glad Linus is open to change and isn't digging his heels in on this one.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 21 points 3 months ago (6 children)

    It's easier than C, it's safer than C, the compiler is more helpful than GCC

    I think it's fun

    Less verbose? I don't think so

    Lines of code about the same

    For someone starting out as a programmer for low level programming I would recommend rust

  • source
  • parent
  • hideshow 6 child comments
  • [–] 3 points 3 months ago (5 children)

    For the same purpose, would you recommend Rust over Zig?

  • source
  • parent
  • hideshow 5 child comments
  • [–] 13 points 3 months ago (2 children)

    As someone who has used both (but not for any serious, large projects), I'd say they target different audiences. First and foremost, Zig is not memory-safe in the way Rust is. On the other hand, Zig is way easier to write than unsafe Rust. Rust comes with a lot of features and libraries, while Zig is an intentionally small language, almost minimalistic (kind of like C, but modern).

    There are lots of different tradeoffs being made, so yes, I'll give the boring answer and say they are good for different kinds of projects :)

    If it's specifically low level programming (I'm envisioning programs where you need fairly direct control over memory, IO, etc.), you'd probably quickly need a lot of unsafe in Rust, which can quickly get very complicated to use safely. So I'd probably recommend Zig for that purpose.

  • source
  • parent
  • hideshow 2 child comments