• 1 Post
  • 276 Comments
Joined 2 years ago
cake
Cake day: September 24th, 2023

help-circle




  • I mean, it would be great if this succeeded… ffmpeg is nice and all but its interface is clearly terrible and there’s absolutely no way it is remotely secure. Anyone that uses it on a server basically has to run it in its own VM, or a severely locked down sandbox.

    But good luck supporting all the codecs people expect. I’m not even talking the obscure ones ffmpeg supports; just the ones “normal” people use will be a life’s work.

    Also you have to change the name!


  • That is not actually a “data race”. It is a race condition for sure, but a data race is a very specific thing - where two threads access the same location at the same time and at least one is a write.

    That could be unsafe in Rust because it might lead to reading “impossible values” like an enum that isn’t equal to any of its variants. Therefore safe Rust must prevent it or there’s a soundness hole.



  • it has modules for everything

    Not everything. PyYAML, Pydantic and Typer are things I commonly want in scripts that aren’t in the standard library.

    Simply do pip install anything. But best practice is to use a python virtual environment and install packages into that one.

    It’s more than “best practice”. It’s mandatory on many recent Linux distros. And yeah setting up a venv and installing dependencies is not something you want to have to do for each script you run.

    Its one of the slowest to write code in.

    It depends what your goal is. If you want robust code that works reliably then I would say Rust has the edge still. Yes it will take longer to write but you’ll spend way less time debugging it and writing tests.


  • That’s kind of the point. You can do it in most languages, so why use a shitty one like Bash? Use a good language like Rust!

    Also there are aspects of languages that make many languages less suitable for this application though. For example Python, because you can’t use third party dependencies (or at least you couldn’t; I think uv has an equivalent of cargo script now). Java would be a pretty awful choice for example.


  • Yeah it’s great for little scripts. There’s even a cargo script feature that’s being worked on so you can compile & run them using a shebang.

    I’d use a shell script if it is literally just a list of commands with no control logic or piping. Anything more than that and you’re pointing a loaded gun at your face, and should switch to a proper language, of which Rust is a great choice.


  • It’s definitely a growing problem with Rust. I have noticed my dependency trees growing from 20-50 a few years ago to usually 200-500 now.

    It’s not quite as bad as NPM yet, where it can easily get into the low thousands. Also the Rust projects I have tend to have justifiably large dependencies, e.g. wasmtime or Slint. I don’t think it’s unreasonable to expect a whole GUI toolkit to have quite a few dependencies. I have yet to find any dependencies that I thought were ridiculous like leftpad.

    We could definitely do with better tooling to handle supply chain attacks. Maybe even a way of (voluntarily) tying crate authors to verified real identities.

    But I also wouldn’t worry about it too much. If you a really worried, develop in a docker container, use a dependency cooldown, and whatever you do don’t use cryptocurrencies on your dev machine.