I joined Lemmy back in 2020 and have been using it as [email protected] until somewhere in 2023 when I switched to lemmy.world. I’m interested in systemd/Linux, FOSS, and Selfhosting.

  • 3 Posts
  • 17 Comments
Joined 2 years ago
cake
Cake day: June 10th, 2023

help-circle





  • 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.)













  • qaz@lemmy.worldtoLinux@lemmy.mlWorth using distrobox?
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    18 days ago

    It works well when you want to install software that is not compatible with your distro, but it is not a great security measure since it integrates with your host system instead of acting as a sandbox.

    Isolation and sandboxing are not the main aims of the project, on the contrary it aims to tightly integrate the container with the host. The container will have complete access to your home, pen drive, and so on, so do not expect it to be highly sandboxed like a plain docker/podman container or a Flatpak.


  • TLDR: Rust, Go and other modern languages don’t use more dependencies than C/C++, but have larger binaries due to including libraries into the executable binary. This trade-off was chosen to ensure you can reliably run the executable on various systems without dependency issues.

    I personally have gone with both options on several occasions. Being able to include an HTTP client without having to debug someone’s cURL installation is certainly worth a few extra MiB’s of disk space. However, I’ve also used C instead of Rust to avoid a very simple CLI program turning into several MiB’s large binary (due to statically including the Rust std lib).