You're conflating developer tools with a language runtime. Every popular OS ships with everything necessary to run a C, Go, or Rust binary. Python 3 and Java both require a separate runtime to be installed, but I will say that every Java CLI I've used has had terrible startup performance.
I'm using Lanterna, a Java library for creating text-based terminal GUIs (https://github.com/mabe02/lanterna), and the startup is 1-2 seconds. Can't recommend it enough
Good to know, but 1-2 seconds is still very slow compared to a native app. I have an 8MB Go CLI application that can startup and print its help in .05 seconds, and even that is probably slow compared to a C or Rust equivalent.
Any savy Java developer knows how to AOT compile to native code, if that really matters.
There are plenty of JDKs that support it, and even Oracle is finally adding support for it with Java 9, initially only for Linux x64.
By Java 10 timeframe no one that only knows about OpenJDK and not the several other JDKs can state that Java starts slow vs C, because both will be AOT compiled to native code, loading native .so files.
From what I've seen Java/JVM AOT won't produce binary executables but shared libraries that will be loaded on startup by the JVM.
When I first read about Java AOT-compilation I expected it to produce real executables that's why I think this is important to mention.
But please correct me if I am wrong.
So if this is true even with AOT compilation you still need the JVM as dependency (although I think you can get a minimal JVM in under 10MB).
It also seems that the AOT compiled code needs to be recompiled on Java updates.
Although I quite like Java and the JVM, I still wouldn't choose Java for writing simple command line tools.
Nevertheless it is quite useful for improving startup for tools like Gradle or server applications.
But sure, I also don't expect Java startup performance to be a problem in the mid- to long-run.
Correct, but that is no different than having to ship glibc.so or MSVCRT.dll alongside your application, specially if you want to be certain which version gets used.
This is only relevant to Oracle's implementation though.
Other JDKs do support static linking, as long as you restrain yourself from features that could require dynamic compilation.
There was a talk at JVM Languages Summit about the current state of AOT compilation regarding Java 10.
I would rather ship glibc (8MB) or musl (.5MB) than the JVM (100s of MBs?), but it's not necessary given that nearly every target already has a libc. Also, Go programs don't depend on libc, and C and Rust can probably statically link against some libc in a pinch.
Good point, but I wonder what size will the final binaries have, given that bytecode inflates significantly when translated to the machine code (there was a good discussion on HN recently about app sizes)
That's presumably not loading any libraries at all though - the time to being interactive (or just doing something useful) will get worse as more bytecode has to be decompressed and loaded.
opening and quiting vim for a file of 2500 lines of C++ (so with all the plugins and stuff) takes 0.030seconds.
I don't see how you can be satisfied with 2 seconds startup for a terminal application
Well there is a truth to that. However this might be something symptomatic. As power consumption is getting more and more interesting nowadays, having a minimal impact on system resources overall might still be a sensible goal.
I completely agree that for a interactive tool like text editor startup time is crucial. But in my case being a bit on the slow side is probably fine, because the UI is for informational purposes only, and VLC takes around 5-10 seconds anyways to startup and begin playing the file, that is being downloaded.
I'm not conflating them and it's still a silly way to frame the question. If you want to ask someone why they wrote something in language X, just ask them that.
You're being pedantic; natural language is contextual for better or worse. Anyway, asking "Why did you use Java", is likely to be interpreted as a slight against the language and thus be downvoted (indeed, his politely phrased question was even downvoted when I saw it!).