3 ms·
I fully agree, and in what concerns command line utility applications I see no benefit of using Rust's borrow checker. At most if a rewrite would happen, it ma
by pjmlp 1y ago
I fully agree, and in what concerns command line utility applications I see no benefit of using Rust's borrow checker.
At most if a rewrite would happen, it makes much more sense in a compiled language with automatic resource management.
- crote 1y agoCommand line utilities often handle not-fully-trusted data, and are often called from something besides an interactive terminal. Take for example git: do you fully trust the content of every repository you clone? Sure, you'll of course compile and run it in a container, but how prepared are you for the possibility of the clone process itself resulting in arbitrary code execution? The same applies to the other side of the git interaction: if you're hosting a git forge, it is basically a certainty that whatever application you use will call out to git behind the scenes. Your git forge is connected to the internet, so anyone can send data to it, so git will be processing attacker-controlled data. There are dozens of similar scenarios involving tools like ffmpeg, gzip, wget, or imagemagick. The main power of command line utilities is their composability: you can't assume it'll only ever be used in isolation with trusted data!
- pjmlp 1y agoNone of that requires a borrow checker. Any memory safe compiled managed language will do.
- crote 1y agoThat's definitely true! Some people might complain about the startup cost of a language like Java, though: there are plenty of scripts around which are calling command-line utilities in a very tight loop. Not every memory-safe language is suitable for every command-line utility.
- pjmlp 1y agoJava is not the only option, and even then, GraalVM and OpenJ9 exist, long are the days people had to pay for something like Excelsior JET.