We want to write a command line interface tool that will be distributed to our customers. It is intended to be used on Linux. This CLI tool primarily will do few remote REST API calls, copy large number of big files from local file system to remote server (like AWS S3) and is expected to take few hours to complete. We have lot of in-house Java expertise. Should we pick Go, Python, Java or some other language? I am biased towards Java but would like to hear additional opinions.
A lot of people here are suggesting Go for its single binary with no dependencies, but if you're starting a small green field project in Java you should have no issue making sure it's jlinkable and even compiling it to a single statically linked binary with Graal.<p>This way you can re-use your Java expertise and still get a statically linked single binary with quick startup.
JDK 11 comes with a new HttpClient. Might be useful and fun to learn.<p><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html" rel="nofollow">https://docs.oracle.com/en/java/javase/11/docs/api/java.net....</a>
I think you'll have the fewest distribution issues with a go binary. But if you have lots of experience building and distributing java programs to your customers then go with what you know!
I have written several similar programs using Python's cmd.Cmd class. Command completion, help messages, etc are all taken care of. All I need to do is to write the nitty gritty for each command and copious log the actions taken their return status to catch any networking, REST, etc issues. It is even possible to nest command interpreters within command interpreters to create sub-commands if applicable.<p>I should mention that I am more productive in Python than either Java or Go - so this may taint my view of alternatives.
I really like using Go for this. The single binary with zero dependencies makes it really easy to deploy. You do not need the jvm or python environment setup. If you change something like upgrading your jvm or python or a library, aside from the path, the binary keeps working.<p>Maintaining things is just much simpler with a single binary.
It depends on your customers. Will they have the right version of python? Will they install the Java runtime environment and the correct one (I assume that is a thing, but I'm not Java person)?<p>Or you can skip all of that and just use Go that runs as a single, stand alone binary and very likely uses less memory than Java.
If you want to integrate with AWS/Azure, Python is the language of choice for CLI.<p>It's because the actual AWS CLI/Azure CLI is written in Python and they have the most supported interface so far known.<p>I personally like Go because it's easier to ship a static binary but in this case I would recommend otherwise.