Ask HN: CLI – Java or Python or Go?
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.
18 comments
[ 3.5 ms ] story [ 58.1 ms ] threadsimilarly, for java you place the burden on your users to install a jre
with go the standard build toolchain lets you easily cross-compile a bunch of statically linked binaries, so each user just downloads 1 file for their target platform and runs it.
personally i am much more productive writing code in python than in go (this is largely a consequence of spending 20x as much time writing python than go) but go is dramatically more ergonomic from a deployment perspective and has a great cross-platform library and cross-compiler support out of the box
Goreleaser for creating binaries, home brew, os packages, GitHub releases.
I should mention that I am more productive in Python than either Java or Go - so this may taint my view of alternatives.
https://docs.oracle.com/en/java/javase/11/docs/api/java.net....
Give go an honest try. I am sure it will not disappoint you.
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.
Maintaining things is just much simpler with a single binary.
This way you can re-use your Java expertise and still get a statically linked single binary with quick startup.
It's because the actual AWS CLI/Azure CLI is written in Python and they have the most supported interface so far known.
I personally like Go because it's easier to ship a static binary but in this case I would recommend otherwise.