• qaz@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    8 days ago

    I usually pick Rust for CLI tools because:

    1. It’s statically compiled and isn’t dependent on system binaries and won’t break if there if the system has the wrong version like C/C++, allowing you to distribute it as a single binary without any other installation steps
    2. Still produces fairly small binaries unlike languages like Java or C# (because of the VM)
    3. Is a modern language with a good build system (It’s like night and day compared to CMake)
    4. And I just like how the language works (errors as values etc.)
    • Dark Arc@social.packetloss.gg
      link
      fedilink
      English
      arrow-up
      4
      ·
      8 days ago
      1. It’s statically compiled and isn’t dependent on system binaries and won’t break if there if the system has the wrong version like C/C++, allowing you to distribute it as a single binary without any other installation steps

      You can do that with C++ too.

      1. Still produces fairly small binaries unlike languages like Java or C# (because of the VM)

      I mean, the jars are actually pretty small; but also I really don’t get the storage argument. I mean we live in a world where people happily download a 600 MB discord client.

      1. Is a modern language with a good build system (It’s like night and day compared to CMake)

      Meson exists … as do others.

      1. And I just like how the language works (errors as values etc.)

      Fair enough; though why? What’s wrong with exceptions?

      I work in a code base where I can’t use exceptions because certain customers can’t use exceptions, and I regularly wish I could because errors as values is so tedious.