• psud@aussie.zone
    link
    fedilink
    English
    arrow-up
    15
    ·
    13 hours ago

    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

      • mschae@discuss.mschae23.de
        link
        fedilink
        English
        arrow-up
        5
        ·
        6 hours ago

        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.

        • Victor@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          2 hours ago

          I should’ve known it’s a “it depends” answer. 😆 It’s programming languages after all. 😉

          Thanks for the insight though, I appreciate it! 🙏