3 ms·
> Use the right tool for the job. Do you agree with the article's recommendation of Rust for command-line tools, or do you think Go is the right tool for that
by pansa2 6y ago
> Use the right tool for the job.
Do you agree with the article's recommendation of Rust for command-line tools, or do you think Go is the right tool for that job as well?
Or perhaps I should stick with C++? For one thing, it's nice to be able to re-use code between command-line tools and other C++ programs, which AFAICT would be a bit harder between Rust & C++ and much harder between Go & C++.
- hamandcheese 6y agoI’m not the one you asked, but I think go is also a fine language for command-line tools, thanks to is truly breezy cross-compilation story.
- ericbarrett 6y agoThe ability to trivially cross-compile in Go, and get a single-file executable artifact, is often mentioned but still not appreciated enough. This is still a multi-hour project, minimum, for most languages, especially if you are introducing a second platform to a well-established project. In Go, it‘s a compiler flag. I think between http, encoding/json, and the io libraries, it’s also very simple and straightforward to do most of the things a typical command-line program does, in a cleaner way than shell or Python (both have their place) and with less fuss than Rust or C++.
- krferriter 6y agoThere's a relatively large difference in executable size, which might matter in some situations. And in run time. For executables that can get put to task doing a lot of heavy lifting and hammering on memory resources like grep and awk and others, it might make a real difference.